Fix out-of-bounds in test_move

Hero was on the top-left of an open map at (1,0), and
a monster was trying to knock them back to (0,-1).
This commit is contained in:
Pasi Kallinen
2024-12-17 18:22:52 +02:00
parent 5a3795184f
commit 0381e61624

View File

@@ -972,10 +972,16 @@ test_move(
{
coordxy x = ux + dx;
coordxy y = uy + dy;
struct rm *tmpr = &levl[x][y];
struct rm *tmpr;
struct rm *ust;
svc.context.door_opened = FALSE;
if (!isok(x, y))
return FALSE;
tmpr = &levl[x][y];
/*
* Check for physical obstacles. First, the place we are going.
*/