forked from Mirrors/openclonk
Remove dialogue when target NPC dies (#1295).
parent
9349498f3f
commit
afd1dcba7f
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue