SpawnEntityInInventory queries future parent about free inventory location of the future item
616 {
617 if (target.IsPlayer())
618 {
620 }
622 {
623 InventoryLocation il = new InventoryLocation;
624 if (target.GetInventory() && target.GetInventory().FindFirstFreeLocationForNewEntity(className,
FindInventoryLocationType.ANY, il))
625 {
627 if ( eai && eai.IsInherited(
ItemBase) )
628 {
629 if ( health < 0 )
630 {
631 health = eai.GetMaxHealth();
632 }
635 if ( special )
636 {
637 auto debugParams = DebugSpawnParams.WithPlayer(null);
638 eai.OnDebugSpawnEx(debugParams);
639 }
640 }
641 return eai;
642 }
643 }
644 else
645 {
647 g_Game.GetPlayer().RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_IN_INVENTORY, params,
true,
g_Game.GetPlayer().GetIdentity());
648 }
649 return null;
650 }
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
void SetupSpawnedItem(ItemBase item, float health, float quantity)
Param7 DevSpawnItemParams
EntityAI SpawnEntityInPlayerInventory(PlayerBase player, string item_name, float health, float quantity, bool special=false, string presetName="", FindInventoryLocationType locationType=FindInventoryLocationType.ANY)