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

◆ OnPlacementComplete() [4/4]

override void ItemBase::OnPlacementComplete ( Man player,
vector position = "0 0 0",
vector orientation = "0 0 0" )
inlineprotected

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

773 {
774 super.OnPlacementComplete(player, position, orientation);
775
776 if (GetGame().IsServer())
777 {
778 vector rotation_matrix[3];
779 float direction[4];
780 Math3D.YawPitchRollMatrix(orientation, rotation_matrix);
781 Math3D.MatrixToQuat(rotation_matrix, direction);
782 InventoryLocation source = new InventoryLocation;
783 InventoryLocation destination = new InventoryLocation;
784
785 if (GetInventory().GetCurrentInventoryLocation(source))
786 {
787 destination.SetGroundEx(this, position, direction);
788 if (GetGame().IsMultiplayer())
789 {
790 player.ServerTakeToDst(source, destination);
791 SetupTrapPlayer(PlayerBase.Cast(player), false);
792 }
793 else // singleplayer
794 {
795 PlayerBase.Cast(player).GetDayZPlayerInventory().RedirectToHandEvent(InventoryMode.LOCAL, source, destination);
796 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(SetupTrapPlayer, 100, false, PlayerBase.Cast(player), false);
797 }
798 }
799
802 SetActive();
803 }
804 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Определения Inventory.c:22
override ScriptCallQueue GetCallQueue(int call_category)
Определения DayZGame.c:1187
proto native void SetGroundEx(EntityAI e, vector pos, float dir[4])
sets current inventory location type to Ground with transformation mat
void InitCatchingComponent()
void SetupTrapPlayer(PlayerBase player, bool set_position=true)
Определения TrapSpawnBase.c:225
void UpdateTrapEnviroMask()
Определения TrapSpawnBase.c:732
void SetActive()
Определения TrapSpawnBase.c:328
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto native CGame GetGame()
const int CALL_CATEGORY_SYSTEM
Определения tools.c:8

Перекрестные ссылки CALL_CATEGORY_SYSTEM, ScriptCallQueue::CallLater(), CGame::GetCallQueue(), GetGame(), TrapSpawnBase::InitCatchingComponent(), Math3D::MatrixToQuat(), SetActive(), InventoryLocation::SetGroundEx(), SetupTrapPlayer(), SetupTrapPlayer(), UpdateTrapEnviroMask() и Math3D::YawPitchRollMatrix().