• Dear forum reader,

    To actively participate on the forum by joining discussions or starting your own threads or topics, you need a game account and to REGISTER HERE!

Fixed [25047] Html 5 - Some battle freeze the game

  • Thread starter DeletedUser1953
  • Start date

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 :
Code:
"attackedUnitId": -5,
"dealtDamage": 34735,
"attackedUnitHitpoints": 511,
"unitHitpoints": 158,
"retaliationDamage": 48300,
"retaliationAttackModifier": 0.1,
"didRetaliate": true,
"round": 1,
Somewhere you parse the JSON
Code:
        if(obj.retaliationAttackModifier != null) {
            this.retaliationAttackModifier = de_innogames_shared_util_parsers_HaxeJSONParser.normalizeInt(obj.retaliationAttackModifier);
        }
(obj.retaliationAttackModifier contains the number 0.1 then
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);
};
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 !
 
Last edited by a moderator:

Karvest

Well-Known Member
in flash the same:
Code:
      public var retaliationAttackModifier:int;
just may be flash is not so strict while parsing json
 

DeletedUser2691

Guest
cestbiemoi - Thanks for posting this. This will probably be archived too but we'll see if any of this can be forwarded to the devs.
 

DeletedUser1953

Guest
I hope this will be fixed, between this new bug in html 5 and the old bug in flash (invisible units & gridlines).
I hope you will not annotate : "Not reproductible". Sure you need to do 20-40 manual battles (for metal tournament, the bug was more often), it takes some times. But strange to alternate version to mitigate the bugs (and the flash's bug exists from 2 years !). But when you do 100+ more manual battle, these bugs are somewhat boring but it is the only way to do 6K+ score in tournament but sure we are a minority ! (it affects automatic battle but i think that most people think it is a connection problem and reload the game !).
 
Last edited by a moderator:
Top