Bug #1676
openhitpoints = 0 in units.ruleset causes divide by 0 crash
0%
Description
Careless rule set hacking strikes again, but there's nothing warning you not to set hitpoints = 0 in units.ruleset, and the ruleset loads OK.
In tilespec.c routine fill_unit_sprite_array()
ihp = ((NUM_TILES_HP_BAR-1)*punit->hp) / ptype->hp;
Files
Updated by Dean Brown about 1 month ago
- File 1676.patch added
Patch should be good for all branches.
Updated by Marko Lindqvist about 1 month ago
That's unlikely to be the only place where such a zombie (unit dies when it reach 0 HP) causes problems. The fix should be in ruleset sanity checking.
Updated by Marko Lindqvist about 1 month ago
secfile_lookup_int_default_min_max() would be your friend.
Updated by Dean Brown about 1 month ago
- File 1676_S3_2.patch added
- File 1676_S3_3_Main.patch added
Agree, better to fix the cause instead of the symptom.
Updated by Marko Lindqvist 26 days ago
For rulesets that play excessively with better firepower and hitpoints as game progresses, maximum hp of 100 is rather low upper limit, especially in S3_2 where we should not break any existing rulesets (d3f). I'd say 10000 would be safe value even as such absolute maximum.
Updated by Dean Brown 25 days ago
- File 1676_S3_2.patch 1676_S3_2.patch added
- File 1676_S3_3_Main.patch 1676_S3_3_Main.patch added
I wasn't sure about what max value to set, thanks for the suggestion. Updated the patches.
Updated by Marko Lindqvist 8 days ago
- Category changed from client-common to Server
- Target version set to 3.2.2