Fix OnPlayerRunCmd crashing with invalid CUserCmd ptr. (#693)

This commit is contained in:
Kyle Sanderson 2017-09-23 23:27:32 -07:00 committed by GitHub
parent 7e898ee530
commit 5d234bb9d6

View File

@ -191,6 +191,11 @@ void CHookManager::PlayerRunCmdHook(int client, bool post)
void CHookManager::PlayerRunCmd(CUserCmd *ucmd, IMoveHelper *moveHelper)
{
if (!ucmd)
{
RETURN_META(MRES_IGNORED);
}
if (m_usercmdsFwd->GetFunctionCount() == 0)
{
RETURN_META(MRES_IGNORED);
@ -254,6 +259,11 @@ void CHookManager::PlayerRunCmd(CUserCmd *ucmd, IMoveHelper *moveHelper)
void CHookManager::PlayerRunCmdPost(CUserCmd *ucmd, IMoveHelper *moveHelper)
{
if (!ucmd)
{
RETURN_META(MRES_IGNORED);
}
if (m_usercmdsPostFwd->GetFunctionCount() == 0)
{
RETURN_META(MRES_IGNORED);