Fix for wfrp 4.0
This commit is contained in:
@ -407,26 +407,19 @@ Hooks.once('init', () => {
|
||||
},
|
||||
"trapping_qualities_flaws": (value) => {
|
||||
if ( value ) {
|
||||
//console.log("ATOUTS", value);
|
||||
var list = value.split( "," );
|
||||
let newQF = [];
|
||||
console.log("ATOUTS", value);
|
||||
var i=0;
|
||||
var re = /(.*) (\d+)/i;
|
||||
for (i=0; i<list.length; i++) {
|
||||
let trim = list[i].trim();
|
||||
if ( trim == "Trap Blade") {
|
||||
trim = "TrapBlade"; // Auto-patch, without space!
|
||||
//var re = /(.*) (\d+)/i;
|
||||
for (i=0; i<value.length; i++) {
|
||||
newQF[i] = duplicate(value[i]);
|
||||
if ( newQF[i].name == "Trap Blade") {
|
||||
newQF[i].name = "TrapBlade"; // Auto-patch, without space!
|
||||
//console.log("PATCHED", trim);
|
||||
}
|
||||
var splitted = re.exec( trim );
|
||||
//console.log("Current quality", splitted, trim );
|
||||
if ( splitted ) {
|
||||
//console.log("FOund:", splitted[0], splitted[1], splitted[2] );
|
||||
list[i] = game.i18n.localize( splitted[1] ) + " " + splitted[2];
|
||||
} else {
|
||||
list[i] = game.i18n.localize( trim ) ;
|
||||
}
|
||||
newQF[i].name = game.i18n.localize( newQF[i].name ) ;
|
||||
}
|
||||
return list.toString();
|
||||
return newQF;
|
||||
}
|
||||
},
|
||||
// Search back in careers the translated name of the groupe (as it is the name of the level career itself)
|
||||
|
Reference in New Issue
Block a user