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

◆ ActionCondition()

override bool FirearmActionAttachMagazineQuick::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

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

232 {
233 if (!super.ActionCondition( player, target, item ))
234 return false;
235
236 HumanCommandWeapons hcw = player.GetCommandModifier_Weapons();
237 if (hcw && hcw.GetRunningAction() == WeaponActions.RELOAD)
238 return false;
239
240 Magazine magazine;
241 #ifdef SERVER
242 magazine = Magazine.Cast(target.GetObject());
243 #else
244 magazine = Magazine.Cast(player.GetWeaponManager().GetPreparedMagazine());
245 #endif
246 if (!magazine)
247 return false;
248
249 MagazineStorage mag = MagazineStorage.Cast(magazine);
250 if (!mag)
251 return false;
252
253 Weapon weapon = Weapon.Cast(item);
254 bool isLoadedMag = false;
255
256 for (int i = 0, count = weapon.GetMuzzleCount(); i < count; ++i)
257 isLoadedMag |= ( mag == weapon.GetMagazine( i ) );
258
259 return !isLoadedMag;
260 }
proto native int GetRunningAction()
returns -1 when no action is running or RELOAD,MECHANISM, ....
WeaponActions
actions
Определения human.c:816
void HumanCommandWeapons()
Определения human.c:1126

Перекрестные ссылки ActionTarget() и HumanCommandWeapons::GetRunningAction().