Attnam / ivan

Iter Vehemens ad Necem - a continuation of the graphical roguelike by members of http://attnam.com
GNU General Public License v2.0
297 stars 42 forks source link

Sol stone has negative volume, causes crash when splitting #573

Open Coolthulhu opened 4 years ago

Coolthulhu commented 4 years ago

Splitting expects positive volume, but sol stone is made of obsidian, which has positive density, so its negative weight means negative volume. Attempting to split a sol stone or the negative volume obsidian stone created from it will crash the game.

ryfactor commented 4 years ago

Ha! Apt, but the crash is unintended. Another good experiment, thanks @Coolthulhu

red-kangaroo commented 4 years ago

Items with negative weight/volume should, when you attempt to dismantle them, be removed with a message: "%s disappears in a puff of logic." :)

red-kangaroo commented 4 years ago

Incidentally, it seems the code does not crash, but rather aborts when the game checks whether crafting didn't result in more material than it started with. When you split the -1000g sol stone into eg. 3 pieces, you get 3x -333g due to rounding, which is technically more than you started with...