Fix EvalTick in CDoor

This commit is contained in:
btd 2010-09-01 13:50:42 +04:00
parent 4eadf3029b
commit fb2149115c
2 changed files with 4 additions and 6 deletions

View file

@ -22,8 +22,8 @@ CDoor::CDoor(CGameWorld *pGameWorld, vec2 Pos, float Rotation, int Length, bool
void CDoor::Open(int Tick, bool ActivatedTeam[]) void CDoor::Open(int Tick, bool ActivatedTeam[])
{ {
m_EvalTick = Tick;
for (int i = 0; i < MAX_CLIENTS; ++i) { for (int i = 0; i < MAX_CLIENTS; ++i) {
m_EvalTick[i] = Tick;
m_Opened[i] = ActivatedTeam[i]; m_Opened[i] = ActivatedTeam[i];
} }
} }
@ -60,11 +60,9 @@ void CDoor::Tick()
for (int i = 0; i < MAX_CLIENTS; ++i) { for (int i = 0; i < MAX_CLIENTS; ++i) {
if(!m_Opened[i]) { if(!m_Opened[i]) {
HitCharacter(i); HitCharacter(i);
} } else if (m_EvalTick[i] + 10 < Server()->Tick())
}
if (m_EvalTick + 10 < Server()->Tick())
Close(); Close();
return; }
} }
void CDoor::Snap(int SnappingClient) void CDoor::Snap(int SnappingClient)

View file

@ -8,7 +8,7 @@ class CTrigger;
class CDoor : public CEntity class CDoor : public CEntity
{ {
vec2 m_To; vec2 m_To;
int m_EvalTick; int m_EvalTick[MAX_CLIENTS];
bool m_Opened[MAX_CLIENTS]; bool m_Opened[MAX_CLIENTS];
bool HitCharacter(int Team); bool HitCharacter(int Team);