Fix stick being thrown when picking up casette
This commit is contained in:
parent
f6e14e0ec4
commit
d577b7ef9c
@ -67,10 +67,12 @@ public class ItemGrabber : MonoBehaviour {
|
|||||||
CanIgniteTorch |= Campfire != null && TorchableItem != null;
|
CanIgniteTorch |= Campfire != null && TorchableItem != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool JustPickedUpCasette = false;
|
||||||
if (Casette != null && Input.GetButtonDown("Grab")) {
|
if (Casette != null && Input.GetButtonDown("Grab")) {
|
||||||
Casette.Play(PreviousCasette);
|
Casette.Play(PreviousCasette);
|
||||||
PreviousCasette = Casette;
|
PreviousCasette = Casette;
|
||||||
Casette = null;
|
Casette = null;
|
||||||
|
JustPickedUpCasette = true;
|
||||||
} else if (Campfire == null && LookedAtItem != null && Input.GetButtonDown("Grab")) {
|
} else if (Campfire == null && LookedAtItem != null && Input.GetButtonDown("Grab")) {
|
||||||
LookedAtItem.PickUp(HandTransform);
|
LookedAtItem.PickUp(HandTransform);
|
||||||
GrabbedItems.Add(LookedAtItem);
|
GrabbedItems.Add(LookedAtItem);
|
||||||
@ -91,7 +93,7 @@ public class ItemGrabber : MonoBehaviour {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Input.GetButtonDown("Grab") && (LookedAtItem == null || Campfire != null) && ThrowableItem != null) {
|
if (Input.GetButtonDown("Grab") && (LookedAtItem == null || Campfire != null) && ThrowableItem != null && !JustPickedUpCasette) {
|
||||||
Vector3 DropPosition;
|
Vector3 DropPosition;
|
||||||
if (Campfire != null) {
|
if (Campfire != null) {
|
||||||
DropPosition = Campfire.transform.position + Vector3.up * 0.7f;
|
DropPosition = Campfire.transform.position + Vector3.up * 0.7f;
|
||||||
|
Loading…
Reference in New Issue
Block a user