diff --git a/src/game/gamecore.cpp b/src/game/gamecore.cpp index df1d27c48..6ca91b940 100644 --- a/src/game/gamecore.cpp +++ b/src/game/gamecore.cpp @@ -68,7 +68,7 @@ void CCharacterCore::Init(CWorldCore *pWorld, CCollision *pCollision, CTeamsCore m_Collision = true; } -void CCharacterCore::Init(CWorldCore *pWorld, CCollision *pCollision, CTeamsCore* pTeams, std::map > pTeleOuts) +void CCharacterCore::Init(CWorldCore *pWorld, CCollision *pCollision, CTeamsCore* pTeams, std::map > *pTeleOuts) { m_pWorld = pWorld; m_pCollision = pCollision; @@ -312,14 +312,14 @@ void CCharacterCore::Tick(bool UseInput) m_HookState = HOOK_RETRACT_START; } - if(GoingThroughTele && m_pTeleOuts[teleNr-1].size()) + if(GoingThroughTele && (*m_pTeleOuts)[teleNr-1].size()) { m_TriggeredEvents = 0; m_HookedPlayer = -1; m_NewHook = true; - int Num = m_pTeleOuts[teleNr-1].size(); - m_HookPos = m_pTeleOuts[teleNr-1][(!Num)?Num:rand() % Num]+TargetDirection*PhysSize*1.5f; + int Num = (*m_pTeleOuts)[teleNr-1].size(); + m_HookPos = (*m_pTeleOuts)[teleNr-1][(!Num)?Num:rand() % Num]+TargetDirection*PhysSize*1.5f; m_HookDir = TargetDirection; m_HookTeleBase = m_HookPos; } diff --git a/src/game/gamecore.h b/src/game/gamecore.h index c22a83a5b..172a9b05f 100644 --- a/src/game/gamecore.h +++ b/src/game/gamecore.h @@ -183,7 +183,7 @@ class CCharacterCore { CWorldCore *m_pWorld; CCollision *m_pCollision; - std::map > m_pTeleOuts; + std::map > *m_pTeleOuts; public: vec2 m_Pos; vec2 m_Vel; @@ -210,7 +210,7 @@ public: int m_TriggeredEvents; void Init(CWorldCore *pWorld, CCollision *pCollision, CTeamsCore* pTeams); - void Init(CWorldCore *pWorld, CCollision *pCollision, CTeamsCore* pTeams, std::map > pTeleOuts); + void Init(CWorldCore *pWorld, CCollision *pCollision, CTeamsCore* pTeams, std::map > *pTeleOuts); void Reset(); void Tick(bool UseInput); void Move(); diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index 03ce1d3f0..de71cfea3 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -71,7 +71,7 @@ bool CCharacter::Spawn(CPlayer *pPlayer, vec2 Pos) m_Pos = Pos; m_Core.Reset(); - m_Core.Init(&GameServer()->m_World.m_Core, GameServer()->Collision(), &((CGameControllerDDRace*)GameServer()->m_pController)->m_Teams.m_Core, ((CGameControllerDDRace*)GameServer()->m_pController)->m_TeleOuts); + m_Core.Init(&GameServer()->m_World.m_Core, GameServer()->Collision(), &((CGameControllerDDRace*)GameServer()->m_pController)->m_Teams.m_Core, &((CGameControllerDDRace*)GameServer()->m_pController)->m_TeleOuts); m_Core.m_Pos = m_Pos; GameServer()->m_World.m_Core.m_apCharacters[m_pPlayer->GetCID()] = &m_Core; @@ -663,7 +663,7 @@ void CCharacter::TickDefered() // advance the dummy { CWorldCore TempWorld; - m_ReckoningCore.Init(&TempWorld, GameServer()->Collision(), &((CGameControllerDDRace*)GameServer()->m_pController)->m_Teams.m_Core, ((CGameControllerDDRace*)GameServer()->m_pController)->m_TeleOuts); + m_ReckoningCore.Init(&TempWorld, GameServer()->Collision(), &((CGameControllerDDRace*)GameServer()->m_pController)->m_Teams.m_Core, &((CGameControllerDDRace*)GameServer()->m_pController)->m_TeleOuts); m_ReckoningCore.m_Id = m_pPlayer->GetCID(); m_ReckoningCore.Tick(false); m_ReckoningCore.Move();