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:
Pasi Kallinen
2018-11-22 20:24:56 +02:00
parent ac9bdc8aa7
commit 02749b7621

View File

@@ -585,10 +585,10 @@ gd_mv_monaway(grd, nx,ny)
register struct monst *grd;
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)
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));
}
}