460 {
461
463 {
464
465 EntityAI entity = player.SpawnEntityOnGroundOnCursorDir(item_name, distance);
466
467 if ( entity )
468 {
469 if ( !entity.
IsBuilding() && health < 0 && entity.GetMaxHealth() > 0)
470 {
471 health = entity.GetMaxHealth();
472 }
474 }
475 else
477
478 InventoryItem item;
479 if (Class.CastTo(item, entity) && withPhysics)
480 item.ThrowPhysically(null, "0 0 0");
481
482 return entity;
483 }
484 else
485 {
486
487 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);
488 player.RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_ON_CURSOR, params,
true);
489 }
490 return NULL;
491 }
override bool IsBuilding()
void OnSpawnErrorReport(string name)
void SetupSpawnedEntity(PlayerBase player, EntityAI entity, float health, float quantity=-1, bool special=false, string presetName="")
proto native CGame GetGame()