9126 {
9127
9128 Magazine swapmag1 = Magazine.Cast(item1);
9129 Magazine swapmag2 = Magazine.Cast(item2);
9130
9131 if (swapmag1 && swapmag2)
9132 {
9133 Weapon_Base parentWpn;
9134
9135 if (Class.CastTo(parentWpn, swapmag1.GetHierarchyParent()))
9136 {
9138 {
9139 Print(
"[inv] PlayerBase.PredictiveSwapEntities: swapping mag1=" + swapmag1 +
" to parent wpn=" + parentWpn +
" of mag1=" + swapmag1);
9141 }
9142 else
9143 {
9144 Print(
"[inv] PlayerBase.PredictiveSwapEntities: can not swap magazines");
9145 return false;
9146 }
9147 }
9148
9149 if (Class.CastTo(parentWpn, swapmag2.GetHierarchyParent()))
9150 {
9152 {
9153 Print(
"[inv] PlayerBase.PredictiveSwapEntities: swapping mag1=" + swapmag1 +
" to parent wpn=" + parentWpn +
" of mag2=" + swapmag2);
9155 }
9156 else
9157 {
9158 Print(
"[inv] PlayerBase.PredictiveSwapEntities: can not swap magazines");
9159 return false;
9160 }
9161 }
9162 }
9163
9167 {
9168 ActionManagerClient mngr_client;
9170
9172 if (mngr_client.GetAction(ActionSwapItemToHands).Can(
this,atrg,
ItemBase.Cast(item_hands)))
9173 {
9175 return true;
9176 }
9177 return super.PredictiveSwapEntities(item1, item2);
9178 }
9179 else
9180 return super.PredictiveSwapEntities(item1, item2);
9181 }
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
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.