mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 06:15:37 +03:00
fixed bug at29654
This commit is contained in:
parent
b6007e8223
commit
00fd007e7a
@ -34,16 +34,6 @@
|
||||
|
||||
/*********************** CTask ***********************/
|
||||
|
||||
int CTaskMngr::CTask::getTaskId() const
|
||||
{
|
||||
return m_iId;
|
||||
}
|
||||
|
||||
CPluginMngr::CPlugin *CTaskMngr::CTask::getPlugin() const
|
||||
{
|
||||
return m_pPlugin;
|
||||
}
|
||||
|
||||
void CTaskMngr::CTask::set(CPluginMngr::CPlugin *pPlugin, int iFunc, int iFlags, cell iId, float fBase, int iParamsLen, const cell *pParams, int iRepeat, float fCurrentTime)
|
||||
{
|
||||
clear();
|
||||
@ -53,6 +43,7 @@ void CTaskMngr::CTask::set(CPluginMngr::CPlugin *pPlugin, int iFunc, int iFlags,
|
||||
m_iFunc = iFunc;
|
||||
m_iId = iId;
|
||||
m_fBase = fBase;
|
||||
m_bInExecute = false;
|
||||
|
||||
if (iFlags & 2)
|
||||
{
|
||||
@ -150,6 +141,7 @@ void CTaskMngr::CTask::executeIfRequired(float fCurrentTime, float fTimeLimit, f
|
||||
//only bother calling if we have something to call
|
||||
if (!(m_bLoop && !m_iRepeat))
|
||||
{
|
||||
m_bInExecute = true;
|
||||
if (m_iParamLen) // call with parameters
|
||||
{
|
||||
cell arr = prepareCellArray(m_pParams, m_iParamLen);
|
||||
@ -157,6 +149,7 @@ void CTaskMngr::CTask::executeIfRequired(float fCurrentTime, float fTimeLimit, f
|
||||
} else {
|
||||
executeForwards(m_iFunc, m_iId);
|
||||
}
|
||||
m_bInExecute = false;
|
||||
}
|
||||
|
||||
if (isFree())
|
||||
@ -193,6 +186,7 @@ CTaskMngr::CTask::CTask()
|
||||
m_bLoop = false;
|
||||
m_bAfterStart = false;
|
||||
m_bBeforeEnd = false;
|
||||
m_bInExecute = false;
|
||||
|
||||
m_fNextExecTime = 0.0f;
|
||||
|
||||
|
@ -45,6 +45,7 @@ private:
|
||||
int m_iFunc;
|
||||
int m_iRepeat;
|
||||
|
||||
bool m_bInExecute;
|
||||
bool m_bLoop;
|
||||
bool m_bAfterStart;
|
||||
bool m_bBeforeEnd;
|
||||
@ -61,13 +62,15 @@ private:
|
||||
void clear();
|
||||
bool isFree() const;
|
||||
|
||||
CPluginMngr::CPlugin *getPlugin() const;
|
||||
int getTaskId() const;
|
||||
inline CPluginMngr::CPlugin *getPlugin() const { return m_pPlugin; }
|
||||
inline AMX *getAMX() const { return m_pPlugin->getAMX(); }
|
||||
inline int getTaskId() const { return m_iId; }
|
||||
|
||||
void executeIfRequired(float fCurrentTime, float fTimeLimit, float fTimeLeft); // also removes the task if needed
|
||||
|
||||
void changeBase(float fNewBase);
|
||||
void resetNextExecTime(float fCurrentTime);
|
||||
inline bool inExecute() const { return m_bInExecute; }
|
||||
|
||||
bool shouldRepeat();
|
||||
|
||||
@ -92,9 +95,11 @@ private:
|
||||
friend bool operator == (const CTask &left, const CTaskDescriptor &right)
|
||||
{
|
||||
if (right.m_bFree)
|
||||
return left.isFree();
|
||||
return (left.isFree() && !left.inExecute());
|
||||
|
||||
return !left.isFree() && (right.m_pAmx ? left.getPlugin()->getAMX() == right.m_pAmx : true) && left.getTaskId() == right.m_iId;
|
||||
return (!left.isFree()) &&
|
||||
(right.m_pAmx ? left.getAMX() == right.m_pAmx : true) &&
|
||||
(left.getTaskId() == right.m_iId);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user