mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
Core/World: short circuit setWorldState and avoid a db query in case there's nothing to update really
This commit is contained in:
@@ -3321,6 +3321,9 @@ void World::setWorldState(uint32 index, uint64 value)
|
||||
WorldStatesMap::const_iterator it = m_worldstates.find(index);
|
||||
if (it != m_worldstates.end())
|
||||
{
|
||||
if (it->second == value)
|
||||
return;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_WORLDSTATE);
|
||||
|
||||
stmt->setUInt32(0, uint32(value));
|
||||
|
||||
Reference in New Issue
Block a user