Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: harryob <[email protected]>
  • Loading branch information
Git-Nivrak and harryob authored May 24, 2024
1 parent ca41cdd commit ae59329
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions code/datums/effects/xeno_strains/execute_tag.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
flags = DEL_ON_DEATH | INF_DURATION


/datum/effects/execute_tag/New(atom/A, mob/from = null, last_dmg_source = null, zone = "chest", ttl = 35)
. = ..(A, from, last_dmg_source, zone)
/datum/effects/execute_tag/New(atom/affected, mob/from = null, last_dmg_source = null, zone = "chest", ttl = 35)
. = ..()

addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), src), ttl)

if (ishuman(A))
var/mob/living/carbon/human/H = A
H.update_xeno_hostile_hud()
if (ishuman(affected))
var/mob/living/carbon/human/affected_human = affected
affected_human.update_xeno_hostile_hud()


/datum/effects/execute_tag/validate_atom(mob/living/carbon/H)
if (!isxeno_human(H) || H.stat == DEAD)
/datum/effects/execute_tag/validate_atom(mob/living/carbon/affected_carbon)
if (!isxeno_human(affected_carbon) || affected_carbon.stat == DEAD)
return FALSE
return ..()

Expand All @@ -27,15 +27,15 @@
if (!istype(affected_atom, /mob/living/carbon/human))
return

var/mob/living/carbon/human/H = affected_atom
H.update_xeno_hostile_hud()
var/mob/living/carbon/human/affected_human = affected_atom
affected_human.update_xeno_hostile_hud()


/datum/effects/execute_tag/Destroy()
if (!ishuman(affected_atom))
return ..()

var/mob/living/carbon/human/H = affected_atom
addtimer(CALLBACK(H, TYPE_PROC_REF(/mob/living/carbon/human, update_xeno_hostile_hud)), 3)
var/mob/living/carbon/human/affected_human = affected_atom
addtimer(CALLBACK(affected_human, TYPE_PROC_REF(/mob/living/carbon/human, update_xeno_hostile_hud)), 0.3 SECONDS)

return ..()
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@
qdel(target_tag)

if (HAS_TRAIT(src, TRAIT_KNOCKEDOUT) || stat == UNCONSCIOUS)
new /datum/effects/execute_tag(src, src, , , 35)
new /datum/effects/execute_tag(src, src, ttl = 35)

src.update_execute_hud()

0 comments on commit ae59329

Please sign in to comment.