draconisPW / PWMAngband

A free, multi-player roguelike dungeon exploration game based on Angband
35 stars 11 forks source link

square_issecretdoor() crush #595

Closed igroglaz closed 1 year ago

igroglaz commented 1 year ago

I used skill Roll which makes....

effect:TELEPORT
dice:2

....in this location: image

and server crushed

image

image

image

image

image

draconisPW commented 1 year ago

The comment: "Search nearby grids which are always in bounds" Location: 0,66 -> NOT in bounds... (cave is 66x198 so bounds are 0-65/0-197) Game crashes because for whatever reason the PC location is out of bounds at this point.

Unfortunately the break point in search) is too late, would have been useful to see what happened in effect_TELEPORT(), I assume the teleporting failed and threw rubbish in p->grid.

igroglaz commented 1 year ago

YAOOB (yet another out of bound) :D

igroglaz commented 1 year ago

I suppose as it's very narrow place - it tries hard to put player somewhere, but a lot of places occupied by walls... and it fails somehow. As distance is not standard (2 tiles) it might be the reason why it's triggered so rare

draconisPW commented 1 year ago

Since I don't see exactly what happened there, I just added a safe check so teleport attempt fails if the teleport routine cannot find a valid destination for teleport. Better than a crash.