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

◆ SendLiftWeaponSync()

void ManBase::SendLiftWeaponSync ( bool state,
float obstruct = 0 )
inlineprotected

Client-side only.

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

8174 {
8176
8177 bool liftChange = m_LiftWeapon_player != state;
8178 bool obstructChange = Math.AbsFloat(m_ObstructWeapon_player-obstruct) > 0.03;
8179
8180 // Apply state immediately
8181 m_LiftWeapon_player = state;
8182 m_ObstructWeapon_player = obstruct;
8183
8184 if (liftChange)
8185 {
8187 }
8188
8189 if (!liftChange && !obstructChange)
8190 {
8191 // insignificant difference
8192 return;
8193 }
8194
8195 // Notify server to apply same state
8196 if (GetGame().IsMultiplayer() && GetGame().IsClient())
8197 {
8198 ScriptInputUserData ctx = new ScriptInputUserData;
8199 if (!ctx.CanStoreInputUserData())
8200 {
8201 // ctx not available??
8202 return;
8203 }
8204
8206 ctx.Write(state);
8207 ctx.Write(obstruct);
8208 ctx.Send();
8209 }
8210 }
const int INPUT_UDT_WEAPON_LIFT_EVENT
override WeaponManager GetWeaponManager()
Определения PlayerBase.c:1859
proto native void Send()
proto static native bool CanStoreInputUserData()
Returns true when the channel is free, AND the InputBuffer is NOT full (same as '!...
proto bool Write(void value_out)
void OnLiftWeapon()
Определения WeaponManager.c:1325
proto native CGame GetGame()
void HumanCommandWeapons()
Определения human.c:1126

Перекрестные ссылки Math::AbsFloat(), ScriptInputUserData::CanStoreInputUserData(), GetGame(), GetWeaponManager(), INPUT_UDT_WEAPON_LIFT_EVENT, ScriptInputUserData::Send() и Serializer::Write().

Используется в CheckLiftWeapon().