Skip to content

Commit

Permalink
sanity
Browse files Browse the repository at this point in the history
  • Loading branch information
SECBATON-GRIFFON committed Nov 7, 2024
1 parent d8a42a2 commit b27ec70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions code/game/objects/items/devices/handheld_magnet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
if(T)
var/turfloc = isturf(loc)
var/objloc = FALSE
if(isobj(loc))
if(isobj(loc) && isturf(loc.loc))
var/obj/O = loc
if(!O.anchored)
objloc = TRUE
Expand All @@ -132,7 +132,7 @@
step_towards(O, T)

var/mobloc = FALSE
if(ismob(loc))
if(ismob(loc) && loc.loc && isturf(loc.loc))
var/mob/M = loc
if(!M.anchored)
mobloc = M.size
Expand All @@ -152,7 +152,7 @@
continue
step_towards(L, T)

if(!T.has_gravity() && ismob(loc))
if(!T.has_gravity() && mobloc)
for(var/turf/simulated/wall/W in spiral_block(T,magnetic_field))
if((W.walltype == "metal" || W.walltype == "rwall") && get_dist(loc,W) > 1) // gets nearest one
step_towards(loc, W)
Expand Down

0 comments on commit b27ec70

Please sign in to comment.