DayZ 1.28
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ ejectBulletAndStoreInMagazine()

void ejectBulletAndStoreInMagazine ( Weapon_Base weapon,
int muzzleIndex,
Magazine mag,
DayZPlayer p )

no magazine configured in parent state, looking in inventory

См. определение в файле weapon_utils.c строка 58

59{
60 float damage = 0;
61 string type = string.Empty;
62 string magazineTypeName = weapon.GetChamberedCartridgeMagazineTypeName(muzzleIndex);
63 if (weapon.EjectCartridge(muzzleIndex, damage, type))
64 {
66 wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(weapon) + " ejectBulletAndStoreInMagazine, ejected chambered cartridge");
67 }
68 else
69 Error("[wpnfsm] " + Object.GetDebugName(weapon) + " ejectBulletAndStoreInMagazine, error - cannot eject chambered cartridge!");
70
71
72 if (mag == null)
73 {
74 if (!GetGame().IsMultiplayer() || GetGame().IsServer())
75 {
77 if (DayZPlayerUtils.HandleStoreCartridge(p, weapon, muzzleIndex, damage, type, magazineTypeName))
78 {
80 wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(weapon) + " ejectBulletAndStoreInMagazine, ok - cartridge stored in magazine");
81 }
82 else
83 Error("[wpnfsm] " + Object.GetDebugName(weapon) + " ejectBulletAndStoreInMagazine, error - cannot store cartridge!");
84 if (!GetGame().IsMultiplayer() || GetGame().IsServer())
85 }
86 }
87 else
88 {
89 if (mag.LocalStoreCartridge(damage, type))
90 {
91 mag.SetSynchDirty();
93 wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(weapon) + " ejectBulletAndStoreInMagazine, ok - cartridge stored in user defined magazine");
94 }
95 else
96 Error("[wpnfsm] " + Object.GetDebugName(weapon) + " ejectBulletAndStoreInMagazine, error - cannot store cartridge in magazine");
97 }
98}
void wpnDebugPrint(string s)
void DayZPlayerUtils()
cannot be instantiated
Определения DayZPlayerUtils.c:465
static bool IsWeaponLogEnable()
Определения 3_Game/tools/Debug.c:718
Определения 3_Game/tools/Debug.c:594
Определения ObjectTyped.c:2
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90

Перекрестные ссылки DayZPlayerUtils(), Error(), GetGame(), LogManager::IsWeaponLogEnable() и wpnDebugPrint().

Используется в WeaponStateBase::OnEntry().