The pull request by argrath changes weight_cap() to never return a value less than 1 because try_lift() divides by that return value and a 0 would trigger a crash. The code involved is used when attempting to pull a monster out of a pit via #untrap. I'm fairly sure that weight_cap() can never produce a value that's less than 1 already, but have put in a variation of the PR's fix. I've also implemented a different fix that removes the division from try_lift(). The original code seems to have gone out of its way to avoid calculating inv_weight() twice, but doing the latter (for the once in a hundred games where it might happen) greatly simplifies things by removing details of carrying capacity. Fixes #621
89 KiB
89 KiB