From bf706f2fbb21058fe1879d0b078c868480164308 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Fri, 27 Aug 2021 17:47:07 +0200 Subject: [PATCH] :bug: Fix Phasing not working in Lazarus' camber Previously an improper check was being done to see if the player was located on the 3 teleporting pads in the level. Even if fixng this the spell would not work correctly if the layer was standing on the pads when casting the spell. Simply use TARGET_BOTH to indicate that it should not be random and send the player to the given destination --- Source/missiles.cpp | 14 +++++--------- Source/objects.cpp | 4 ++-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Source/missiles.cpp b/Source/missiles.cpp index 572779ad8..b4e70922e 100644 --- a/Source/missiles.cpp +++ b/Source/missiles.cpp @@ -1873,15 +1873,11 @@ void AddRndTeleport(MissileStruct &missile, Point dst, Direction /*midir*/) auto &player = Players[missile._misource]; - if (setlevel && setlvlnum == SL_VILEBETRAYER) { - int oi = dObject[dst.x][dst.y] - 1; - // BUGFIX: should only run magic circle check if dObject[dx][dy] is non-zero. - if (Objects[oi]._otype == OBJ_MCIRCLE1 || Objects[oi]._otype == OBJ_MCIRCLE2) { - missile.position.tile = dst; - if (!PosOkPlayer(player, dst)) - UpdateVileMissPos(missile, dst); - return; - } + if (missile._micaster == TARGET_BOTH) { + missile.position.tile = dst; + if (!PosOkPlayer(player, dst)) + UpdateVileMissPos(missile, dst); + return; } std::array targets; diff --git a/Source/objects.cpp b/Source/objects.cpp index 191b6590a..e7a183e23 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -1474,7 +1474,7 @@ void UpdateCircle(int i) ObjChangeMapResync(Objects[i]._oVar1, Objects[i]._oVar2, Objects[i]._oVar3, Objects[i]._oVar4); if (Quests[Q_BETRAYER]._qactive == QUEST_ACTIVE && Quests[Q_BETRAYER]._qvar1 <= 4) // BUGFIX stepping on the circle again will break the quest state (fixed) Quests[Q_BETRAYER]._qvar1 = 4; - AddMissile(myPlayer.position.tile, { 35, 46 }, myPlayer._pdir, MIS_RNDTELEPORT, TARGET_MONSTERS, MyPlayerId, 0, 0); + AddMissile(myPlayer.position.tile, { 35, 46 }, DIR_S, MIS_RNDTELEPORT, TARGET_BOTH, MyPlayerId, 0, 0); LastMouseButtonAction = MouseActionType::None; sgbMouseDown = CLICK_NONE; ClrPlrPath(myPlayer); @@ -2207,7 +2207,7 @@ void OperateBook(int pnum, int i) } if (doAddMissile) { Objects[dObject[35][36] - 1]._oVar5++; - AddMissile(player.position.tile, { dx, dy }, player._pdir, MIS_RNDTELEPORT, TARGET_MONSTERS, pnum, 0, 0); + AddMissile(player.position.tile, { dx, dy }, DIR_S, MIS_RNDTELEPORT, TARGET_BOTH, pnum, 0, 0); missileAdded = true; doAddMissile = false; }