8524 {
8525
8526 Magazine swapmag1 = Magazine.Cast(item1);
8527 Magazine swapmag2 = Magazine.Cast(item2);
8528
8529 if (swapmag1 && swapmag2)
8530 {
8531 Weapon_Base parentWpn;
8532
8533 if (Class.CastTo(parentWpn, swapmag1.GetHierarchyParent()))
8534 {
8536 {
8537 Print(
"[inv] PlayerBase.PredictiveSwapEntities: swapping mag1=" + swapmag1 +
" to parent wpn=" + parentWpn +
" of mag1=" + swapmag1);
8539 }
8540 else
8541 {
8542 Print(
"[inv] PlayerBase.PredictiveSwapEntities: can not swap magazines");
8543 return false;
8544 }
8545 }
8546
8547 if (Class.CastTo(parentWpn, swapmag2.GetHierarchyParent()))
8548 {
8550 {
8551 Print(
"[inv] PlayerBase.PredictiveSwapEntities: swapping mag1=" + swapmag1 +
" to parent wpn=" + parentWpn +
" of mag2=" + swapmag2);
8553 }
8554 else
8555 {
8556 Print(
"[inv] PlayerBase.PredictiveSwapEntities: can not swap magazines");
8557 return false;
8558 }
8559 }
8560 }
8561
8565 {
8566 ActionManagerClient mngr_client;
8568
8570 if (mngr_client.GetAction(ActionSwapItemToHands).Can(
this,atrg,
ItemBase.Cast(item_hands)))
8571 {
8573 return true;
8574 }
8575 return super.PredictiveSwapEntities(item1, item2);
8576 }
8577 else
8578 return super.PredictiveSwapEntities(item1, item2);
8579 }
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.