mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 10:11:09 +00:00
Fixes infinite loop in closet resist code (#92355)
This commit is contained in:
@@ -1038,15 +1038,13 @@ GLOBAL_LIST_EMPTY(roundstart_station_closets)
|
|||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
/obj/structure/closet/container_resist_act(mob/living/user, loc_required = TRUE)
|
/obj/structure/closet/container_resist_act(mob/living/user, loc_required = TRUE)
|
||||||
if(isstructure(loc))
|
|
||||||
relay_container_resist_act(user, loc)
|
|
||||||
if(opened)
|
if(opened)
|
||||||
return
|
return
|
||||||
if(ismovable(loc))
|
if(ismovable(loc))
|
||||||
user.changeNext_move(CLICK_CD_BREAKOUT)
|
user.changeNext_move(CLICK_CD_BREAKOUT)
|
||||||
user.last_special = world.time + CLICK_CD_BREAKOUT
|
user.last_special = world.time + CLICK_CD_BREAKOUT
|
||||||
var/atom/movable/AM = loc
|
var/atom/movable/movable_parent = loc
|
||||||
AM.relay_container_resist_act(user, src)
|
movable_parent.relay_container_resist_act(user, src)
|
||||||
return
|
return
|
||||||
if(!welded && !locked)
|
if(!welded && !locked)
|
||||||
open()
|
open()
|
||||||
@@ -1075,7 +1073,7 @@ GLOBAL_LIST_EMPTY(roundstart_station_closets)
|
|||||||
to_chat(user, span_warning("You fail to break out of [src]!"))
|
to_chat(user, span_warning("You fail to break out of [src]!"))
|
||||||
|
|
||||||
/obj/structure/closet/relay_container_resist_act(mob/living/user, obj/container)
|
/obj/structure/closet/relay_container_resist_act(mob/living/user, obj/container)
|
||||||
container.container_resist_act(user)
|
container_resist_act(user)
|
||||||
|
|
||||||
/// Check if someone is still resisting inside, and choose to either keep shaking or stop shaking the closet
|
/// Check if someone is still resisting inside, and choose to either keep shaking or stop shaking the closet
|
||||||
/obj/structure/closet/proc/check_if_shake()
|
/obj/structure/closet/proc/check_if_shake()
|
||||||
|
|||||||
@@ -73,22 +73,22 @@
|
|||||||
if(!hasmob)
|
if(!hasmob)
|
||||||
disposal_holder.destinationTag = sort_tag
|
disposal_holder.destinationTag = sort_tag
|
||||||
|
|
||||||
/obj/item/delivery/relay_container_resist_act(mob/living/user, obj/object)
|
/obj/item/delivery/relay_container_resist_act(mob/living/user, obj/container)
|
||||||
if(ismovable(loc))
|
if(ismovable(loc))
|
||||||
var/atom/movable/movable_loc = loc //can't unwrap the wrapped container if it's inside something.
|
var/atom/movable/movable_loc = loc //can't unwrap the wrapped container if it's inside something.
|
||||||
movable_loc.relay_container_resist_act(user, object)
|
movable_loc.relay_container_resist_act(user, container)
|
||||||
return
|
return
|
||||||
to_chat(user, span_notice("You lean on the back of [object] and start pushing to rip the wrapping around it."))
|
to_chat(user, span_notice("You lean on the back of [container] and start pushing to rip the wrapping around it."))
|
||||||
if(do_after(user, 5 SECONDS, target = object))
|
if(do_after(user, 5 SECONDS, target = container))
|
||||||
if(!user || user.stat != CONSCIOUS || user.loc != object || object.loc != src)
|
if(!user || user.stat != CONSCIOUS || user.loc != container || container.loc != src)
|
||||||
return
|
return
|
||||||
to_chat(user, span_notice("You successfully removed [object]'s wrapping!"))
|
to_chat(user, span_notice("You successfully removed [container]'s wrapping!"))
|
||||||
object.forceMove(loc)
|
container.forceMove(loc)
|
||||||
unwrap_contents()
|
unwrap_contents()
|
||||||
post_unwrap_contents(user)
|
post_unwrap_contents(user)
|
||||||
else
|
else
|
||||||
if(user.loc == src) //so we don't get the message if we resisted multiple times and succeeded.
|
if(user.loc == src) //so we don't get the message if we resisted multiple times and succeeded.
|
||||||
to_chat(user, span_warning("You fail to remove [object]'s wrapping!"))
|
to_chat(user, span_warning("You fail to remove [container]'s wrapping!"))
|
||||||
|
|
||||||
/obj/item/delivery/update_icon_state()
|
/obj/item/delivery/update_icon_state()
|
||||||
. = ..()
|
. = ..()
|
||||||
|
|||||||
Reference in New Issue
Block a user