mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-18 14:12:20 +00:00
Merge pull request #6087 from Heroman3003/pipe-buckle-general
Fixes some bugs related to buckling
This commit is contained in:
@@ -51,20 +51,10 @@
|
|||||||
|
|
||||||
|
|
||||||
/atom/movable/proc/buckle_mob(mob/living/M, forced = FALSE, check_loc = TRUE)
|
/atom/movable/proc/buckle_mob(mob/living/M, forced = FALSE, check_loc = TRUE)
|
||||||
if(!buckled_mobs)
|
|
||||||
buckled_mobs = list()
|
|
||||||
|
|
||||||
if(!istype(M))
|
|
||||||
return FALSE
|
|
||||||
|
|
||||||
if(check_loc && M.loc != loc)
|
if(check_loc && M.loc != loc)
|
||||||
return FALSE
|
return FALSE
|
||||||
|
|
||||||
if((!can_buckle && !forced) || M.buckled || M.pinned.len || (buckled_mobs.len >= max_buckled_mobs) || (buckle_require_restraints && !M.restrained()))
|
if(!can_buckle_check(M, forced))
|
||||||
return FALSE
|
|
||||||
|
|
||||||
if(has_buckled_mobs() && buckled_mobs.len >= max_buckled_mobs) //Handles trying to buckle yourself to the chair when someone is on it
|
|
||||||
to_chat(M, "<span class='notice'>\The [src] can't buckle anymore people.</span>")
|
|
||||||
return FALSE
|
return FALSE
|
||||||
|
|
||||||
M.buckled = src
|
M.buckled = src
|
||||||
@@ -117,6 +107,8 @@
|
|||||||
if(M in buckled_mobs)
|
if(M in buckled_mobs)
|
||||||
to_chat(user, "<span class='warning'>\The [M] is already buckled to \the [src].</span>")
|
to_chat(user, "<span class='warning'>\The [M] is already buckled to \the [src].</span>")
|
||||||
return FALSE
|
return FALSE
|
||||||
|
if(!can_buckle_check(M, forced))
|
||||||
|
return FALSE
|
||||||
|
|
||||||
add_fingerprint(user)
|
add_fingerprint(user)
|
||||||
// unbuckle_mob()
|
// unbuckle_mob()
|
||||||
@@ -170,3 +162,19 @@
|
|||||||
else
|
else
|
||||||
L.set_dir(dir)
|
L.set_dir(dir)
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
|
/atom/movable/proc/can_buckle_check(mob/living/M, forced = FALSE)
|
||||||
|
if(!buckled_mobs)
|
||||||
|
buckled_mobs = list()
|
||||||
|
|
||||||
|
if(!istype(M))
|
||||||
|
return FALSE
|
||||||
|
|
||||||
|
if((!can_buckle && !forced) || M.buckled || M.pinned.len || (buckled_mobs.len >= max_buckled_mobs) || (buckle_require_restraints && !M.restrained()))
|
||||||
|
return FALSE
|
||||||
|
|
||||||
|
if(has_buckled_mobs() && buckled_mobs.len >= max_buckled_mobs) //Handles trying to buckle yourself to the chair when someone is on it
|
||||||
|
to_chat(M, "<span class='notice'>\The [src] can't buckle anymore people.</span>")
|
||||||
|
return FALSE
|
||||||
|
|
||||||
|
return TRUE
|
||||||
|
|||||||
Reference in New Issue
Block a user