283 {
284 PlayerBase player;
286 if (Class.CastTo(player,parent))
287 {
288 if (Class.CastTo(newItem,player.GetInventory().CreateInInventory(type)))
289 return newItem;
290
291 Debug.Log(
"FAILED spawning item: " + type +
", it fits in no cargo or attachment on any worn item",
"n/a",
"n/a",
"CreateChildItem");
292 return null;
293 }
294
295
297 {
298 Weapon_Base wep
299 if (Class.CastTo(wep,parent) && wep.SpawnAmmo(type) && !wep.HasInternalMagazine(-1))
300 {
301 Magazine mag;
302 int muzzleCount = wep.GetMuzzleCount();
303 for (int i = 0; i < muzzleCount; i++)
304 {
305 if (Class.CastTo(mag,wep.GetMagazine(i)) && mag.GetType() == type)
306 return mag;
307 }
308 }
309
310 return null;
311 }
312
313 return parent.GetInventory().CreateInInventory(type);
314 }
class GP5GasMask extends MaskBase ItemBase
proto native CGame GetGame()