Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent spamming climbing attempts #3924

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/__DEFINES/~monkestation/do_afters.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define DOAFTER_SOURCE_CLIMBING "doafter_climbing"
10 changes: 6 additions & 4 deletions code/datums/elements/climbable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@


/datum/element/climbable/proc/climb_structure(atom/climbed_thing, mob/living/user, params)
if(!can_climb(climbed_thing, user))
if(!can_climb(climbed_thing, user) || DOING_INTERACTION(user, DOAFTER_SOURCE_CLIMBING))
return
climbed_thing.add_fingerprint(user)
user.visible_message(span_warning("[user] starts climbing onto [climbed_thing]."), \
Expand All @@ -72,7 +72,7 @@
adjusted_climb_time *= 0.3
//monkestation edit - CYBERNETICS
LAZYADDASSOCLIST(current_climbers, climbed_thing, user)
if(do_after(user, adjusted_climb_time, climbed_thing))
if(do_after(user, adjusted_climb_time, climbed_thing, interaction_key = DOAFTER_SOURCE_CLIMBING)) // monkestation edit: add an interaction key
if(QDELETED(climbed_thing)) //Checking if structure has been destroyed
return

Expand Down Expand Up @@ -154,9 +154,11 @@

///Tries to climb onto the target if the forced movement of the mob allows it
/datum/element/climbable/proc/attempt_sprint_climb(datum/source, mob/bumpee)
if(DOING_INTERACTION(bumpee, DOAFTER_SOURCE_CLIMBING))
return
if(HAS_TRAIT(bumpee, TRAIT_FREERUNNING))
if(do_after(bumpee, climb_time, source))
if(do_after(bumpee, climb_time, source, interaction_key = DOAFTER_SOURCE_CLIMBING))
do_climb(source, bumpee)
else
if(do_after(bumpee, climb_time * 1.2, source))
if(do_after(bumpee, climb_time * 1.2, source, interaction_key = DOAFTER_SOURCE_CLIMBING))
do_climb(source, bumpee)
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@
#include "code\__DEFINES\~monkestation\cooldowns.dm"
#include "code\__DEFINES\~monkestation\cybernetics.dm"
#include "code\__DEFINES\~monkestation\DNA.dm"
#include "code\__DEFINES\~monkestation\do_afters.dm"
#include "code\__DEFINES\~monkestation\elevation.dm"
#include "code\__DEFINES\~monkestation\factions.dm"
#include "code\__DEFINES\~monkestation\guns.dm"
Expand Down
Loading