From 388a265407f05e2fc430a1d9dcb69daa51ff6efe Mon Sep 17 00:00:00 2001 From: TheDZD Date: Sun, 24 Jan 2016 16:03:41 -0500 Subject: [PATCH] porta_turret fixes Fixes infinite loop caused by porta_turrets when trying to target something on the same tile as the turret. Also fixes a miscellaneous runtime with the mecha wormhole projector. --- code/game/machinery/portable_turret.dm | 3 +++ code/game/mecha/equipment/tools/tools.dm | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 687032011b1..d9d766e9787 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -547,6 +547,9 @@ var/list/turret_icons if(!istype(L)) return TURRET_NOT_TARGET + if(get_turf(L) == get_turf(src)) + return TURRET_NOT_TARGET + if(L.invisibility >= INVISIBILITY_LEVEL_ONE) // Cannot see him. see_invisible is a mob-var return TURRET_NOT_TARGET diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm index 24aeee0d9c2..c482eac5412 100644 --- a/code/game/mecha/equipment/tools/tools.dm +++ b/code/game/mecha/equipment/tools/tools.dm @@ -434,8 +434,8 @@ P.failchance = 0 P.icon_state = "anom" P.name = "wormhole" - message_admins("[key_name_admin(chassis.occupant, chassis.occupant.client)](?) (FLW) used a Wormhole Generator in ([T.x],[T.y],[T.z] - JMP)",0,1) - log_game("[key_name(chassis.occupant)] used a Wormhole Generator in ([T.x],[T.y],[T.z])") + message_admins("[key_name_admin(chassis.occupant, chassis.occupant.client)](?) (FLW) used a Wormhole Generator in ([loc.x],[loc.y],[loc.z] - JMP)",0,1) + log_game("[key_name(chassis.occupant)] used a Wormhole Generator in ([loc.x],[loc.y],[loc.z])") do_after_cooldown() src = null spawn(rand(150,300))