Fix guard shoving monsters away coordinate logic
The logic required both x and y coordinates of the guard location and the new location the guard wanted to move to be different. This is obviously wrong, as the guard may move horizontally or vertically.
This commit is contained in:
@@ -585,10 +585,10 @@ gd_mv_monaway(grd, nx,ny)
|
|||||||
register struct monst *grd;
|
register struct monst *grd;
|
||||||
int nx,ny;
|
int nx,ny;
|
||||||
{
|
{
|
||||||
if (MON_AT(nx, ny) && nx != grd->mx && ny != grd->my) {
|
if (MON_AT(nx, ny) && !(nx == grd->mx && ny == grd->my)) {
|
||||||
if (!Deaf)
|
if (!Deaf)
|
||||||
verbalize("Out of my way, scum!");
|
verbalize("Out of my way, scum!");
|
||||||
if (!rloc(m_at(nx, ny), FALSE) || m_at(nx, ny))
|
if (!rloc(m_at(nx, ny), FALSE) || MON_AT(nx, ny))
|
||||||
m_into_limbo(m_at(nx, ny));
|
m_into_limbo(m_at(nx, ny));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user