You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Earthdawn (FASA Official) character sheet companion/03.330/Earthdawn.js
+28-20Lines changed: 28 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -2051,11 +2051,12 @@ Earthdawn.timeStamp = function () {
2051
2051
Earthdawn.tokenRefresh = function ( obj ) { // token object
2052
2052
'use strict';
2053
2053
try {
2054
-
if( obj && obj.get( "name" )) { // Ignore any token without a name (probably not a real token.
2054
+
// if( obj && obj.get( "name" )) { // Ignore any token without a name (probably not a real token. Don't do this. name is often blank.
2055
+
if( obj && obj.get( "_subtype" ) === "token") {
2055
2056
//log( "refreshing token " + obj.get("name"));
2056
2057
let rep = obj.get( "represents" );
2057
2058
if( rep && rep != "" ) {
2058
-
let ch = getObj( "character", rep)
2059
+
let ch = getObj( "character", rep );
2059
2060
if( ch ) {
2060
2061
let ED = new Earthdawn.EDclass();
2061
2062
let edParse = new ED.ParseObj( ED );
@@ -10283,23 +10284,24 @@ log("Record Obsolete code. If you see this except on an 1879 sheet, please repor
10283
10284
else {
10284
10285
let ci = bi3[ i ].split( "," ), // typically of the form: "Cast, pre" or "Cast, code, Rid"
10285
10286
code, rid, pre;
10286
-
if( ci[ 1 ].trim().startsWith( "repeating_" ) ) { // we have a pre
10287
-
pre = ci[ 1 ];
10288
-
rid = Earthdawn.repeatSection( 2, ci [ 1 ]);
10289
-
code = Earthdawn.repeatSection( 3, ci[ 1 ]);
10290
-
} else if( ci[ 1 ] === "noRid" ) { // This is just to keep it from going into the else.
10291
-
pre = code = rid = undefined;
10292
-
} else if( Earthdawn.codeToName( ci[ 1 ], true ) && ci.length > 2 ) { // we have a code, and a rid
10293
-
code = ci[ 1 ];
10294
-
rid = ci[ 2 ];
10295
-
pre = Earthdawn.buildPre( code, rid);
10296
-
} else { // we probably just have a rid so assume "T"
10297
-
code = "T";
10298
-
rid = ci[ 1 ];
10299
-
pre = Earthdawn.buildPre( code, rid);
10300
-
}
10287
+
if( ci.length > 1 ) {
10288
+
if( Earthdawn.safeString( ci[ 1 ] ).trim().startsWith( "repeating_" ) ) { // we have a pre
10289
+
pre = ci[ 1 ];
10290
+
rid = Earthdawn.repeatSection( 2, ci [ 1 ]);
10291
+
code = Earthdawn.repeatSection( 3, ci[ 1 ]);
10292
+
} else if( ci[ 1 ] === "noRid" ) { // This is just to keep it from going into the else.
10293
+
pre = code = rid = undefined;
10294
+
} else if( Earthdawn.codeToName( ci[ 1 ], true ) && ci.length > 2 ) { // we have a code, and a rid
10295
+
code = ci[ 1 ];
10296
+
rid = ci[ 2 ];
10297
+
pre = Earthdawn.buildPre( code, rid);
10298
+
} else { // we probably just have a rid so assume "T"
10299
+
code = "T";
10300
+
rid = ci[ 1 ];
10301
+
pre = Earthdawn.buildPre( code, rid);
10302
+
} }
10301
10303
let sendon = (code === "T") ? rid : pre; // if it is a talent, just send the rowID, otherwise send on the entire pre from which the code and rid can be derived.
0 commit comments