mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 14:45:35 +00:00
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.
This commit is contained in:
parent
ce91784085
commit
a581e394b4
1 changed files with 1 additions and 1 deletions
|
@ -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…
Reference in a new issue