DoomRL > Bug Reports
incorrect resistance % in postmortem
(1/1)
Khashishi:
The mortem.txt says I have a melee torso resistance of 4294967276%.
...
10mm ammo chain (x250)
[t] 10mm ammo chain (x250)
-- Resistances -----------------------------------------------
bullet - internal 10% torso 10% feet 10%
melee - internal 10% torso 4294967276% feet 10%
shrapnel - internal 10% torso 10% feet 10%
acid - internal 0% torso 0% feet 50%
fire - internal 0% torso 55% feet 25%
-- Kills -----------------------------------------------------
91 former humans
...
Kantarza:
Thanks @Khashishi
Mighty impressive!
I'll see if I can reproduce the issue.
Kantarza:
The issue appears to be in Lua's calculation of resistances, somehow generating an overflow. I can't see how the overflow would manifest but if it did, then the display would show:
-- Resistances -----------------------------------------------
bullet - internal 10% torso 10% feet 10%
melee - internal 10% torso 4294967276% feet 10%
shrapnel - internal 10% torso 10% feet 10%
acid - internal 10% torso 10% feet 10%
fire - internal 10% torso 10% feet 10%
plasma - internal 10% torso 10% feet 10%
--- End code ---
If I adjust the player's melee resistance to be -1% then it shows (correctly but weirdly) as -1%. So in this case, something had generated the total resistance to be 2^32.
The new version of DRL implements a {!} around the string in mortem.lua. I'm not yet familiar with this syntax so it may be increasing the safety of the variable. I'd be very interested to see anyone else who has this issue.
Navigation
[0] Message Index
Go to full version