Skip to content

Commit

Permalink
Actor::Die: also set a pst-only var if appropriate
Browse files Browse the repository at this point in the history
fixes #600
  • Loading branch information
lynxlynxlynx committed Jan 12, 2020
1 parent a64c37b commit 24c8a34
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gemrb/core/Scriptable/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5508,13 +5508,15 @@ void Actor::Die(Scriptable *killer, bool grantXP)
killer = area->GetActorByGlobalID(LastHitter);
}

bool killerPC = false;
if (killer) {
if (killer->Type==ST_ACTOR) {
act = (Actor *) killer;
// for unknown reasons the original only sends the trigger if the killer is ok
if (act && !(act->GetStat(IE_STATE_ID)&(STATE_DEAD|STATE_PETRIFIED|STATE_FROZEN))) {
killer->AddTrigger(TriggerEntry(trigger_killed, GetGlobalID()));
}
killerPC = act->InParty > 0;
}
}

Expand Down Expand Up @@ -5591,6 +5593,9 @@ void Actor::Die(Scriptable *killer, bool grantXP)

ieDword value = 0;
ieVariable varname;
if (InParty && killerPC) {
game->locals->SetAt("PM_KILLED", 1, nocreate);
}

// death variables are updated at the moment of death
if (KillVar[0]) {
Expand Down

0 comments on commit 24c8a34

Please sign in to comment.