2
0
mirror of https://github.com/rehlds/reapi.git synced 2024-12-28 07:35:31 +03:00

Fix SetMoveDone callback dispatcher

This commit is contained in:
s1lentq 2023-09-03 15:26:17 +07:00
parent 2b8ae61f1e
commit eab165880e

View File

@ -145,8 +145,6 @@ bool CEntityCallbackDispatcher::SetMoveDone(AMX *amx, CBaseEntity *pEntity, cons
return false;
}
m_callbacks.push_back(new EntityCallback(amx, pszCallback, fwdid, pEntity, pParams, iParamsLen, MoveDone));
// Make sure that the entity actually inherited from CBaseToggle
CBaseToggle *pEntityToggle = dynamic_cast<CBaseToggle *>(pEntity);
if (!pEntityToggle)
@ -155,6 +153,7 @@ bool CEntityCallbackDispatcher::SetMoveDone(AMX *amx, CBaseEntity *pEntity, cons
return false;
}
m_callbacks.push_back(new EntityCallback(amx, pszCallback, fwdid, pEntity, pParams, iParamsLen, MoveDone));
pEntityToggle->SetMoveDone(&CBaseToggle::SUB_MoveDone);
return true;
}