Skip to content

Commit

Permalink
zzre: Fix another missing NPC script instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
Helco committed Jan 21, 2024
1 parent d2a392d commit 10993aa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions zzre/game/systems/npc/NPCScript.Execute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ partial class NPCScript
private const string CmdCreateDynamicItems = "_";
private const string CmdRevive = "b";
private const string CmdLookAtTrigger = "c";
private const string CmdIfTriggerIsEnabled = "d";
private const string CmdPlaySound = "e";
private const string CmdStartActorEffect = "g";
private const string CmdEndActorEffect = "h";
Expand Down Expand Up @@ -87,6 +88,12 @@ protected override OpReturn Execute(in DefaultEcs.Entity entity, ref components.
? OpReturn.Continue
: OpReturn.ConditionalSkip;

case CmdIfTriggerIsEnabled:
triggerI = int.Parse(args[0]);
return IfTriggerIsEnabled(entity, triggerI)
? OpReturn.Continue
: OpReturn.ConditionalSkip;

case CmdMoveSystem:
var waypointMode = Enum.Parse<messages.NPCMoveSystem.Mode>(args[0]);
var wpCategory = int.Parse(args[1]);
Expand Down
6 changes: 6 additions & 0 deletions zzre/game/systems/npc/NPCScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ private bool IfTriggerIsActive(DefaultEcs.Entity entity, int triggerI)
.Any();
}

private bool IfTriggerIsEnabled(DefaultEcs.Entity entity, int triggerI)
{
Console.WriteLine("Warning unimplemented NPC instruction \"ifTriggerIsEnabled\"");
return false;
}

private void MoveSystem(DefaultEcs.Entity entity, messages.NPCMoveSystem.Mode mode, int wpCategory)
{
World.Publish(new messages.NPCMoveSystem(entity, mode, wpCategory));
Expand Down

0 comments on commit 10993aa

Please sign in to comment.