DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ SpawnEntityOnGroundPos() [2/2]

EntityAI PluginBase::SpawnEntityOnGroundPos ( PlayerBase player,
string object_name,
vector pos )
inlineprotected

См. определение в файле PluginDeveloper.c строка 478

479 {
480 if (player)
481 {
482 return player.SpawnEntityOnGroundPos(object_name, pos);
483 }
484
485 bool is_AI = g_Game.IsKindOf(object_name, "DZ_LightAI");
486 if (is_AI)
487 {
488 return SpawnAI(object_name, pos);
489 }
490 else
491 {
492 InventoryLocation inv_loc = new InventoryLocation;
493 vector mtx[4];
494 Math3D.MatrixIdentity4(mtx);
495 mtx[3] = pos;
496 inv_loc.SetGround(null, mtx);
497
498 int flags = ECE_PLACE_ON_SURFACE;
499 #ifdef DEVELOPER
500 if (g_Game.IsKindOf(object_name, "Boat"))
501 flags = ECE_KEEPHEIGHT;
502 #endif
503
504 return EntityAI.Cast(g_Game.CreateObjectEx(object_name, inv_loc.GetPos(), flags));
505 }
506
507 return null;
508 }
class LogManager EntityAI
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:38
const int ECE_KEEPHEIGHT
Определения CentralEconomy.c:28
DayZGame g_Game
Определения DayZGame.c:4074
proto native vector GetPos()
returns position of item in world if type is Ground
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
EntityAI SpawnAI(string object_name, vector pos)
Определения PluginDeveloper.c:449

Перекрестные ссылки ECE_KEEPHEIGHT, ECE_PLACE_ON_SURFACE, g_Game, InventoryLocation::GetPos(), Math3D::MatrixIdentity4(), InventoryLocation::SetGround() и SpawnAI().

Используется в OnRPCSpawnEntityOnGround(), SpawnEntityInPlayerInventory(), SpawnEntityOnGroundPatternGrid(), SpawnEntityOnGroundPos() и SpawnItemOnCrosshair().