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

◆ CanReceiveAttachment() [3/3]

override bool BaseBuildingBase::CanReceiveAttachment ( EntityAI attachment,
int slotId )
inlineprivate

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

96 {
97 if ( !super.CanReceiveAttachment( attachment, slotId ) )
98 return false;
99
100 //because CanReceiveAttachment() method can be called on all clients in the vicinity, vertical distance check needs to be skipped on clients that don't
101 //interact with the object through attach action (AT_ATTACH_TO_CONSTRUCTION)
102 PlayerBase player;
103 if ( !g_Game.IsDedicatedServer() )
104 {
105 //check action initiator (AT_ATTACH_TO_CONSTRUCTION)
106 player = PlayerBase.Cast( g_Game.GetPlayer() );
107 if ( player )
108 {
109 ConstructionActionData construction_action_data = player.GetConstructionActionData();
110 PlayerBase action_initiator = construction_action_data.GetActionInitiator();
111
112 if ( action_initiator == player )
113 {
114 construction_action_data.SetActionInitiator( NULL ); //reset action initiator
115 }
116 else
117 {
118 player = null; //do not do vertical check (next)
119 }
120 }
121 }
122 //
123
124 return CheckSlotVerticalDistance( slotId, player );
125 }
DayZGame g_Game
Определения DayZGame.c:4074
override bool CheckSlotVerticalDistance(int slot_id, PlayerBase player)
Определения Watchtower.c:300
PlayerBase GetActionInitiator()
Определения ConstructionActionData.c:136
void SetActionInitiator(PlayerBase action_initiator)
Определения ConstructionActionData.c:131

Перекрестные ссылки CheckSlotVerticalDistance(), g_Game, ConstructionActionData::GetActionInitiator() и ConstructionActionData::SetActionInitiator().