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

Removes delay when failing to move #6498

Closed
wants to merge 2 commits into from
Closed
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
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,6 @@
#define COMSIG_MOB_END_TUTORIAL "mob_end_tutorial"

#define COMSIG_MOB_NESTED "mob_nested"

/// When a mob successfully moves to a different tile (wasn't blocked) : (client/Move(n, direct))
#define COMSIG_MOB_MOVE_SUCCESS "mob_move_success"
9 changes: 9 additions & 0 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
if(SSticker?.mode?.hardcore)
hardcore = TRUE //For WO disposing of corpses

RegisterSignal(src, COMSIG_MOB_MOVE_SUCCESS, PROC_REF(on_move_success))

/mob/living/carbon/human/proc/on_move_success()
SIGNAL_HANDLER
if(embedded_items.len > 0)
handle_embedded_objects() //Moving with objects stuck in you can cause bad times.

/mob/living/carbon/human/initialize_pass_flags(datum/pass_flags_container/PF)
..()
if (PF)
Expand Down Expand Up @@ -91,6 +98,8 @@
selected_ability = null
remembered_dropped_objects = null

UnregisterSignal(src, COMSIG_MOB_MOVE_SUCCESS)

/mob/living/carbon/human/get_status_tab_items()
. = ..()

Expand Down
3 changes: 0 additions & 3 deletions code/modules/mob/living/carbon/human/human_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
if(species.slowdown)
. += species.slowdown

if(embedded_items.len > 0)
handle_embedded_objects() //Moving with objects stuck in you can cause bad times.

var/reducible_tally = 0 //Tally elements that can be reduced are put here, then we apply MST effects
var/wear_slowdown_reduction = 0

Expand Down
9 changes: 7 additions & 2 deletions code/modules/mob/mob_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
if(living_mob && living_mob.body_position == LYING_DOWN && mob.crawling)
return

var/turf/old_turf = get_turf(mob)

next_move_dir_add = 0
next_move_dir_sub = 0

Expand Down Expand Up @@ -210,14 +212,17 @@

if (mob.tile_contents)
mob.tile_contents = list()
if(.)
if(get_turf(mob) != old_turf) // If we actually moved
mob.track_steps_walked()
mob.life_steps_total++
if(mob.clone != null)
mob.update_clone()

next_movement = world.time + move_delay
SEND_SIGNAL(mob, COMSIG_MOB_MOVE_SUCCESS)
mob.move_intentionally = FALSE
moving = FALSE
next_movement = world.time + move_delay

return

///Process_Spacemove
Expand Down
Loading