DayZ 1.27
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 MagazineStorage mag = MagazineStorage.Cast(player.GetWeaponManager().GetPreparedMagazine());
241
242 if (!mag)
243 return false;
244
245 Weapon weapon = Weapon.Cast(item);
246 bool isLoadedMag = false;
247
248 for (int i = 0, count = weapon.GetMuzzleCount(); i < count; ++i)
249 isLoadedMag |= ( mag == weapon.GetMagazine( i ) );
250
251 return !isLoadedMag;
252 }
proto native int GetRunningAction()
returns -1 when no action is running or RELOAD,MECHANISM, ....
WeaponActions
actions
Определения human.c:816
void HumanCommandWeapons()
Определения human.c:1113

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