Skip to content

Commit

Permalink
reset charge turf if we stop for some reason
Browse files Browse the repository at this point in the history
  • Loading branch information
morrowwolf committed Nov 14, 2023
1 parent 52cf713 commit 9bcdb2f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/dcs/signals/atom/mob/living/signals_xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
#define COMSIG_XENO_STOP_MOMENTUM "xeno_stop_momentum"
/// Called whenever xeno should resume charge
#define COMSIG_XENO_START_CHARGING "xeno_start_charging"
/// From /datum/action/xeno_action/onclick/charger_charge/proc/stop_momentum()
#define COMSIG_XENO_STOPPED_CHARGING "xeno_stopped_charging"

// Used in resin_constructions.dm
// Checks whether the xeno can build a thick structure regardless of hive weeds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@
Xeno.visible_message(SPAN_DANGER("[Xeno] skids to a halt!"))

REMOVE_TRAIT(Xeno, TRAIT_CHARGING, TRAIT_SOURCE_XENO_ACTION_CHARGE)
SEND_SIGNAL(Xeno, COMSIG_XENO_STOPPED_CHARGING)
steps_taken = 0
momentum = 0
Xeno.recalculate_speed()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/datum/xeno_ai_movement/crusher/New(mob/living/carbon/xenomorph/parent)
. = ..()

RegisterSignal(parent, COMSIG_XENO_STOPPED_CHARGING, PROC_REF(stopped_charging))

#define MIN_TARGETS_TO_CHARGE 2
#define MAX_CHARGE_DISTANCE 50
Expand Down Expand Up @@ -143,6 +144,11 @@
INVOKE_ASYNC(charge_action, TYPE_PROC_REF(/datum/action/xeno_action/onclick/charger_charge, use_ability_wrapper))
charge_turf = null

/datum/xeno_ai_movement/crusher/proc/stopped_charging()
SIGNAL_HANDLER

charge_turf = null

/mob/living/carbon/xenomorph/crusher/Move(NewLoc, direct)
if(direct == 0)
direct = last_move_dir
Expand Down

0 comments on commit 9bcdb2f

Please sign in to comment.