Skip to content

Commit 1d97b4e

Browse files
committed
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.
1 parent f75c14f commit 1d97b4e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

msu/hooks/skills/skill_container.nut

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989

9090
q.onMovementFinished <- function( _tile )
9191
{
92-
this.callSkillsFunction("onMovementFinished", [
92+
this.callSkillsFunctionWhenAlive("onMovementFinished", [
9393
_tile
9494
]);
9595
}
@@ -108,7 +108,7 @@
108108
// to crashes if any skill tries to access the current tile in its onUpdate
109109
// function as the tile at this point is not a valid tile.
110110

111-
this.callSkillsFunction("onAnySkillExecuted", [
111+
this.callSkillsFunctionWhenAlive("onAnySkillExecuted", [
112112
_skill,
113113
_targetTile,
114114
_targetEntity,
@@ -189,7 +189,7 @@
189189

190190
q.onOtherActorDeath <- function( _killer, _victim, _skill, _deathTile, _corpseTile, _fatalityType )
191191
{
192-
this.callSkillsFunction("onOtherActorDeath", [
192+
this.callSkillsFunctionWhenAlive("onOtherActorDeath", [
193193
_killer,
194194
_victim,
195195
_skill,

0 commit comments

Comments
 (0)