Add OpenDoorAction to handle unlocking and opening doors with event publishing

This commit is contained in:
2025-10-30 02:35:28 +01:00
parent 3fcb31d92f
commit 1a4c4cf4b1
2 changed files with 35 additions and 1 deletions

View File

@@ -52,7 +52,7 @@ public class InteractionSystem(float interactionRange) : ISystem
switch (door.CurrentState)
{
case DoorComponent.DoorState.Locked:
if (CheckRequirements(world, interactor, door.Requirements))
if (door.Requirements.Count > 0 && CheckRequirements(world, interactor, door.Requirements))
{
world.Logger.Info($"Door {doorEntity.Id} requirements met. Unlocking door.");
door.CurrentState = DoorComponent.DoorState.Opening;