Merge pull request #9190 from MistakeNot4892/doafter

Corrects a couple of mecha do_afters that relied on previous implementation.
This commit is contained in:
Atermonera
2023-08-05 12:52:38 -08:00
committed by GitHub
3 changed files with 11 additions and 7 deletions

View File

@@ -26,7 +26,7 @@
if (chassis)
chassis.visible_message("<span class='notice'>[user] starts to climb into [chassis].</span>")
if(do_after(user, 40, needhand=0))
if(do_after(user, 4 SECONDS, needhand=0))
if(!src.occupant)
user.forceMove(src)
occupant = user
@@ -148,4 +148,4 @@
to_chat(usr, "<span class='warning'>\The [src] doesn't have a passenger compartment.</span>")
#undef LOCKED
#undef OCCUPIED
#undef OCCUPIED

View File

@@ -172,7 +172,7 @@
to_chat(user, "<span class='warning'>This disk seems to be corrupted!</span>")
else
to_chat(user, "<span class='notice'>Installing blueprint files for [D.company]...</span>")
if(do_after(user,50,src))
if(do_after(user, 5 SECONDS, src))
var/datum/robolimb/R = all_robolimbs[D.company]
R.unavailable_to_build = 0
to_chat(user, "<span class='notice'>Installed [D.company] blueprints!</span>")
@@ -185,7 +185,7 @@
to_chat(user, "<span class='warning'>This disk seems to be corrupted!</span>")
else
to_chat(user, "<span class='notice'>Uploading modification files for [D.species]...</span>")
if(do_after(user,50,src))
if(do_after(user, 5 SECONDS, src))
species_types |= D.species
to_chat(user, "<span class='notice'>Uploaded [D.species] files!</span>")
qdel(I)

View File

@@ -753,10 +753,14 @@
T:take_damage(force)
melee_can_hit = 0
if(do_after(melee_cooldown))
if(mech_delay(melee_cooldown))
melee_can_hit = 1
return
/obj/mecha/proc/mech_delay(var/delay)
sleep(delay)
return !QDELETED(src)
/obj/mecha/proc/range_action(atom/target)
return
@@ -953,7 +957,7 @@
float_direction = direction
start_process(MECHA_PROC_MOVEMENT)
src.log_message("<span class='warning'>Movement control lost. Inertial movement started.</span>")
if(do_after(get_step_delay()))
if(mech_delay(get_step_delay()))
can_move = 1
return 1
return 0
@@ -2666,7 +2670,7 @@
var/mob/occupant = P.occupant
user.visible_message("<span class='notice'>\The [user] begins opening the hatch on \the [P]...</span>", "<span class='notice'>You begin opening the hatch on \the [P]...</span>")
if (!do_after(user, 40))
if (!do_after(user, 4 SECONDS))
return
user.visible_message("<span class='notice'>\The [user] opens the hatch on \the [P] and removes [occupant]!</span>", "<span class='notice'>You open the hatch on \the [P] and remove [occupant]!</span>")