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

@@ -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);