Add OpenDoorAction to handle unlocking and opening doors with event publishing
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user