524 {
525
527 {
528
529 EntityAI entity = player.SpawnEntityOnGroundOnCursorDir(item_name, distance);
530
531 if ( entity )
532 {
533 if ( !entity.IsBuilding() && health < 0 && entity.GetMaxHealth() > 0)
534 {
535 health = entity.GetMaxHealth();
536 }
538 }
539 else
541
542 InventoryItem item;
543 if (Class.CastTo(item, entity) && withPhysics)
544 item.ThrowPhysically(null, "0 0 0");
545
546 return entity;
547 }
548 else
549 {
550
551 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);
552 player.RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_ON_CURSOR, params,
true);
553 }
554 return NULL;
555 }
void OnSpawnErrorReport(string name)
void SetupSpawnedEntity(PlayerBase player, EntityAI entity, float health, float quantity=-1, bool special=false, string presetName="")