Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public override void ItemActivate(bool used, bool buttonDown = true)
- {
- base.ItemActivate(used, buttonDown);
- if (NetworkManager.Singleton.IsServer)
- {
- ServerRCPThrow();
- }
- else { ClientRequestDiscardHeldObject(); }
- }
- [ClientRpc]
- public void ClientRequestDiscardHeldObject()
- {
- ServerRCPThrow();
- }
- [ServerRpc]
- public void ServerRCPThrow()
- {
- if (!canThrowWhenNotCharged && insertedBattery.charge <= 0)
- {
- return;
- }
- if (isThrown || instaThrow)
- {
- playerHeldBy.DiscardHeldObject(placeObject: true, null, GetThrowDestination());
- itemUsedUp = true;
- }
- isThrown = true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement