mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Stop grab on buckle, remove redundant code
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
/atom/movable/attack_hand(mob/living/user)
|
||||
. = ..()
|
||||
if(can_buckle && has_buckled_mobs())
|
||||
if(buckled_mobs.len > 1)
|
||||
if(LAZYLEN(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
|
||||
@@ -28,13 +28,13 @@
|
||||
/atom/movable/proc/has_buckled_mobs()
|
||||
if(!buckled_mobs)
|
||||
return FALSE
|
||||
if(buckled_mobs.len)
|
||||
if(LAZYLEN(buckled_mobs))
|
||||
return TRUE
|
||||
|
||||
/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(buckled_mobs.len > 1)
|
||||
if(LAZYLEN(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 +54,7 @@
|
||||
if(check_loc && M.loc != loc)
|
||||
return FALSE
|
||||
|
||||
if((!can_buckle && !force) || M.buckled || (buckled_mobs.len >= max_buckled_mobs) || (buckle_requires_restraints && !M.restrained()) || M == src)
|
||||
if((!can_buckle && !force) || M.buckled || (LAZYLEN(buckled_mobs) >= max_buckled_mobs) || (buckle_requires_restraints && !M.restrained()) || M == src)
|
||||
return FALSE
|
||||
M.buckling = src
|
||||
if(!M.can_buckle() && !force)
|
||||
@@ -69,6 +69,10 @@
|
||||
if(buckle_prevents_pull)
|
||||
M.pulledby.stop_pulling()
|
||||
|
||||
if (LAZYLEN(M.grabbed_by))
|
||||
for(var/obj/item/grab/G in M.grabbed_by)
|
||||
qdel(G)
|
||||
|
||||
if(!check_loc && M.loc != loc)
|
||||
M.forceMove(loc)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user