refactor(Core/WorldState): Initial addition of world state definition file. (#21875)

Many world states had their enums from script's header and hardcoded values to their respective header file (WorldStateDefines.h)
Co-authored-by: Jelle Meeus <sogladev@gmail.com>
This commit is contained in:
Benjamin Jackson
2025-04-26 14:31:30 -04:00
committed by GitHub
parent d23e61b721
commit da55f05cfc
73 changed files with 1828 additions and 1789 deletions

View File

@@ -22,6 +22,7 @@
#include "QueryResult.h"
#include "SpellMgr.h"
#include "World.h"
#include "WorldStateDefines.h"
void CharacterDatabaseCleaner::CleanDatabase()
{
@@ -34,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 = {}", WS_CLEANING_FLAGS);
QueryResult result = CharacterDatabase.Query("SELECT value FROM worldstates WHERE entry = {}", WORLD_STATE_CUSTOM_CLEANING_FLAGS);
if (!result)
return;
@@ -59,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.DirectExecute("UPDATE worldstates SET value = {} WHERE entry = {}", flags, WS_CLEANING_FLAGS);
CharacterDatabase.DirectExecute("UPDATE worldstates SET value = {} WHERE entry = {}", flags, WORLD_STATE_CUSTOM_CLEANING_FLAGS);
sWorld->SetCleaningFlags(flags);