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

This commit is contained in:
ariel- authored and Aokromes committed 2016-08-18 09:47:42 +02:00
1 parent 90b22c6cd4
commit 9d1fc3e94d
1 file changed
+3
+3
View File
@@ -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));