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

◆ SendLiftWeaponSync()

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

Client-side only.

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

8778 {
8780
8781 bool liftChange = m_LiftWeapon_player != state;
8782 bool obstructChange = Math.AbsFloat(m_ObstructWeapon_player-obstruct) > 0.03;
8783
8784 // Apply state immediately
8785 m_LiftWeapon_player = state;
8786 m_ObstructWeapon_player = obstruct;
8787
8788 if (liftChange)
8789 {
8791 }
8792
8793 if (!liftChange && !obstructChange)
8794 {
8795 // insignificant difference
8796 return;
8797 }
8798
8799 // Notify server to apply same state
8800 if (g_Game.IsMultiplayer() && g_Game.IsClient())
8801 {
8802 ScriptInputUserData ctx = new ScriptInputUserData;
8803 if (!ctx.CanStoreInputUserData())
8804 {
8805 // ctx not available??
8806 return;
8807 }
8808
8810 ctx.Write(state);
8811 ctx.Write(obstruct);
8812 ctx.Send();
8813 }
8814 }
const int INPUT_UDT_WEAPON_LIFT_EVENT
DayZGame g_Game
Определения DayZGame.c:4074
override WeaponManager GetWeaponManager()
Определения PlayerBase.c:2047
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:1329
void HumanCommandWeapons()
Определения human.c:1155

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

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