Skip to content

Commit

Permalink
minor fix in CutAction
Browse files Browse the repository at this point in the history
  • Loading branch information
Farfi55 committed Sep 13, 2023
1 parent 71bc603 commit 847f9e6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Assets/Scripts/CookedUp/ThinkEngine/Actions/CutAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,19 @@ public class CutAction : InteractAction
AnyError = true;
return;
}

var containerKitchenObject = cuttingCounter.Container.KitchenObject;
if (containerKitchenObject == null) {
Debug.LogWarning($"[{GetType().Name}]: Target {Target.name} does not have a KitchenObject!", cuttingCounter);
AnyError = true;
return;
}

var koPlayer = cuttingCounter.Container.KitchenObject.GetComponent<KitchenObjectPlayer>();
var koPlayer = containerKitchenObject.GetComponent<KitchenObjectPlayer>();
if (koPlayer == null) {
Debug.LogWarning($"[{GetType().Name}]: Target {Target.name} does not have a KitchenObjectPlayer component!", cuttingCounter);
AnyError = true;
return;
}
if(koPlayer.Player != Player) {
else if(koPlayer.Player != Player) {
Debug.LogWarning($"[{GetType().Name}]: Target {Target.name} is not being used by {Player.name}!", cuttingCounter);
AnyError = true;
return;
Expand Down

0 comments on commit 847f9e6

Please sign in to comment.