void TInifile::UnInit() { for (TIniSection *sec; (sec = (TIniSection *)TopObj()); ) { DelObj(sec); delete sec; } root_sec = NULL; }
void TBrList::Reset() { TBrObj *obj; while ((obj = Top())) { DelObj(obj); delete obj; } }
BOOL TInifile::DelSection(const char *section) { TIniSection *sec = SearchSection(section); if (!sec) return FALSE; DelObj(sec); delete sec; if (sec == cur_sec) cur_sec = NULL; return TRUE; }
void TInifile::SetSection(const char *section) { if (cur_sec && cur_sec != root_sec && !cur_sec->TopObj()) { DelObj(cur_sec); delete cur_sec; } if ((cur_sec = SearchSection(section)) == NULL) { cur_sec = new TIniSection(); cur_sec->Set(section); AddObj(cur_sec); } }
void TInifile::UnInit() { for (TIniSection *sec; (sec = TopObj()); ) { DelObj(sec); delete sec; } rootSec = curSec = NULL; free(iniFile); iniFile = NULL; if (hMutex) ::CloseHandle(hMutex); hMutex = NULL; }
bool CItemSpawn::r_LoadVal(CScript & s) { ADDTOCALLSTACK("CitemSpawn:r_LoadVal"); EXC_TRY("LoadVal"); if (g_Serv.IsLoading()) { if (!strnicmp(s.GetKey(), "more2", 5)) //More2 shouldn't be loaded as it's being set with ADDOBJ return true; } int iCmd = FindTableSorted(s.GetKey(), sm_szLoadKeys, COUNTOF(sm_szLoadKeys) - 1); if (iCmd < 0) return CItem::r_LoadVal(s); switch (iCmd) { case ISPW_ADDOBJ: { CGrayUID uid = static_cast<CGrayUID>(s.GetArgVal()); if ( uid.ObjFind() ) AddObj(uid); return true; } case ISPW_DELOBJ: { CGrayUID uid = static_cast<CGrayUID>(s.GetArgVal()); if (uid.ObjFind()) DelObj(uid); return true; } case ISPW_RESET: KillChildren(); return true; case ISPW_START: SetTimeout(0); return true; case ISPW_STOP: KillChildren(); SetTimeout(-1); return true; default: break; } EXC_CATCH; return false; }
bool CItemSpawn::r_LoadVal(CScript & s) { ADDTOCALLSTACK("CitemSpawn:r_LoadVal"); EXC_TRY("LoadVal"); int iCmd = FindTableSorted(s.GetKey(), sm_szLoadKeys, COUNTOF(sm_szLoadKeys) - 1); if ( iCmd < 0 ) return CItem::r_LoadVal(s); switch ( iCmd ) { case ISPW_ADDOBJ: { AddObj(static_cast<CGrayUID>(s.GetArgVal())); return true; } case ISPW_AMOUNT: { SetAmount(static_cast<BYTE>(s.GetArgVal())); return true; } case ISPW_DELOBJ: { DelObj(static_cast<CGrayUID>(s.GetArgVal())); return true; } case ISPW_RESET: KillChildren(); return true; case ISPW_START: SetTimeout(0); return true; case ISPW_STOP: KillChildren(); SetTimeout(-1); return true; default: break; } EXC_CATCH; return false; }