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

◆ CanReceiveAttachment() [3/3]

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

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

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

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