Closed elunna closed 11 months ago
The gems in question are red glass. / #define WORTHLESS_PIECE_OF_RED_GLASS 664 /
The monster picking up is: #define PM_ROCK_MOLE 239
Ok interesting, maybe it's trying to pickup after eating?
The code where the panic is happening is this:
if (obj->cobj || num <= 0L || obj->quan <= num)
panic("splitobj"); /* can't split containers */
At this point, num is -10. Which seems weird? Lets see where that comes from. It's calculated in can_carry(). I set a break on can_carry. When we first enter this function, num is 1. It then returns after hitting this block:
if (curr_mon_load(mtmp) + newload > max_mon_load(mtmp)) {
if (otmp->owt == LARGEST_INT)
weightper = (int) ((((long) otmp->owt) - 1 + otmp->quan) / otmp->quan);
return (max_mon_load(mtmp) - curr_mon_load(mtmp)) / weightper;
I think something is wrong with the weightper calc because it equals 1063727024
Is this because it's a quantity of 1?
More info: The rock mole was carrying a cram ration, weighing 20.
max_mon_load is calculating that the rock mole can carry a max of 10.
Likely related to 00352c884 Fix: Monsters will pick up partial stacks From EvilHack commit 4dde18ca6fda25d0141c9579dc8dc76a997c47c2.