631 {
632 Weapon_Base wpn;
633 int mi;
634 InventoryLocation il;
635 int slotID;
636 bool accepted = false;
638 {
640 return false;
641
643 return false;
644
646 {
649 }
652 Magazine mag = NULL;
653
654 Weapon_Base.CastTo( wpn,
m_player.GetItemInHands() );
655 if ( wpn )
656 mi = wpn.GetCurrentMuzzle();
657
659 {
661 {
662 if ( !ctx.
Read(mag) )
663 break;
664
665 if ( !mag || !wpn )
666 break;
667
668 slotID = wpn.GetSlotFromMuzzleIndex(mi);
669 il = new InventoryLocation();
671 if(
g_Game.AddInventoryJunctureEx(
m_player, mag, il,
false, 10000) )
672 accepted = true;
673
675 break;
676 }
678 {
679 if ( !ctx.
Read(mag) )
680 break;
681
682 il = new InventoryLocation();
684 break;
685
686 if ( !mag || !wpn )
687 break;
688
689 if ( !wpn.GetMagazine(mi) )
690 break;
691
693 accepted = true;
696
697 break;
698 }
700 {
701 il = new InventoryLocation();
703 break;
704
706 break;
707
708 if ( !wpn )
709 break;
710
711 Magazine det_mag = wpn.GetMagazine(mi);
712 mag = Magazine.Cast(il.
GetItem());
713 if ( !det_mag || ( mag != det_mag) )
714 break;
715
717 accepted = true;
720 break;
721 }
723 {
725
726 if ( !mag )
727 break;
728
730 accepted = true;
732 break;
733 }
735 {
737
738 if ( !mag )
739 break;
740
742 accepted = true;
744 break;
745 }
747 {
748 accepted = true;
749
750 break;
751 }
753 {
754 accepted = true;
755 break;
756 }
758 {
759 accepted = true;
760 break;
761 }
762 default:
764 break;
765 }
767 }
768
769 return accepted;
770 }
const int AT_WPN_DETACH_MAGAZINE
const int AT_WPN_ATTACH_MAGAZINE
const int AT_WPN_LOAD_BULLET
const int AT_WPN_SWAP_MAGAZINE
const int AT_WPN_LOAD_MULTI_BULLETS_START
const int AT_WPN_EJECT_BULLET
const int AT_WPN_SET_NEXT_MUZZLE_MODE
proto native bool IsValid()
verify current set inventory location
proto native void SetAttachment(notnull EntityAI parent, EntityAI e, int slotId)
sets current inventory location type to Attachment with slot id set to <slotId>
bool ReadFromContext(ParamsReadContext ctx)
proto native EntityAI GetItem()
returns item of current inventory location
proto bool Read(void value_in)
int m_PendingWeaponActionAcknowledgmentID
Magazine m_PendingTargetMagazine
ref InventoryLocation m_PendingInventoryLocation
int m_PendingWeaponAction
void Error(string err)
Messagebox with error message.