573 {
574
576 {
577
578 EntityAI entity = player.SpawnEntityOnGroundOnCursorDir(item_name, distance);
579
580 if ( entity )
581 {
582 if ( !entity.IsBuilding() && health < 0 && entity.GetMaxHealth() > 0)
583 {
584 health = entity.GetMaxHealth();
585 }
587 }
588 else
590
591 InventoryItem item;
592 if (Class.CastTo(item, entity) && withPhysics)
593 item.ThrowPhysically(null, "0 0 0");
594
595 return entity;
596 }
597 else
598 {
599
600 Param7<string, float, float, float, bool, string, bool> params = new Param7<string, float, float, float, bool, string, bool>(item_name, quantity, distance, health, special, presetName, withPhysics);
601 player.RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_ON_CURSOR, params,
true);
602 }
603 return NULL;
604 }
void OnSpawnErrorReport(string name)
void SetupSpawnedEntity(PlayerBase player, EntityAI entity, float health, float quantity=-1, bool special=false, string presetName="")