// Change firearm size depending on stock pos private void ShotgunMoveableStock_EndInteraction(On.FistVR.ShotgunMoveableStock.orig_EndInteraction orig, ShotgunMoveableStock self, FVRViveHand hand) { orig(self, hand); var firearm = self.Firearm; if (firearm != null && firearm.ObjectWrapper.ItemID == MP7_ID) { float stockPos = Vector3.Distance(self.transform.position, self.ForwardPoint.position); if (stockPos < 0.01f) { firearm.Size = FVRPhysicalObject.FVRPhysicalObjectSize.Medium; } else { firearm.Size = FVRPhysicalObject.FVRPhysicalObjectSize.Large; } } }
// Can't extend stock in small/medium qb slot private void ShotgunMoveableStock_UpdateInteraction(On.FistVR.ShotgunMoveableStock.orig_UpdateInteraction orig, ShotgunMoveableStock self, FVRViveHand hand) { var firearm = self.Firearm; if (firearm != null && firearm.ObjectWrapper.ItemID == MP7_ID) { var qb = firearm.QuickbeltSlot; if (qb == null || (qb != null && qb.SizeLimit != FVRPhysicalObject.FVRPhysicalObjectSize.Medium && qb.SizeLimit != FVRPhysicalObject.FVRPhysicalObjectSize.Small)) { orig(self, hand); } } else { orig(self, hand); } }