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

◆ SpawnEntityOnGroundPos() [2/2]

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

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

430 {
431 if (player)
432 {
433 return player.SpawnEntityOnGroundPos(object_name, pos);
434 }
435
436 bool is_AI = g_Game.IsKindOf(object_name, "DZ_LightAI");
437 if (is_AI)
438 {
439 return SpawnAI(object_name, pos);
440 }
441 else
442 {
443 InventoryLocation inv_loc = new InventoryLocation;
444 vector mtx[4];
445 Math3D.MatrixIdentity4(mtx);
446 mtx[3] = pos;
447 inv_loc.SetGround(null, mtx);
448
449 int flags = ECE_PLACE_ON_SURFACE;
450 #ifdef DEVELOPER
451 if (g_Game.IsKindOf(object_name, "Boat"))
452 flags = ECE_KEEPHEIGHT;
453 #endif
454
455 return EntityAI.Cast(g_Game.CreateObjectEx(object_name, inv_loc.GetPos(), flags));
456 }
457
458 return null;
459 }
class LogManager EntityAI
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
const int ECE_KEEPHEIGHT
Определения CentralEconomy.c:27
DayZGame g_Game
Определения DayZGame.c:3942
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:400

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

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