server/entity: Add CCollision() getter

The main idea is to sync prediction and server CEntity APIs.
This commit is contained in:
Alexander Akulich 2022-05-28 21:18:13 +03:00
parent a023671ecd
commit f934882e51
2 changed files with 5 additions and 0 deletions

View file

@ -11,6 +11,7 @@
CEntity::CEntity(CGameWorld *pGameWorld, int ObjType, vec2 Pos, int ProximityRadius)
{
m_pGameWorld = pGameWorld;
m_pCCollision = GameServer()->Collision();
m_ObjType = ObjType;
m_Pos = Pos;

View file

@ -9,6 +9,8 @@
#include "gamecontext.h"
#include "gameworld.h"
class CCollision;
/*
Class: Entity
Basic entity class.
@ -24,6 +26,7 @@ private:
/* Identity */
class CGameWorld *m_pGameWorld;
CCollision *m_pCCollision;
int m_ID;
int m_ObjType;
@ -59,6 +62,7 @@ public: // TODO: Maybe make protected
class CConfig *Config() { return m_pGameWorld->Config(); }
class CGameContext *GameServer() { return m_pGameWorld->GameServer(); }
class IServer *Server() { return m_pGameWorld->Server(); }
CCollision *Collision() { return m_pCCollision; }
/* Getters */
CEntity *TypeNext() { return m_pNextTypeEntity; }