From 486be4efebbf8df664db670844456b7df6165299 Mon Sep 17 00:00:00 2001 From: pionere Date: Thu, 17 Sep 2020 15:54:00 +0200 Subject: [PATCH] use defs instead of constants --- Source/monster.cpp | 26 ++++++++++++-------------- Source/objects.cpp | 6 ++---- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/Source/monster.cpp b/Source/monster.cpp index 7c344691e..74976287d 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -4160,18 +4160,16 @@ void MAI_Rhino(int i) } else Monst->_mgoal = MGOAL_NORMAL; if (Monst->_mgoal == MGOAL_NORMAL) { - if (dist >= 5) - && v < 2 * Monst->_mint + 43 - && LineClearF1(PosOkMonst, i, Monst->_mx, Monst->_my, fx, fy)) - { - if (AddMissile(Monst->_mx, Monst->_my, fx, fy, md, MIS_RHINO, Monst->_menemy, i, 0, 0) != -1) { - if (Monst->MData->snd_special) - PlayEffect(i, 3); - dMonster[Monst->_mx][Monst->_my] = -(i + 1); - Monst->_mmode = MM_CHARGE; - } + if (dist >= 5 + && v < 2 * Monst->_mint + 43 + && LineClearF1(PosOkMonst, i, Monst->_mx, Monst->_my, fx, fy)) { + if (AddMissile(Monst->_mx, Monst->_my, fx, fy, md, MIS_RHINO, Monst->_menemy, i, 0, 0) != -1) { + if (Monst->MData->snd_special) + PlayEffect(i, 3); + dMonster[Monst->_mx][Monst->_my] = -(i + 1); + Monst->_mmode = MM_CHARGE; } - else { + } else { if (dist >= 2) { v = random_(134, 100); if (v >= 2 * Monst->_mint + 33 @@ -5138,9 +5136,9 @@ void M_FallenFear(int x, int y) continue; } if (m->_mAi == AI_FALLEN - && abs(x - m->_mx) < 5 - && abs(y - m->_my) < 5 - && m->_mhitpoints >> 6 > 0) { + && abs(x - m->_mx) < 5 + && abs(y - m->_my) < 5 + && m->_mhitpoints >> 6 > 0) { m->_mgoal = MGOAL_RETREAT; m->_mgoalvar1 = rundist; m->_mdir = GetDirection(x, y, m->_mx, m->_my); diff --git a/Source/objects.cpp b/Source/objects.cpp index b476373a8..7106967fa 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -4395,10 +4395,8 @@ void OperateWeaponRack(int pnum, int i, bool sendmsg) if (deltaload) return; - if (leveltype > 1) - CreateTypeItem(object[i]._ox, object[i]._oy, TRUE, weaponType, IMISC_NONE, sendmsg, FALSE); - else - CreateTypeItem(object[i]._ox, object[i]._oy, FALSE, weaponType, IMISC_NONE, sendmsg, FALSE); + CreateTypeItem(object[i]._ox, object[i]._oy, leveltype > 1, weaponType, IMISC_NONE, sendmsg, FALSE); + if (pnum == myplr) NetSendCmdParam1(FALSE, CMD_OPERATEOBJ, i); }