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
In CasualtyOrderOfLosses#sortUnitsForCasualtiesWithSupport, a key is generated to look up in CasualtyOrderOfLosses#oolCache. This key is generated by summing up all of the hash codes of the types in the targets.
In Warcraft War Heroes, there are some combination of types that have the same hashcode as other combinations of types.
An example is:
Unit Type
HashCode
Footmen
984658568
Veteran-Pikemen
2139503253
SUM
3124161821
And
Unit Type
HashCode
Pikemen
1093844931
Veteran-Footmen
2030316890
SUM
3124161821
Do you have any ideas for an expected fix?
The hashcode of unittype either needs to be changed to not just be the name or the key needs to be more than a sum.
I've gone through git history and the code to calculate the key was better. But during a refactoring in 57f1145 (back in 2015), the key calculation was converted into the sum and has been that way since.
How can the problem be recreated?
Play the save game.
In
CasualtyOrderOfLosses#sortUnitsForCasualtiesWithSupport
, a key is generated to look up inCasualtyOrderOfLosses#oolCache
. This key is generated by summing up all of the hash codes of the types in the targets.In Warcraft War Heroes, there are some combination of types that have the same hashcode as other combinations of types.
An example is:
And
Do you have any ideas for an expected fix?
The hashcode of unittype either needs to be changed to not just be the name or the key needs to be more than a sum.
Attach a Save Game
wow-u25.zip
If playing a prerelease, which version are you using?
Game Version: Master
If playing a prerelease, does this happen on the latest release?
Is there anything else we should know?
This causes an exception
java.lang.IllegalStateException: sortedTargetsToPickFrom must have the same size as targetsToPickFrom list
so it is visible.The text was updated successfully, but these errors were encountered: