diff --git a/code/LINDA/LINDA_system.dm b/code/LINDA/LINDA_system.dm index 0bf0a5ff5b3..2f8b6ac7eb8 100644 --- a/code/LINDA/LINDA_system.dm +++ b/code/LINDA/LINDA_system.dm @@ -82,8 +82,8 @@ turf/CanPass(atom/movable/mover, turf/target, height=1.5) /atom/movable/proc/air_update_turf(var/command = 0) if(!istype(loc,/turf) && command) return - for(var/turf/T in locs) // used by double wide doors and other nonexistant multitile structures - T.air_update_turf(command) + var/turf/T = loc + T.air_update_turf(command) /turf/proc/air_update_turf(var/command = 0) if(command) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 49bbcb8d075..1e53709c227 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1072,11 +1072,30 @@ Turf and target are seperate in case you want to teleport some distance from a t //Gets the turf this atom inhabits -/proc/get_turf(atom/movable/AM) - if(istype(AM)) - return locate(/turf) in AM.locs - else if(isturf(AM)) - return AM + +/proc/get_turf(atom/A) + if (!istype(A)) + return + if (isturf(A)) + return A + + var/list/atom/checked_turf_candidates = list() //prevent recursion from badmins being dumbasses + var/atom/turf_candidate = A.loc + + while (!isturf(turf_candidate)) + if (!turf_candidate || turf_candidate in checked_turf_candidates) + return + checked_turf_candidates += turf_candidate + + //SO I BET YOU MIGHT BE WONDERING WHY I'M CHECKING THIS AGAIN. + //I'LL FUCKING TELL YOU WAY, ITS BECAUSE FOR SOME GOD DAMN REASON, WHEN THIS IS CALLED + //IN AN OBJECT'S NEW() PROC, THE FIRST CHECK WILL FUCKING PASS, BUT FUCKING RUNTIME HERE + //BITCHING ABOUT HOW IT CAN'T READ NULL.LOC, SO FUCK IT, WE CHECK THIS TWICE. + if (!turf_candidate) + return + turf_candidate = turf_candidate.loc + return turf_candidate + //Gets the turf this atom's *ICON* appears to inhabit //Uses half the width/height respectively to work out diff --git a/code/_onclick/adjacent.dm b/code/_onclick/adjacent.dm index 2ada5233a6f..20aeb967d29 100644 --- a/code/_onclick/adjacent.dm +++ b/code/_onclick/adjacent.dm @@ -62,17 +62,11 @@ /* Adjacency (to anything else): * Must be on a turf - * In the case of a multiple-tile object, all valid locations are checked for adjacency. - - Note: Multiple-tile objects are created when the bound_width and bound_height are creater than the tile size. - This is not used in stock /tg/station currently. */ /atom/movable/Adjacent(var/atom/neighbor) if(neighbor == loc) return 1 if(!isturf(loc)) return 0 - for(var/turf/T in locs) - if(isnull(T)) continue - if(T.Adjacent(neighbor,src)) return 1 + if(loc.Adjacent(neighbor,src)) return 1 return 0 // This is necessary for storage items not on your person. diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm index 5a4040d9242..6c7b57edd47 100644 --- a/code/game/gamemodes/traitor/traitor.dm +++ b/code/game/gamemodes/traitor/traitor.dm @@ -348,9 +348,9 @@ var/obj/item/weapon/folder/syndicate/folder if(owner == exchange_red) - folder = new/obj/item/weapon/folder/syndicate/red(mob.locs) + folder = new/obj/item/weapon/folder/syndicate/red(mob.loc) else - folder = new/obj/item/weapon/folder/syndicate/blue(mob.locs) + folder = new/obj/item/weapon/folder/syndicate/blue(mob.loc) var/list/slots = list ( "backpack" = slot_in_backpack,