DayZ 1.27
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 if (!GetGame().IsMultiplayer() || GetGame().IsServer())
72 {
73 if (mag == null)
74 {
76 if (DayZPlayerUtils.HandleStoreCartridge(p, weapon, muzzleIndex, damage, type, magazineTypeName))
77 {
79 wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(weapon) + " ejectBulletAndStoreInMagazine, ok - cartridge stored in magazine");
80 }
81 else
82 Error("[wpnfsm] " + Object.GetDebugName(weapon) + " ejectBulletAndStoreInMagazine, error - cannot store cartridge!");
83 }
84 else
85 {
86 if (mag.ServerStoreCartridge(damage, type))
87 {
88 mag.SetSynchDirty();
90 wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(weapon) + " ejectBulletAndStoreInMagazine, ok - cartridge stored in user defined magazine");
91 }
92 else
93 Error("[wpnfsm] " + Object.GetDebugName(weapon) + " ejectBulletAndStoreInMagazine, error - cannot store cartridge in magazine");
94 }
95 }
96}
void wpnDebugPrint(string s)
Определения Debug.c:9
void DayZPlayerUtils()
cannot be instantiated
Определения DayZPlayerUtils.c:465
static bool IsWeaponLogEnable()
Определения Debug.c:718
Определения 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().