Fixed the /cmd crash Fixes #76

deleted the chat console on destruction
This commit is contained in:
GreYFoX 2011-08-31 02:28:43 +02:00
parent cfde5a20ec
commit f2e34075b8
2 changed files with 7 additions and 5 deletions

View file

@ -362,12 +362,12 @@ int CCollision::IsThrough(int x, int y)
int CCollision::IsNoLaser(int x, int y)
{
return (CCollision::GetTile(x,y) & COLFLAG_NOLASER);
return (CCollision::GetTile(x,y) & COLFLAG_NOLASER);
}
int CCollision::IsFNoLaser(int x, int y)
{
return (CCollision::GetFTile(x,y) & COLFLAG_NOLASER);
return (CCollision::GetFTile(x,y) & COLFLAG_NOLASER);
}
int CCollision::IsTeleport(int Index)

View file

@ -49,8 +49,11 @@ void CGameContext::Construct(int Resetting)
m_pVoteOptionHeap = new CHeap();
m_pScore = 0;
m_NumMutes = 0;
m_pChatCommands = CreateConsole(CFGFLAG_CHAT);
}
m_pChatCommands = CreateConsole(CFGFLAG_CHAT);
#define CHAT_COMMAND(name, params, flags, callback, userdata, help) m_pChatCommands->Register(name, params, flags, callback, userdata, help);
#include "ddracechat.h"
}
CGameContext::CGameContext(int Resetting)
@ -69,6 +72,7 @@ CGameContext::~CGameContext()
delete m_apPlayers[i];
if(!m_Resetting)
delete m_pVoteOptionHeap;
delete m_pChatCommands;
}
void CGameContext::Clear()
@ -1660,8 +1664,6 @@ void CGameContext::OnConsoleInit()
#define CONSOLE_COMMAND(name, params, flags, callback, userdata, help) m_pConsole->Register(name, params, flags, callback, userdata, help);
#include "game/ddracecommands.h"
#define CHAT_COMMAND(name, params, flags, callback, userdata, help) m_pChatCommands->Register(name, params, flags, callback, userdata, help);
#include "ddracechat.h"
}
void CGameContext::OnInit(/*class IKernel *pKernel*/)