339 {
340 Weapon_Base weapon;
341 InventoryLocation ilWeapon = new InventoryLocation();
342 if (Weapon_Base.CastTo(weapon,
m_player.GetItemInHands()) )
343 {
344 weapon.GetInventory().GetCurrentInventoryLocation(ilWeapon);
345 if (
m_player.GetInventory().HasInventoryReservation(weapon, ilWeapon) )
346 {
347 return false;
348 }
349 else
350 {
351 m_player.GetInventory().AddInventoryReservationEx(weapon,ilWeapon,GameInventory.c_InventoryReservationTimeoutMS);
352 }
353 }
354
355 if( invLoc )
356 {
357 if (
m_player.GetInventory().HasInventoryReservation(invLoc.
GetItem(),invLoc) )
358 {
359 m_player.GetInventory().ClearInventoryReservationEx(weapon, ilWeapon);
360 return false;
361 }
362 else
363 {
364 m_player.GetInventory().AddInventoryReservationEx(invLoc.
GetItem(),invLoc,GameInventory.c_InventoryReservationTimeoutMS);
365 }
366 }
367
368 if( mag )
369 {
372
374
375 {
376 m_player.GetInventory().ClearInventoryReservationEx(weapon, ilWeapon);
377 if (invLoc)
378 {
379 m_player.GetInventory().ClearInventoryReservationEx(invLoc.
GetItem(), invLoc);
380 }
381 return false;
382 }
383 else
384 {
386 }
387 }
390
391 return true;
392 }
proto native EntityAI GetItem()
returns item of current inventory location
Magazine m_PendingTargetMagazine
Weapon_Base m_WeaponInHand
ref InventoryLocation m_PendingInventoryLocation
ref InventoryLocation m_TargetInventoryLocation