remove duplicate turf/CanPass

converted istype->ismovable
CanPass crash_with is null-aware
This commit is contained in:
spookerton
2022-10-18 09:44:34 +01:00
parent 650ee09942
commit b27b1443d2
2 changed files with 6 additions and 11 deletions

View File

@@ -30,11 +30,6 @@
else
CRASH("Invalid can_atmos_pass = [can_atmos_pass] on [src] ([type])")
/turf/CanPass(atom/movable/mover, turf/target)
if(!target) return FALSE
if(istype(mover)) // turf/Enter(...) will perform more advanced checks
return !density
/turf/CanZASPass(turf/T, is_zone)
if(T.blocks_air || src.blocks_air)

View File

@@ -161,16 +161,16 @@
sleep(2)
O.update_transform()
/turf/CanPass(atom/movable/mover, turf/target)
if(!target)
/turf/CanPass(atom/movable/movable, turf/target)
if (!target)
return FALSE
if(istype(mover)) // turf/Enter(...) will perform more advanced checks
if (ismovable(movable)) // turf/Enter carries out complex tests
return !density
crash_with("Non movable passed to turf CanPass : [mover]")
crash_with("turf/CanPass invalid movable: [movable ? "[movable]" : "(null)"]")
return FALSE
//There's a lot of QDELETED() calls here if someone can figure out how to optimize this but not runtime when something gets deleted by a Bump/CanPass/Cross call, lemme know or go ahead and fix this mess - kevinz000
/turf/Enter(atom/movable/mover, atom/oldloc)
if(movement_disabled && usr.ckey != movement_disabled_exception)