Player Trap ID fix

This commit is contained in:
brausjonas
2023-04-07 00:09:36 +02:00
parent 93147cd67e
commit 248059113a
3 changed files with 18 additions and 9 deletions
@@ -177,11 +177,15 @@ public class PlayablePlayer : Player
if (currentField.placedItem != null)
{
Trap t = currentField.placedItem.GetComponent<Trap>();
AddCoins(-3);
Debug.Log(t.name);
t.target.AddCoins(3);
currentField.placedItem = null;
Destroy(t.gameObject);
if(t.target.index != index)
{
AddCoins(-3);
Debug.Log(t.name);
t.target.AddCoins(3);
currentField.placedItem = null;
Destroy(t.gameObject);
}
}
}
Vector3 currentRotation = Quaternion.ToEulerAngles(transform.rotation);