Merge pull request #9586 from MrStonedOne/patch-13

[ready]Workaround for Out of resources byond bug
This commit is contained in:
Jordie
2015-05-22 16:59:18 +10:00
4 changed files with 29 additions and 16 deletions
+2 -2
View File
@@ -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)
+24 -5
View File
@@ -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
+1 -7
View File
@@ -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.
+2 -2
View File
@@ -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,