3 Magazine mag = weapon.GetMagazine(muzzleIndex);
4 if (mag && !mag.IsDamageDestroyed())
6 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" chamberFromAttachedMagazine, using attached magazine mag=" + mag.ToString()); }
9 if (mag && mag.LocalAcquireCartridge(damage, type))
11 weapon.SelectionBulletShow();
12 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" chamberFromAttachedMagazine, ok - cartridge acquired: dmg=" + damage +
" type=" + type); }
15 Error(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" chamberFromAttachedMagazine, error - cannot take cartridge from magazine");
17 if (weapon.PushCartridgeToChamber(muzzleIndex, damage, type))
19 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" chamberFromAttachedMagazine, ok - loaded chamber"); }
23 Error(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" chamberFromAttachedMagazine, error - cannot load chamber!");
27 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" chamberFromAttachedMagazine - magazine destroyer or no attached"); }
36 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" chamberFromInnerMagazine, using inner magazine."); }
39 if (weapon.PopCartridgeFromInternalMagazine(muzzleIndex,damage, type))
41 weapon.SelectionBulletShow();
42 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" chamberFromInnerMagazine, ok - cartridge acquired: dmg=" + damage +
" type=" + type); }
45 Error(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" chamberFromInnerMagazine, error - cannot take cartridge from magazine");
47 if (weapon.PushCartridgeToChamber(muzzleIndex, damage, type))
49 if (
LogManager.IsWeaponLogEnable()) {
wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" chamberFromInnerMagazine, ok - loaded chamber"); }
53 Error(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" chamberFromInnerMagazine, error - cannot load chamber!");
61 string type =
string.Empty;
62 string magazineTypeName = weapon.GetChamberedCartridgeMagazineTypeName(muzzleIndex);
63 if (weapon.EjectCartridge(muzzleIndex, damage, type))
66 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" ejectBulletAndStoreInMagazine, ejected chambered cartridge");
69 Error(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" ejectBulletAndStoreInMagazine, error - cannot eject chambered cartridge!");
76 if (
DayZPlayerUtils.HandleStoreCartridge(p, weapon, muzzleIndex, damage, type, magazineTypeName))
79 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" ejectBulletAndStoreInMagazine, ok - cartridge stored in magazine");
82 Error(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" ejectBulletAndStoreInMagazine, error - cannot store cartridge!");
86 if (mag.ServerStoreCartridge(damage, type))
90 wpnDebugPrint(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" ejectBulletAndStoreInMagazine, ok - cartridge stored in user defined magazine");
93 Error(
"[wpnfsm] " +
Object.GetDebugName(weapon) +
" ejectBulletAndStoreInMagazine, error - cannot store cartridge in magazine");
101 GetGame().GetInventoryItemSize(mag, w, h);
103 GetGame().GetInventoryItemSize(mag2, w2, h2);
104 if (w == w2 && h == h2)