Chaosforge Forum

  • March 11, 2025, 21:35
  • Welcome, Guest
Please login or register.



Login with username, password and session length
Pages: [1]

Author Topic: incorrect resistance % in postmortem  (Read 7071 times)

Khashishi

  • Lance Corporal
  • *
  • Offline Offline
  • Posts: 31
    • View Profile
incorrect resistance % in postmortem
« on: September 17, 2024, 23:57 »

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
...
Logged

Kantarza

  • Private FC
  • *
  • Offline Offline
  • Posts: 8
    • View Profile
Re: incorrect resistance % in postmortem
« Reply #1 on: March 01, 2025, 06:30 »

Thanks @Khashishi

Mighty impressive!

I'll see if I can reproduce the issue.
Logged
26|26|9|2|1|0|M:22

Kantarza

  • Private FC
  • *
  • Offline Offline
  • Posts: 8
    • View Profile
Re: incorrect resistance % in postmortem
« Reply #2 on: March 02, 2025, 05:58 »

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% 

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.
Logged
26|26|9|2|1|0|M:22
Pages: [1]