Core/World: short circuit setWorldState and avoid a db query in case there's nothing to update really

(cherry picked from commit c7b8f0f773)
This commit is contained in:
ariel-
2016-08-18 01:35:42 -03:00
committed by joschiwald
parent e5ba8f1e4d
commit 804496e2df

View File

@@ -3431,6 +3431,9 @@ void World::setWorldState(uint32 index, uint32 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));