コード例 #1
0
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();

	}
}
コード例 #2
0
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--;
}
コード例 #3
0
ファイル: scrcmd.c プロジェクト: pret/pokeruby
bool8 ScrCmd_die(struct ScriptContext *ctx)
{
    ClearRamScript();
    StopScript(ctx);
    return TRUE;
}
コード例 #4
0
ファイル: scrcmd.c プロジェクト: pret/pokeruby
bool8 ScrCmd_end(struct ScriptContext *ctx)
{
    StopScript(ctx);
    return FALSE;
}