Skip to content

Commit

Permalink
zzre: Only open doors the player has the key for
Browse files Browse the repository at this point in the history
Fixes #252
  • Loading branch information
Helco committed Oct 9, 2023
1 parent 3ecbb49 commit 411f998
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions zzre/game/systems/model/BehaviourDoor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ private void Update(
MathF.Abs(location.LocalPosition.Y - PlayerLocation.LocalPosition.Y) < MaxPlayerYDistance;

if (door.IsLocked && door.KeyItemId is not null && playerIsNear &&
game.PlayerEntity.Get<Inventory>().Contains(door.KeyItemId.Value) &&
game.PlayerEntity.Get<components.GameFlow>() == components.GameFlow.Normal)
{
var myLock = FindLockNearTo(location);
Expand Down

0 comments on commit 411f998

Please sign in to comment.