mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 17:49:10 +00:00
fix(Core/Unit): Invalidate update object cache when changing health in the same world update tick. (#19287)
* fix(Core/Unit): Invalidate update object cache when changing health in the same world update tick. Should fix an issue when the client sees dead NPCs when they are not. * Fix styling * Another codestyle fix
This commit is contained in:
committed by
GitHub
parent
9453bfbad2
commit
04acfd96a0
@@ -21628,6 +21628,20 @@ bool Unit::IsInDisallowedMountForm() const
|
||||
return false;
|
||||
}
|
||||
|
||||
void Unit::SetUInt32Value(uint16 index, uint32 value)
|
||||
{
|
||||
Object::SetUInt32Value(index, value);
|
||||
|
||||
switch (index)
|
||||
{
|
||||
// Invalidating the cache on health change should fix an issue where the client sees dead NPCs when they are not.
|
||||
// We might also need to invalidate the cache for some other fields as well.
|
||||
case UNIT_FIELD_HEALTH:
|
||||
InvalidateValuesUpdateCache();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
std::string Unit::GetDebugInfo() const
|
||||
{
|
||||
std::stringstream sstr;
|
||||
|
||||
Reference in New Issue
Block a user