|
class PlayerBaseClient extends PlayerBase |
|
{ |
|
static ScriptedLightBase m_PersonalLight; |
|
static bool m_PersonalLightEnabledOnCurrentServer = false; |
|
static bool m_PersonalLightDisabledByDebug = false; |
|
static bool m_PersonalLightIsSwitchedOn = true; |
|
|
|
|
|
static void CreatePersonalLight() |
|
{ |
|
if (!m_PersonalLight && ( !GetGame().IsServer() || !GetGame().IsMultiplayer() )) |
|
{ |
|
m_PersonalLight = ScriptedLightBase.CreateLight(PersonalLight, "0 0 0"); |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override void OnGameplayDataHandlerSync() |
|
{ |
|
super.OnGameplayDataHandlerSync(); |
|
m_PersonalLightEnabledOnCurrentServer = !CfgGameplayHandler.GetDisablePersonalLight(); |
|
UpdatePersonalLight(); |
|
UpdateHitDirectionValues(); |
|
} |
|
|
|
|
|
|
|
static void SwitchPersonalLight(bool state) |
|
{ |
|
if ( !GetGame().IsServer() || !GetGame().IsMultiplayer() ) |
|
{ |
|
m_PersonalLightIsSwitchedOn = state; |
|
UpdatePersonalLight(); |
|
} |
|
} |
|
|
|
|
|
static void UpdatePersonalLight() |
|
{ |
|
string param; |
|
|
|
CreatePersonalLight(); |
|
|
|
|
|
if ( !GetCLIParam("disablePersonalLight", param) && !m_PersonalLightDisabledByDebug && m_PersonalLightIsSwitchedOn ) |
|
{ |
|
m_PersonalLight.SetEnabled(m_PersonalLightEnabledOnCurrentServer); |
|
} |
|
else |
|
{ |
|
m_PersonalLight.SetEnabled(false); |
|
} |
|
} |
|
|
|
static void UpdateHitDirectionValues() |
|
{ |
|
HitDirectionEffectBase.CheckValues(); |
|
} |
|
} |