BrogueCE icon indicating copy to clipboard operation
BrogueCE copied to clipboard

Eels escaped from water somehow.

Open tinyrodentprime opened this issue 3 years ago • 5 comments

1.9 beta. I didn't do anything to provoke it. Just walking past the doorway I noticed an eel out of the water. Then later noticed another one. stranded eel.zip

tinyrodentprime avatar Jul 31 '20 18:07 tinyrodentprime

Here's a screenshot of it: https://i.ibb.co/tz2VRd3/Screenshot-6.png

As I mentioned on Reddit, the recent change to water-borne creatures made their movement more restrictive, not less, so I think this could be an unrelated bug, maybe involving the fire traps.

tmewett avatar Jul 31 '20 19:07 tmewett

It's possible eaeb7fd293464017b4e3189864c2e3a02f488b41 is the culprit.

tmewett avatar Jul 31 '20 19:07 tmewett

That commit is not the culprit; koputusx observed this bug in 1.8.1.

tmewett avatar Aug 08 '20 15:08 tmewett

Here are my debugging efforts so far. Not sure how best to fix this yet.

An eel moves out of the water to location (56,8) on turn 965 of the attached 1.9.1 recording. CE191_Recordingeel.zip

Occurs during an interaction with a monster and a "defender", where the defender's location gets modified:

boolean moveMonster(creature *monst, short dx, short dy)
...
if (monsterAvoids(defender, x, y)) { // don't want a flying monster to swap a non-flying monster into lava!
	getQualifyingPathLocNear(&(defender->xLoc), &(defender->yLoc), x, y, true,
							 forbiddenFlagsForMonster(&(defender->info)), HAS_PLAYER,
							 forbiddenFlagsForMonster(&(defender->info)), (HAS_PLAYER | HAS_MONSTER | HAS_STAIRS), false);
			
```		 
The defender location is passed to, and modified by function `getQualifyingPathLocNear` which takes parameters for restricting valid locations:

boolean getQualifyingPathLocNear(short *retValX, short *retValY, short x, short y, boolean hallwaysAllowed, unsigned long blockingTerrainFlags, unsigned long blockingMapFlags, unsigned long forbiddenTerrainFlags, unsigned long forbiddenMapFlags, boolean deterministic) {


However, neither `enum tileFlags` nor `enum terrainFlagCatalog` has a flag for "water" so it would seem they can't be used as the sole method for keeping eels restricted to water.

One possible fix is adding a new terrain flag. I think that would require setting it for each tile during dungeon generation, in addition to the monster catalog. Another option is passing the monster to `getQualifyingPathLocNear `so that additional checks can be done based on a monster's properties.

zenzombie avatar Nov 01 '20 21:11 zenzombie

I'm not positive this is related, but hopefully it's an extra data point while considering a fix. Playing the 2021-04-23 weekend contest [CE 1.9.3], I beckoned a kraken from bog to a dry patch of land adjacent to bog, while standing in bog myself. It was labeled as helpless, but proceeded to seize me and then strike me. While I can fathom a "helpless" waterborne creature will flop itself to adjacent water and recover (which it eventually did), it doesn't smell right that it can attack from dry land.

apgove avatar Apr 25 '21 15:04 apgove