Skip to content

Commit

Permalink
fix: change certain skill container functions to only when alive
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
LordMidas committed Apr 11, 2024
1 parent f75c14f commit 1d97b4e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions msu/hooks/skills/skill_container.nut
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@

q.onMovementFinished <- function( _tile )
{
this.callSkillsFunction("onMovementFinished", [
this.callSkillsFunctionWhenAlive("onMovementFinished", [
_tile
]);
}
Expand All @@ -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,
Expand Down Expand Up @@ -189,7 +189,7 @@

q.onOtherActorDeath <- function( _killer, _victim, _skill, _deathTile, _corpseTile, _fatalityType )
{
this.callSkillsFunction("onOtherActorDeath", [
this.callSkillsFunctionWhenAlive("onOtherActorDeath", [
_killer,
_victim,
_skill,
Expand Down

0 comments on commit 1d97b4e

Please sign in to comment.