DeletedUser1953
Guest
All information is already in the post :
https://beta.forum.elvenar.com/index.php?threads/tournament-steel-3-paladin-2-priest.12167/
But i chek the code and i find the bug :
It seems that there is an retaliationAttackModifier as a float :
Somewhere you parse the JSON
(obj.retaliationAttackModifier contains the number 0.1 then
But 0.1 | 0 gives 0 and the return value is not executed then the Std.parseInt is called on an number => exception (HxOverrides.cca => charCodeAt => does not exist on number class !)
=> you need to call normalizeFloat in place because it seems retaliationAttackModifier can be a float and not only an int !
I check the code on live and on beta, it is the same !
https://beta.forum.elvenar.com/index.php?threads/tournament-steel-3-paladin-2-priest.12167/
But i chek the code and i find the bug :
It seems that there is an retaliationAttackModifier as a float :
Code:
"attackedUnitId": -5,
"dealtDamage": 34735,
"attackedUnitHitpoints": 511,
"unitHitpoints": 158,
"retaliationDamage": 48300,
"retaliationAttackModifier": 0.1,
"didRetaliate": true,
"round": 1,
Code:
if(obj.retaliationAttackModifier != null) {
this.retaliationAttackModifier = de_innogames_shared_util_parsers_HaxeJSONParser.normalizeInt(obj.retaliationAttackModifier);
}
Code:
de_innogames_shared_util_parsers_HaxeJSONParser.normalizeInt = function(value) {
if(!value) {
return 0;
}
if(typeof(value) == "number" && ((value | 0) === value)) {
return value;
}
return Std.parseInt(value);
};
=> you need to call normalizeFloat in place because it seems retaliationAttackModifier can be a float and not only an int !
I check the code on live and on beta, it is the same !
Last edited by a moderator: