204 {
205 if (damage < 1.0)
206 {
207
210 {
211 int sz = mags.Count();
212 for (int i = 0; i < sz; ++i)
213 {
214 Magazine mag_i = mags.Get(i);
215 if (mag_i != exclude_mag && mag_i.CanAddCartridges(1))
216 {
217 return mag_i;
218 }
219 }
220 }
221
222
225 {
227 if (eai_inv && eai_inv.IsInherited(Magazine))
228 {
229 Magazine mag_inv;
231 {
232 mag_inv.ServerSetAmmoCount(0);
233 return mag_inv;
234 }
235 }
236 }
237 }
238
239 vector pos = player.GetPosition();
240 EntityAI eai_gnd = player.SpawnEntityOnGroundPos(magTypeName, pos);
241 if (eai_gnd && eai_gnd.IsInherited(Magazine))
242 {
243 Magazine mag_gnd;
245 {
246 mag_gnd.ServerSetAmmoCount(0);
247 return mag_gnd;
248 }
249 }
250
251 return NULL;
252 }
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
void DayZPlayerUtils()
cannot be instantiated
FindInventoryLocationType
flags for searching locations in inventory
Super root of all classes in Enforce script.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.