Core/Character: Fix logic fail with world state in b2928e59fa

This commit is contained in:
Vincent_Michael
2012-12-18 14:13:09 +01:00
parent 5d77b10c35
commit bb93eb0f7e
3 changed files with 8 additions and 3 deletions

View File

@@ -0,0 +1,4 @@
DELETE FROM `worldstates` WHERE `entry` IN (20004,20007);
INSERT INTO `worldstates` (`entry`, `value`, `comment`) VALUES
(20004,0,'CleaningFlags'),
(20007,0,'NextMonthlyQuestResetTime');

View File

@@ -35,7 +35,7 @@ void CharacterDatabaseCleaner::CleanDatabase()
uint32 oldMSTime = getMSTime();
// check flags which clean ups are necessary
QueryResult result = CharacterDatabase.Query("SELECT value FROM worldstates WHERE entry = 20004");
QueryResult result = CharacterDatabase.PQuery("SELECT value FROM worldstates WHERE entry = %u", WS_CLEANING_FLAGS);
if (!result)
return;
@@ -60,7 +60,7 @@ void CharacterDatabaseCleaner::CleanDatabase()
// NOTE: In order to have persistentFlags be set in worldstates for the next cleanup,
// you need to define them at least once in worldstates.
flags &= sWorld->getIntConfig(CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS);
CharacterDatabase.DirectPExecute("UPDATE worldstates SET value = %u WHERE entry = 20004", flags);
CharacterDatabase.DirectPExecute("UPDATE worldstates SET value = %u WHERE entry = %u", flags, WS_CLEANING_FLAGS);
sWorld->SetCleaningFlags(flags);

View File

@@ -471,8 +471,9 @@ enum WorldStates
{
WS_WEEKLY_QUEST_RESET_TIME = 20002, // Next weekly reset time
WS_BG_DAILY_RESET_TIME = 20003, // Next daily BG reset time
WS_MONTHLY_QUEST_RESET_TIME = 20004, // Next monthly reset time
WS_CLEANING_FLAGS = 20004, // Cleaning Flags
WS_GUILD_DAILY_RESET_TIME = 20006, // Next guild cap reset time
WS_MONTHLY_QUEST_RESET_TIME = 20007, // Next monthly reset time
};
/// Storage class for commands issued for delayed execution