mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix EvalTick in CDoor
This commit is contained in:
parent
4eadf3029b
commit
fb2149115c
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue