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

◆ Start()

override void FirearmActionLoadMultiBulletQuick::Start ( ActionData action_data)
inlineprivate

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

135 {
136 super.Start( action_data );
137
138 WeaponManager weaponManager = action_data.m_Player.GetWeaponManager();
139 int idx = 0;
140 Magazine mag = weaponManager.GetNextPreparedMagazine(idx);
141 Weapon weapon = Weapon.Cast(action_data.m_Player.GetItemInHands());
142
143 int internalCount = weapon.GetInternalMagazineCartridgeCount(0);
144 int maxCount = weapon.GetInternalMagazineMaxCartridgeCount(0) + 1;
145 int total = mag.GetAmmoCount() + internalCount;
146
147 if (total < maxCount)
148 {
149 //Increment index for the first additional mag find, since GetNextPreparedMagazine does not do that
150 //Normally the mag at found index is combined right after, removing it from the suitable magazine array
151 ++idx;
152 Magazine additionalMag = weaponManager.GetNextPreparedMagazine(idx);
153
154 while ((additionalMag != null) && (total < maxCount))
155 {
156 total += additionalMag.GetAmmoCount();
157 mag.CombineItems(additionalMag);
158 additionalMag = weaponManager.GetNextPreparedMagazine(idx);
159 }
160 }
161
162 action_data.m_Player.GetWeaponManager().LoadMultiBullet(mag, this);
163 }
Magazine GetNextPreparedMagazine(out int startIdx)
Определения WeaponManager.c:1097

Перекрестные ссылки ActionData и WeaponManager::GetNextPreparedMagazine().