Skip to content

Commit

Permalink
[MIRROR] Fixes hole in ventcrawl logic [MDB IGNORE] (#24429)
Browse files Browse the repository at this point in the history
* Fixes hole in ventcrawl logic (#79027)

## About The Pull Request

May or may not close tgstation/tgstation#79018

Basically we slept during the `do_after()` and the vent may have been
welded while we were sleeping, meaning we could "phase through a welded
vent". Just a silly hole in ventcrawling logic that we should be
accounting for.
## Why It's Good For The Game

I think there's a few issues with ventcrawling (i.e. it being traitbased
and not something like an element) but we can tackle that later. Let's
just fix any potential holes and issues that might come with it.
## Changelog
:cl:
fix: People should be crawling into welded vents a lot less now.
/:cl:

No guarantee on the linked issue disappearing since I couldn't replicate
it on my end, just noticed a logic failure.

* Fixes hole in ventcrawl logic

---------

Co-authored-by: san7890 <[email protected]>
  • Loading branch information
2 people authored and FFMirrorBot committed Oct 19, 2023
1 parent 776933c commit 745136d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions code/modules/mob/living/ventcrawling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@
return
if(!do_after(src, 1 SECONDS, target = ventcrawl_target))
return
visible_message(span_notice("[src] scrambles out from the ventilation ducts!"),span_notice("You scramble out from the ventilation ducts."))
if(ventcrawl_target.welded) // in case it got welded during our sleep
to_chat(src, span_warning("You can't crawl around a welded vent!"))
return
visible_message(span_notice("[src] scrambles out from the ventilation ducts!"), span_notice("You scramble out from the ventilation ducts."))
forceMove(ventcrawl_target.loc)
REMOVE_TRAIT(src, TRAIT_MOVE_VENTCRAWLING, VENTCRAWLING_TRAIT)
update_pipe_vision()
Expand All @@ -76,8 +79,11 @@
return
if(has_client && isnull(client))
return
if(ventcrawl_target.welded) // in case it got welded during our sleep
to_chat(src, span_warning("You can't crawl around a welded vent!"))
return
ventcrawl_target.flick_overlay_static(image('icons/effects/vent_indicator.dmi', "insert", ABOVE_MOB_LAYER), 1 SECONDS)
visible_message(span_notice("[src] scrambles into the ventilation ducts!"),span_notice("You climb into the ventilation ducts."))
visible_message(span_notice("[src] scrambles into the ventilation ducts!"), span_notice("You climb into the ventilation ducts."))
move_into_vent(ventcrawl_target)
else
to_chat(src, span_warning("This ventilation duct is not connected to anything!"))
Expand Down

0 comments on commit 745136d

Please sign in to comment.