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

◆ OnTick()

override void FliesMdfr::OnTick ( PlayerBase player,
float deltaT )
inlineprivate

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

31 {
32 float dist_sqr = vector.DistanceSq(player.GetPosition(), m_PrevPosition);
33 if( dist_sqr < DISTANCE_SENSITIVITY_SQR)//has the player stayed still since last check
34 {
36 }
37 else
38 {
39 if(m_IdleCount >= IDLE_COUNT_THRESHOLD)//disable the effect
40 {
41 player.m_CorpseState = -PlayerConstants.CORPSE_STATE_DECAYED;
42 player.SetSynchDirty();
43 }
44
45 m_IdleCount = 0;//player moved, reset the count
46 }
47 m_PrevPosition = player.GetPosition();
48
49 if( m_IdleCount == IDLE_COUNT_THRESHOLD)//should we play the effect ?
50 {
51 player.m_CorpseState = PlayerConstants.CORPSE_STATE_DECAYED;
52 player.SetSynchDirty();
53 }
54
55
56 }
const int IDLE_COUNT_THRESHOLD
Определения Flies.c:5
const float DISTANCE_SENSITIVITY_SQR
Определения Flies.c:3
vector m_PrevPosition
Определения Flies.c:6
int m_IdleCount
Определения Flies.c:7

Перекрестные ссылки PlayerConstants::CORPSE_STATE_DECAYED, DISTANCE_SENSITIVITY_SQR, vector::DistanceSq(), IDLE_COUNT_THRESHOLD, m_IdleCount и m_PrevPosition.