503 {
504 super.OnAbort(e);
505
506 EntityAI leftHandItem = e.
m_player.GetInventory().FindAttachment(InventorySlots.LEFTHAND);
507 Magazine mag = Magazine.Cast(leftHandItem);
508
509 if (mag)
510 {
515
516 InventoryLocation il = new InventoryLocation();
517
519
521 {
523 {
524 if (LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine, ok - no inventory space for old magazine - dropped to ground - abort"); }
525 }
526 else
527 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine, error - cannot drop magazine from left hand after not found inventory space for old magazine - abort");
528
529 }
530 else
531 {
532 InventoryLocation oldSrc = new InventoryLocation();
533 mag.GetInventory().GetCurrentInventoryLocation(oldSrc);
534
535 if (GameInventory.LocationSyncMoveEntity(oldSrc, il))
536 {
537 if (LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine, ok - old magazine removed from wpn (LHand->inv) - abort"); }
538 }
539 else
540 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine, error - cannot remove old mag from wpn - abort");
541 }
542 }
543 }
void wpnDebugPrint(string s)
void DayZPlayerUtils()
cannot be instantiated
FindInventoryLocationType
flags for searching locations in inventory
proto native bool IsValid()
verify current set inventory location
Magazine m_newMagazine
magazine that will be detached
void Error(string err)
Messagebox with error message.