// GameSRC/common/service.h # define ENABLE_DUNGEON_COUNT_FIX // GameSRC/char.cpp void CHARACTER::Destroy() { CloseMyShop(); #ifndef ENABLE_DUNGEON_COUNT_FIX if (m_pkRegen) { if (m_pkDungeon) { // Dungeon regen may not be valid at this point if (m_pkDungeon->IsValidRegen(m_pkRegen, regen_id_)) { --m_pkRegen->count; } } else { // Is this really safe? --m_pkRegen->count; } m_pkRegen = NULL; } if (m_pkDungeon) { SetDungeon(NULL); } #endif #ifdef __PET_SYSTEM__ if (m_petSystem) { m_petSystem->Destroy(); delete m_petSystem; m_petSystem = 0; } #endif // GameSRC/char_battle.cpp if (IsPC()) { m_dwLastDeadTime = get_dword_time(); SetKillerMode(false); GetDesc()->SetPhase(PHASE_DEAD); } else { #ifdef ENABLE_DUNGEON_COUNT_FIX if (m_pkRegen) { if (m_pkDungeon) { // Dungeon regen may not be valid at this point if (m_pkDungeon->IsValidRegen(m_pkRegen, regen_id_)) { --m_pkRegen->count; } } else { // Is this really safe? --m_pkRegen->count; } m_pkRegen = NULL; } if (m_pkDungeon) { SetDungeon(NULL); } #endif if (!IS_SET(m_pointsInstant.instant_flag, INSTANT_FLAG_NO_REWARD)) {