void cObjectTypeScript::Update() { if (IsRun()) { if (m_pParser->SkipTo("start")) { m_strToken=m_pParser->GetToken(); if (m_strToken=="index") { m_unObjectTypeIndex = m_pParser->GetInteger(); } } while (!m_pParser->IsFeof()) { if (m_pParser->SkipTo("type")) { m_strToken=m_pParser->GetToken(); g_pGameManager->RegisterObjectType(m_strToken, m_unObjectTypeIndex++); } } StopScript(); } }
void clsScriptManager::DeleteScript(const uint8_t &ui8ScriptPosInTbl) { Script * cur = ppScriptTable[ui8ScriptPosInTbl]; if(cur->pLUA != NULL) { StopScript(cur, false); } if(FileExist((clsServerManager::sScriptPath+string(cur->sName)).c_str()) == true) { #ifdef _WIN32 DeleteFile((clsServerManager::sScriptPath+string(cur->sName)).c_str()); #else unlink((clsServerManager::sScriptPath+string(cur->sName)).c_str()); #endif } delete cur; for(uint8_t ui8i = ui8ScriptPosInTbl; ui8i+1 < ui8ScriptCount; ui8i++) { ppScriptTable[ui8i] = ppScriptTable[ui8i+1]; } ppScriptTable[ui8ScriptCount-1] = NULL; ui8ScriptCount--; }
bool8 ScrCmd_die(struct ScriptContext *ctx) { ClearRamScript(); StopScript(ctx); return TRUE; }
bool8 ScrCmd_end(struct ScriptContext *ctx) { StopScript(ctx); return FALSE; }