From 2bf3883e5bd46fe2d721a132edbbef0d05289a12 Mon Sep 17 00:00:00 2001 From: Pidgey <35320204+PidgeyThePirate@users.noreply.github.com> Date: Sat, 28 Sep 2019 09:04:30 +1000 Subject: [PATCH] Issue #12420 - Guardian snapback null-space glitch fix (#12432) --- code/game/gamemodes/miniantags/guardian/guardian.dm | 3 ++- code/game/gamemodes/miniantags/guardian/types/protector.dm | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/game/gamemodes/miniantags/guardian/guardian.dm b/code/game/gamemodes/miniantags/guardian/guardian.dm index a527f055466..17d7187f439 100644 --- a/code/game/gamemodes/miniantags/guardian/guardian.dm +++ b/code/game/gamemodes/miniantags/guardian/guardian.dm @@ -73,7 +73,8 @@ qdel() /mob/living/simple_animal/hostile/guardian/proc/snapback() - if(summoner) + // If the summoner dies instantly, the summoner's ghost may be drawn into null space as the protector is deleted. This check should prevent that. + if(summoner && loc && summoner.loc) if(get_dist(get_turf(summoner),get_turf(src)) <= range) return else diff --git a/code/game/gamemodes/miniantags/guardian/types/protector.dm b/code/game/gamemodes/miniantags/guardian/types/protector.dm index 9206b0d1b0b..5fb31b8ba15 100644 --- a/code/game/gamemodes/miniantags/guardian/types/protector.dm +++ b/code/game/gamemodes/miniantags/guardian/types/protector.dm @@ -41,7 +41,8 @@ toggle = TRUE /mob/living/simple_animal/hostile/guardian/protector/snapback() //snap to what? snap to the guardian! - if(summoner) + // If the summoner dies instantly, the summoner's ghost may be drawn into null space as the protector is deleted. This check should prevent that. + if(summoner && loc && summoner.loc) if(get_dist(get_turf(summoner),get_turf(src)) <= range) return else