LAZYLEN begone

This commit is contained in:
mochi
2020-06-20 00:43:33 +02:00
parent 7aba081bc6
commit 88e57b30b3
+5 -8
View File
@@ -11,7 +11,7 @@
/atom/movable/attack_hand(mob/living/user)
. = ..()
if(can_buckle && has_buckled_mobs())
if(LAZYLEN(buckled_mobs) > 1)
if(buckled_mobs && length(buckled_mobs) > 1)
var/unbuckled = input(user, "Who do you wish to unbuckle?", "Unbuckle Who?") as null|mob in buckled_mobs
if(user_unbuckle_mob(unbuckled,user))
return TRUE
@@ -26,15 +26,12 @@
return TRUE
/atom/movable/proc/has_buckled_mobs()
if(!buckled_mobs)
return FALSE
if(LAZYLEN(buckled_mobs))
return TRUE
return buckled_mobs && length(buckled_mobs)
/atom/movable/attack_robot(mob/living/user)
. = ..()
if(can_buckle && has_buckled_mobs() && Adjacent(user)) // attack_robot is called on all ranges, so the Adjacent check is needed
if(LAZYLEN(buckled_mobs) > 1)
if(buckled_mobs && length(buckled_mobs) > 1)
var/unbuckled = input(user, "Who do you wish to unbuckle?", "Unbuckle Who?") as null|mob in buckled_mobs
if(user_unbuckle_mob(unbuckled,user))
return TRUE
@@ -54,7 +51,7 @@
if(check_loc && M.loc != loc)
return FALSE
if((!can_buckle && !force) || M.buckled || (LAZYLEN(buckled_mobs) >= max_buckled_mobs) || (buckle_requires_restraints && !M.restrained()) || M == src)
if((!can_buckle && !force) || M.buckled || (length(buckled_mobs) >= max_buckled_mobs) || (buckle_requires_restraints && !M.restrained()) || M == src)
return FALSE
M.buckling = src
if(!M.can_buckle() && !force)
@@ -69,7 +66,7 @@
if(buckle_prevents_pull)
M.pulledby.stop_pulling()
if(LAZYLEN(M.grabbed_by))
if(length(M.grabbed_by))
for(var/obj/item/grab/G in M.grabbed_by)
qdel(G)