8774 {
8775
8776 Magazine swapmag1 = Magazine.Cast(item1);
8777 Magazine swapmag2 = Magazine.Cast(item2);
8778
8779 if (swapmag1 && swapmag2)
8780 {
8781 Weapon_Base parentWpn;
8782
8783 if (Class.CastTo(parentWpn, swapmag1.GetHierarchyParent()))
8784 {
8786 {
8787 Print(
"[inv] PlayerBase.PredictiveSwapEntities: swapping mag1=" + swapmag1 +
" to parent wpn=" + parentWpn +
" of mag1=" + swapmag1);
8789 }
8790 else
8791 {
8792 Print(
"[inv] PlayerBase.PredictiveSwapEntities: can not swap magazines");
8793 return false;
8794 }
8795 }
8796
8797 if (Class.CastTo(parentWpn, swapmag2.GetHierarchyParent()))
8798 {
8800 {
8801 Print(
"[inv] PlayerBase.PredictiveSwapEntities: swapping mag1=" + swapmag1 +
" to parent wpn=" + parentWpn +
" of mag2=" + swapmag2);
8803 }
8804 else
8805 {
8806 Print(
"[inv] PlayerBase.PredictiveSwapEntities: can not swap magazines");
8807 return false;
8808 }
8809 }
8810 }
8811
8815 {
8816 ActionManagerClient mngr_client;
8818
8820 if (mngr_client.GetAction(ActionSwapItemToHands).Can(
this,atrg,
ItemBase.Cast(item_hands)))
8821 {
8823 return true;
8824 }
8825 return super.PredictiveSwapEntities(item1, item2);
8826 }
8827 else
8828 return super.PredictiveSwapEntities(item1, item2);
8829 }
class ActionTargets ActionTarget
class GP5GasMask extends MaskBase ItemBase
void PerformActionStart(ActionBase action, ActionTarget target, ItemBase item, Param extra_data=NULL)
bool IsSwapBetweenHandsAndGroundLargeItem(notnull EntityAI item1, notnull EntityAI item2, out EntityAI item_hands, out EntityAI item_ground)
override WeaponManager GetWeaponManager()
ActionManagerBase m_ActionManager
bool SwapMagazine(Magazine mag, ActionBase control_action=NULL)
proto void Print(void var)
Prints content of variable to console/log.