mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 07:23:54 +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
|
void SafePtr::update() const
|
||||||
{
|
{
|
||||||
const PtrRegistry& registry = MWBase::Environment::get().getWorldModel()->getPtrRegistry();
|
const PtrRegistry& registry = MWBase::Environment::get().getWorldModel()->getPtrRegistry();
|
||||||
if (mLastUpdate < registry.getRevision())
|
if (mLastUpdate != registry.getRevision())
|
||||||
{
|
{
|
||||||
mPtr = registry.getOrDefault(mId);
|
mPtr = registry.getOrDefault(mId);
|
||||||
mLastUpdate = registry.getRevision();
|
mLastUpdate = registry.getRevision();
|
||||||
|
|
Loading…
Reference in a new issue