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