Fixed unreliable string pointer in CLogicPlayerProxy::AcceptInput()

This commit is contained in:
Blixibon 2021-04-27 10:55:33 -05:00
parent 0f6fd0a5a4
commit 54c43dd6ce

View File

@ -4734,7 +4734,8 @@ bool CLogicPlayerProxy::AcceptInput( const char *szInputName, CBaseEntity *pActi
{
DevMsg("logic_playerproxy: Player not found!\n");
g_EventQueue.AddEvent("!player", szInputName, Value, 0.01f, pActivator, pCaller);
// Need to allocate the string here in case szInputName is freed before the input fires
g_EventQueue.AddEvent("!player", STRING( AllocPooledString(szInputName) ), Value, 0.01f, pActivator, pCaller);
}
}