Skip to content

Commit

Permalink
Mechs will now immediately cancel doafters instead of waiting until t…
Browse files Browse the repository at this point in the history
…ill the end to tell you you moved (tgstation#65814)

Co-authored-by: TiviPlus <[email protected]>
Co-authored-by: Watermelon914 <[email protected]>
Co-authored-by: Kylerace <[email protected]>
  • Loading branch information
4 people authored Apr 6, 2022
1 parent 55193fd commit d256538
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions code/modules/vehicles/mecha/equipment/mecha_equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,17 @@
*/
/obj/item/mecha_parts/mecha_equipment/proc/do_after_cooldown(atom/target, mob/user, interaction_key)
if(!chassis)
return
chassis.use_power(energy_drain)
. = do_after(user, equip_cooldown, target=target, interaction_key = interaction_key)
if(!chassis || !(get_dir(chassis, target) & chassis.dir))
return FALSE
chassis.use_power(energy_drain)
return do_after(user, equip_cooldown, target, extra_checks = CALLBACK(src, .proc/do_after_checks, target), interaction_key = interaction_key)

///Do after wrapper for mecha equipment
/obj/item/mecha_parts/mecha_equipment/proc/do_after_mecha(atom/target, mob/user, delay)
if(!chassis)
return
. = do_after(user, delay, target=target)
if(!chassis || !(get_dir(chassis, target)&chassis.dir))
return FALSE
return do_after(user, delay, target, extra_checks = CALLBACK(src, .proc/do_after_checks, target))

/// do after checks for the mecha equipment do afters
/obj/item/mecha_parts/mecha_equipment/proc/do_after_checks(atom/target)
return chassis && (get_dir(chassis, target) & chassis.dir)

/obj/item/mecha_parts/mecha_equipment/proc/can_attach(obj/vehicle/sealed/mecha/M, attach_right = FALSE)
return default_can_attach(M, attach_right)
Expand Down

0 comments on commit d256538

Please sign in to comment.