From 6f18397d0cc8783e77d5fa28e446c9bfa7bee6d1 Mon Sep 17 00:00:00 2001 From: LordMidas <55047920+LordMidas@users.noreply.github.com> Date: Thu, 11 Apr 2024 05:35:30 -0400 Subject: [PATCH] fix: change certain skill container functions to only when alive Some mods may kill certain entities during these functions, e.g. during onMovementFinished because of a certain skill/effect on the entity, which may then cause subsequently updated skills to crash. This change prevents such cases. --- msu/hooks/skills/skill_container.nut | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/msu/hooks/skills/skill_container.nut b/msu/hooks/skills/skill_container.nut index 138dba667..af6b21456 100644 --- a/msu/hooks/skills/skill_container.nut +++ b/msu/hooks/skills/skill_container.nut @@ -89,7 +89,7 @@ q.onMovementFinished <- function( _tile ) { - this.callSkillsFunction("onMovementFinished", [ + this.callSkillsFunctionWhenAlive("onMovementFinished", [ _tile ]); } @@ -108,7 +108,7 @@ // to crashes if any skill tries to access the current tile in its onUpdate // function as the tile at this point is not a valid tile. - this.callSkillsFunction("onAnySkillExecuted", [ + this.callSkillsFunctionWhenAlive("onAnySkillExecuted", [ _skill, _targetTile, _targetEntity, @@ -189,7 +189,7 @@ q.onOtherActorDeath <- function( _killer, _victim, _skill, _deathTile, _corpseTile, _fatalityType ) { - this.callSkillsFunction("onOtherActorDeath", [ + this.callSkillsFunctionWhenAlive("onOtherActorDeath", [ _killer, _victim, _skill,