Condition isPassableOrSecretDoor() is not precise enough
Reported by azrealiraizaI on Discord
Function isPassableOrSecretDoor tests for possibility of a tile based on its observable status -OR- if it has a secret that would promote to a passable tile.
The intention is to test for monsters walking into what the player sees as a wall, but which is actually a secret door. In this case, the move is allowed, causing the secret door to promote to a visible door.
https://github.com/tmewett/BrogueCE/blob/af0d25995221a51591ae7da4ba95c2fd28b1acc0/src/brogue/Monsters.c#L3664
This check is not precise enough to distinguish between secret doors and other secrets.
On turn 7540 of the recording, an entranced Troll is moved south. The tile to the south is an obstruction crystal (T_OBSTRUCTS_PASSABILITY), but another layer of the same tile contains a secret trap trigger plate.
isPassableOrSecretDoor() returns TRUE for this move, allowing the Troll to enter the tile, promoting both the obstruction crystal (which dissolves) and the trap (which generates gas).
This is incorrect - although there is a secret and it would promote to a passable feature in one of the layers, the tile still contains an impassable layer (the crystal).
POSSIBLE FIX:
isPassableOrSecretDoor() checks only that a secret exists and that it would promote to a passable feature IN SOME LAYER of the tile. Instead it should check that ALL impassable layers would promote, rather than ANY impassable layer.
This can probably just be a count of impassable layers. Since there is only one secret per location, more than one impassable layers will guarantee that the tile remains impassable even if the secret would promote.