Example #1
0
//--------------------------------------------------------------------------------------
//
//
void CEventControl::AddCounterNum( int num, int counterType, int Id )
{
    for( int i = 0; i < MAX_TASK_EVNET; i++ )
    {
        CBaseDataEvent* pBaseDataEvent =  g_pClientLoader->GetEventDataFromId(  m_TaskData[i].EventId );

        if( NULL != pBaseDataEvent )
        {
            if( 0 == GetEventFlag( m_TaskData[i].EventId ) )
            {
                CBaseFunLimitData *pFunData = g_pClientLoader->GetFunLimitDataFromId( pBaseDataEvent->m_SubEvent.m_iLimitId[0] );

                if( pFunData->GetFunId() == counterType && m_TaskData[i].GameCounter[0].CounterId == Id )
                {
                    m_TaskData[i].GameCounter[0].CurCount += num;

                    if( m_TaskData[i].GameCounter[0].CurCount >= m_TaskData[i].GameCounter[0].MaxCount )
                    {
                        m_TaskData[i].GameCounter[0].CurCount = m_TaskData[i].GameCounter[0].MaxCount;
                    }

                }
            }
        }
    }
}
Example #2
0
//------------------------------------------
//
//
bool HandleLimitCheck( int Index  )
{ 
	CBaseFunLimitData *pData = g_pClientLoader->GetFunLimitDataFromId( Index );
	if( NULL == pData )
	{
		return (m_pLimitFunctionArray[0])( NULL );
	}
	int Funid = pData->GetFunId();
	return (m_pLimitFunctionArray[Funid])( pData );
}