Check for revision inequality

It's not possible to have SafePtr with mLastUpdate from the future. But
theoretically it's possible to get PtrRegistry::mRevision overflow so operator
less would return false when there is a change.
macos_ci
elsid 2 years ago
parent ce91784085
commit a581e394b4
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -40,7 +40,7 @@ namespace MWWorld
void SafePtr::update() const
{
const PtrRegistry& registry = MWBase::Environment::get().getWorldModel()->getPtrRegistry();
if (mLastUpdate < registry.getRevision())
if (mLastUpdate != registry.getRevision())
{
mPtr = registry.getOrDefault(mId);
mLastUpdate = registry.getRevision();

Loading…
Cancel
Save