diff --git a/Source/missiles.cpp b/Source/missiles.cpp index 540a9c6af..ea74c7506 100644 --- a/Source/missiles.cpp +++ b/Source/missiles.cpp @@ -2654,7 +2654,7 @@ void AddGolem(int mi, Point src, Point dst, int /*midir*/, int8_t /*mienemy*/, i Missiles[mi]._miVar2 = src.y; Missiles[mi]._miVar4 = dst.x; Missiles[mi]._miVar5 = dst.y; - if (Monsters[id].position.tile != Point { 1, 0 } && id == MyPlayerId) + if (Monsters[id].position.tile != GolemHoldingCell && id == MyPlayerId) M_StartKill(id, id); UseMana(id, SPL_GOLEM); } @@ -3157,7 +3157,7 @@ void MI_Dummy(int i) void MI_Golem(int mi) { int src = Missiles[mi]._misource; - if (Monsters[src].position.tile == Point { 1, 0 }) { + if (Monsters[src].position.tile == GolemHoldingCell) { for (int i = 0; i < 6; i++) { int k = CrawlNum[i]; int ck = k + 2; diff --git a/Source/missiles.h b/Source/missiles.h index 61a22320b..284f7970c 100644 --- a/Source/missiles.h +++ b/Source/missiles.h @@ -18,6 +18,8 @@ namespace devilution { #define MAXMISSILES 125 +constexpr Point GolemHoldingCell = Point { 1, 0 }; + struct ChainStruct { int idx; int _mitype; diff --git a/Source/monster.cpp b/Source/monster.cpp index 3b1f9fd16..68da681df 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -867,7 +867,7 @@ void UpdateEnemy(MonsterStruct &monster) continue; if ((otherMonster._mhitpoints >> 6) <= 0) continue; - if (otherMonster.position.tile == Point { 1, 0 }) + if (otherMonster.position.tile == GolemHoldingCell) continue; if (M_Talker(otherMonster) && otherMonster.mtalkmsg != TEXT_NONE) continue; @@ -3954,10 +3954,10 @@ void InitMonsters() CheckDungeonClear(); #endif if (!setlevel) { - AddMonster({ 1, 0 }, DIR_S, 0, false); - AddMonster({ 1, 0 }, DIR_S, 0, false); - AddMonster({ 1, 0 }, DIR_S, 0, false); - AddMonster({ 1, 0 }, DIR_S, 0, false); + AddMonster(GolemHoldingCell, DIR_S, 0, false); + AddMonster(GolemHoldingCell, DIR_S, 0, false); + AddMonster(GolemHoldingCell, DIR_S, 0, false); + AddMonster(GolemHoldingCell, DIR_S, 0, false); } if (!gbIsSpawn && !setlevel && currlevel == 16) @@ -4020,10 +4020,10 @@ void InitMonsters() void SetMapMonsters(const uint16_t *dunData, Point startPosition) { AddMonsterType(MT_GOLEM, PLACE_SPECIAL); - AddMonster({ 1, 0 }, DIR_S, 0, false); - AddMonster({ 1, 0 }, DIR_S, 0, false); - AddMonster({ 1, 0 }, DIR_S, 0, false); - AddMonster({ 1, 0 }, DIR_S, 0, false); + AddMonster(GolemHoldingCell, DIR_S, 0, false); + AddMonster(GolemHoldingCell, DIR_S, 0, false); + AddMonster(GolemHoldingCell, DIR_S, 0, false); + AddMonster(GolemHoldingCell, DIR_S, 0, false); if (setlevel && setlvlnum == SL_VILEBETRAYER) { AddMonsterType(UniqMonst[UMT_LAZARUS].mtype, PLACE_UNIQUE); AddMonsterType(UniqMonst[UMT_RED_VEX].mtype, PLACE_UNIQUE); @@ -4411,7 +4411,7 @@ void DeleteMonsterList() if (!golem._mDelFlag) continue; - golem.position.tile = { 1, 0 }; + golem.position.tile = GolemHoldingCell; golem.position.future = { 0, 0 }; golem.position.old = { 0, 0 }; golem._mDelFlag = false; diff --git a/Source/msg.cpp b/Source/msg.cpp index e32caf2be..1b3664263 100644 --- a/Source/msg.cpp +++ b/Source/msg.cpp @@ -2034,7 +2034,7 @@ void DeltaLoadLevel() M_UpdateLeader(i); } else { decode_enemy(monster, sgLevels[currlevel].monster[i]._menemy); - if (monster.position.tile != Point { 0, 0 } && monster.position.tile != Point { 1, 0 }) + if (monster.position.tile != Point { 0, 0 } && monster.position.tile != GolemHoldingCell) dMonster[monster.position.tile.x][monster.position.tile.y] = i + 1; if (i < MAX_PLRS) { GolumAi(i);