From fb2149115c68b1449e22366f7317797c9b32e11e Mon Sep 17 00:00:00 2001 From: btd Date: Wed, 1 Sep 2010 13:50:42 +0400 Subject: [PATCH] Fix EvalTick in CDoor --- src/game/server/entities/door.cpp | 8 +++----- src/game/server/entities/door.h | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/game/server/entities/door.cpp b/src/game/server/entities/door.cpp index 1df90b81f..dee317403 100644 --- a/src/game/server/entities/door.cpp +++ b/src/game/server/entities/door.cpp @@ -22,8 +22,8 @@ CDoor::CDoor(CGameWorld *pGameWorld, vec2 Pos, float Rotation, int Length, bool void CDoor::Open(int Tick, bool ActivatedTeam[]) { - m_EvalTick = Tick; for (int i = 0; i < MAX_CLIENTS; ++i) { + m_EvalTick[i] = Tick; m_Opened[i] = ActivatedTeam[i]; } } @@ -60,11 +60,9 @@ void CDoor::Tick() for (int i = 0; i < MAX_CLIENTS; ++i) { if(!m_Opened[i]) { HitCharacter(i); - } + } else if (m_EvalTick[i] + 10 < Server()->Tick()) + Close(); } - if (m_EvalTick + 10 < Server()->Tick()) - Close(); - return; } void CDoor::Snap(int SnappingClient) diff --git a/src/game/server/entities/door.h b/src/game/server/entities/door.h index 938936f67..6626cd40b 100644 --- a/src/game/server/entities/door.h +++ b/src/game/server/entities/door.h @@ -8,7 +8,7 @@ class CTrigger; class CDoor : public CEntity { vec2 m_To; - int m_EvalTick; + int m_EvalTick[MAX_CLIENTS]; bool m_Opened[MAX_CLIENTS]; bool HitCharacter(int Team);