mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Character: Fix logic fail with world state in b2928e59fa
This commit is contained in:
@@ -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');
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user