Remove dialogue when target NPC dies (#1295).

stable-6.1
Sven Eberhardt 2015-05-07 19:54:14 +02:00 committed by Maikel de Vries
parent 9349498f3f
commit afd1dcba7f
1 changed files with 11 additions and 1 deletions

View File

@ -87,11 +87,21 @@ public func InitDialogue(string name, object target, bool attention)
// Update dialogue to target.
UpdateDialogue();
// Effect on targets to remove the dialogue when target dies or is removed
AddEffect("IntDialogue", target, 1, 0, this);
// Custom dialogue initialization
if (!Call(Format("~Dlg_%s_Init", dlg_name), dlg_target))
GameCall(Format("~Dlg_%s_Init", dlg_name), this, dlg_target);
return;
return true;
}
private func FxIntDialogueStop(object target, proplist fx, int reason, bool temp)
{
// Target removed or died: Remove dialogue
if (!temp) RemoveObject();
return FX_OK;
}
public func AddAttention()