161 {
162 Weapon_Base wpn = Weapon_Base.Cast(action_data.m_MainItem);
163 Magazine mag = Magazine.Cast(action_data.m_Target.GetObject());
164
165 InventoryLocation ilWpn = new InventoryLocation();
166 InventoryLocation ilMag = new InventoryLocation();
167
168
169 int ur_index = action_data.m_Player.GetHumanInventory().FindUserReservedLocationIndex(wpn);
170
171 if(ur_index > -1)
172 action_data.m_Player.GetHumanInventory().GetUserReservedLocation(ur_index,ilWpn);
173 else
174 {
176
177
178
179 }
180
182 return false;
183
184 if( !super.InventoryReservation( action_data ) )
185 return false;
186
187 AdvDetachMagActionData action_data_dm = AdvDetachMagActionData.Cast(action_data);
188 if( !action_data.m_Player.GetInventory().AddInventoryReservationEx(wpn,ilWpn,10000) )
189 return false;
190
191 if( !action_data.m_Player.GetInventory().AddInventoryReservationEx(mag,ilMag,10000) )
192 return false;
193
194 action_data_dm.m_ReservedInventoryLocations.Insert(ilWpn);
195 action_data_dm.m_ReservedInventoryLocations.Insert(ilMag);
196 action_data_dm.m_ilWeapon = ilWpn;
197 action_data_dm.m_ilMagazine = ilMag;
198
199 return true;
200 }
FindInventoryLocationType
flags for searching locations in inventory