diff options
Diffstat (limited to 'src/game/server/entity.cpp')
| -rw-r--r-- | src/game/server/entity.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/game/server/entity.cpp b/src/game/server/entity.cpp index 788c3f45..e1985877 100644 --- a/src/game/server/entity.cpp +++ b/src/game/server/entity.cpp @@ -54,3 +54,12 @@ bool CEntity::GameLayerClipped(vec2 CheckPos) return round(CheckPos.x)/32 < -200 || round(CheckPos.x)/32 > GameServer()->Collision()->GetWidth()+200 || round(CheckPos.y)/32 < -200 || round(CheckPos.y)/32 > GameServer()->Collision()->GetHeight()+200 ? true : false; } + +void CEntity::SetCharactersNearby() +{ + CCharacter *c; + for(int i = 0; i < MAX_CLIENTS; ++i) + if((c = GameServer()->GetPlayerChar(i))) + m_CharactersNearby[i] = (absolute(c->m_Pos.x - m_Pos.x) <= 9000.0f && absolute(c->m_Pos.y - m_Pos.y) <= 700.0f && distance(c->m_Pos, m_Pos) <= 900.0f); + m_CharactersNearbyInitialized = true; +} |