276 {
277 vector pos = player.GetPosition();
278 EntityAI entityGround = player.SpawnEntityOnGroundPos(magTypeName, pos);
279 if (entityGround && entityGround.IsInherited(Magazine))
280 {
281 Magazine magazineGround;
283 {
284 magazineGround.ServerSetAmmoCount(0);
285 magazineGround.SetHealth("", "", (1 - damage) * magazineGround.GetMaxHealth());
286 if (magazineGround.ServerStoreCartridge(damage, cartTypeName))
287 return true;
288 }
289 }
290
291 return false;
292 }
Super root of all classes in Enforce script.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.