nsmryan / RustRoguelike

This Rust Roguelike is a Roguelike written in Rust.
17 stars 3 forks source link

Spike trap spawned ontop lantern #433

Closed MicroChasm closed 2 years ago

MicroChasm commented 2 years ago

I died in a game because I stepped on a torch tile that also had a spike trap underneath it. While the spike trap is uniquely difficult to see under a torch, I think it would be best to just not spawn traps under torches.

action_log.txt

MicroChasm commented 2 years ago

I also had a situation where a spike trap spawned on the same tile as a freeze trap, and both triggered when I stepped on the tile.

nsmryan commented 2 years ago

I think I see where this problem occurs- when checking for whether to use a tile, I only checked whether there was an entity that blocks movement, but not for just any entity. Now traps, triggers, and other things that are placed on the map will only use completely empty tiles, not tiles that have traps, triggers or items.

I also moved grass generation to below all these other things, as grass is now an entity (in order to animate it) and this would prevent, for example, golems or items spawning on grass. Moving it lower in generation allows grass to place on top of other entities.

nsmryan commented 2 years ago

We can either close this, and open a new issue if it happens again, or leave it open for a while and see if we can find a similar problem.

nsmryan commented 2 years ago

I added just a little bit of additional checking after a map is generated to catch these kinds of problems, just in case the generator has a bug or changes later and creates this situation again in the future.