DayZ 1.24
Loading...
Searching...
No Matches
ActionSortAmmoPile.c
Go to the documentation of this file.
8
10{
17
23
24 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
25 {
26 return false;
27 }
28
30 {
31 SortAmmo(action_data.m_MainItem);
32 }
33
35 {
37 Magazine piles[5];
38 //string pile_classname = magazine.ConfigGetString("spawnPileType");
40 {
41 float health;
42 string ammo_type;
43 while (magazine.GetAmmoCount() > 0)
44 {
45 int count = magazine.GetAmmoCount();
46 if (magazine.ServerAcquireCartridge(health, ammo_type))
47 {
48 int health_label = MiscGameplayFunctions.GetHealthLevelForAmmo(ammo_type, health);
49 if (piles[health_label] == null)
50 piles[health_label] = Magazine.Cast(GetGame().CreateObjectEx(item.ClassName(), item.GetPosition(), ECE_PLACE_ON_SURFACE));
51 piles[health_label].ServerStoreCartridge(health, ammo_type);
52 }
53 }
54 }
55 }
56};
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
const int ECE_PLACE_ON_SURFACE
ActionData m_ActionData
ref CABase m_ActionComponent
Definition ActionBase.c:30
override void CreateActionComponent()
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
void SortAmmo(ItemBase item)
override void OnEndAnimationLoopServer(ActionData action_data)
Super root of all classes in Enforce script.
Definition EnScript.c:11
const float DEFAULT_SORT
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.