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

◆ SendLiftWeaponSync()

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

Client-side only.

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

8424 {
8426
8427 bool liftChange = m_LiftWeapon_player != state;
8428 bool obstructChange = Math.AbsFloat(m_ObstructWeapon_player-obstruct) > 0.03;
8429
8430 // Apply state immediately
8431 m_LiftWeapon_player = state;
8432 m_ObstructWeapon_player = obstruct;
8433
8434 if (liftChange)
8435 {
8437 }
8438
8439 if (!liftChange && !obstructChange)
8440 {
8441 // insignificant difference
8442 return;
8443 }
8444
8445 // Notify server to apply same state
8446 if (g_Game.IsMultiplayer() && g_Game.IsClient())
8447 {
8448 ScriptInputUserData ctx = new ScriptInputUserData;
8449 if (!ctx.CanStoreInputUserData())
8450 {
8451 // ctx not available??
8452 return;
8453 }
8454
8456 ctx.Write(state);
8457 ctx.Write(obstruct);
8458 ctx.Send();
8459 }
8460 }
const int INPUT_UDT_WEAPON_LIFT_EVENT
DayZGame g_Game
Определения DayZGame.c:3942
override WeaponManager GetWeaponManager()
Определения PlayerBase.c:1989
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:1128

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

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