mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-22 11:09:40 +00:00
Merge pull request #2961 from akortunov/move
Do not use outdated references when moving objects to new cells
This commit is contained in:
commit
7f936e4cde
8 changed files with 24 additions and 2 deletions
|
@ -19,6 +19,7 @@
|
||||||
Bug #5369: Spawnpoint in the Grazelands doesn't produce oversized creatures
|
Bug #5369: Spawnpoint in the Grazelands doesn't produce oversized creatures
|
||||||
Bug #5370: Opening an unlocked but trapped door uses the key
|
Bug #5370: Opening an unlocked but trapped door uses the key
|
||||||
Bug #5384: openmw-cs: deleting an instance requires reload of scene window to show in editor
|
Bug #5384: openmw-cs: deleting an instance requires reload of scene window to show in editor
|
||||||
|
Bug #5387: Move/MoveWorld don't update the object's cell properly
|
||||||
Bug #5397: NPC greeting does not reset if you leave + reenter area
|
Bug #5397: NPC greeting does not reset if you leave + reenter area
|
||||||
Bug #5400: Editor: Verifier checks race of non-skin bodyparts
|
Bug #5400: Editor: Verifier checks race of non-skin bodyparts
|
||||||
Bug #5403: Enchantment effect doesn't show on an enemy during death animation
|
Bug #5403: Enchantment effect doesn't show on an enemy during death animation
|
||||||
|
|
|
@ -237,6 +237,8 @@ namespace MWBase
|
||||||
|
|
||||||
virtual void update (float duration) = 0;
|
virtual void update (float duration) = 0;
|
||||||
|
|
||||||
|
virtual void updateConsoleObjectPtr(const MWWorld::Ptr& currentPtr, const MWWorld::Ptr& newPtr) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches a GMST string from the store, if there is no setting with the given
|
* Fetches a GMST string from the store, if there is no setting with the given
|
||||||
* ID or it is not a string the default string is returned.
|
* ID or it is not a string the default string is returned.
|
||||||
|
|
|
@ -472,6 +472,12 @@ namespace MWGui
|
||||||
setCoord(10,10, width-10, height/2);
|
setCoord(10,10, width-10, height/2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Console::updateSelectedObjectPtr(const MWWorld::Ptr& currentPtr, const MWWorld::Ptr& newPtr)
|
||||||
|
{
|
||||||
|
if (mPtr == currentPtr)
|
||||||
|
mPtr = newPtr;
|
||||||
|
}
|
||||||
|
|
||||||
void Console::setSelectedObject(const MWWorld::Ptr& object)
|
void Console::setSelectedObject(const MWWorld::Ptr& object)
|
||||||
{
|
{
|
||||||
if (!object.isEmpty())
|
if (!object.isEmpty())
|
||||||
|
|
|
@ -58,6 +58,8 @@ namespace MWGui
|
||||||
|
|
||||||
void executeFile (const std::string& path);
|
void executeFile (const std::string& path);
|
||||||
|
|
||||||
|
void updateSelectedObjectPtr(const MWWorld::Ptr& currentPtr, const MWWorld::Ptr& newPtr);
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
virtual void resetReference ();
|
virtual void resetReference ();
|
||||||
|
|
|
@ -574,6 +574,11 @@ namespace MWGui
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WindowManager::updateConsoleObjectPtr(const MWWorld::Ptr& currentPtr, const MWWorld::Ptr& newPtr)
|
||||||
|
{
|
||||||
|
mConsole->updateSelectedObjectPtr(currentPtr, newPtr);
|
||||||
|
}
|
||||||
|
|
||||||
void WindowManager::updateVisible()
|
void WindowManager::updateVisible()
|
||||||
{
|
{
|
||||||
bool loading = (getMode() == GM_Loading || getMode() == GM_LoadingWallpaper);
|
bool loading = (getMode() == GM_Loading || getMode() == GM_LoadingWallpaper);
|
||||||
|
|
|
@ -242,6 +242,8 @@ namespace MWGui
|
||||||
virtual void unsetSelectedSpell();
|
virtual void unsetSelectedSpell();
|
||||||
virtual void unsetSelectedWeapon();
|
virtual void unsetSelectedWeapon();
|
||||||
|
|
||||||
|
virtual void updateConsoleObjectPtr(const MWWorld::Ptr& currentPtr, const MWWorld::Ptr& newPtr);
|
||||||
|
|
||||||
virtual void showCrosshair(bool show);
|
virtual void showCrosshair(bool show);
|
||||||
virtual bool getSubtitlesEnabled();
|
virtual bool getSubtitlesEnabled();
|
||||||
|
|
||||||
|
|
|
@ -725,7 +725,8 @@ namespace MWScript
|
||||||
// We should move actors, standing on moving object, too.
|
// We should move actors, standing on moving object, too.
|
||||||
// This approach can be used to create elevators.
|
// This approach can be used to create elevators.
|
||||||
moveStandingActors(ptr, diff);
|
moveStandingActors(ptr, diff);
|
||||||
MWBase::Environment::get().getWorld()->moveObject(ptr, worldPos.x(), worldPos.y(), worldPos.z());
|
dynamic_cast<MWScript::InterpreterContext&>(runtime.getContext()).updatePtr(ptr,
|
||||||
|
MWBase::Environment::get().getWorld()->moveObject(ptr, worldPos.x(), worldPos.y(), worldPos.z()));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -761,7 +762,8 @@ namespace MWScript
|
||||||
// We should move actors, standing on moving object, too.
|
// We should move actors, standing on moving object, too.
|
||||||
// This approach can be used to create elevators.
|
// This approach can be used to create elevators.
|
||||||
moveStandingActors(ptr, diff);
|
moveStandingActors(ptr, diff);
|
||||||
MWBase::Environment::get().getWorld()->moveObject(ptr, objPos[0]+diff.x(), objPos[1]+diff.y(), objPos[2]+diff.z());
|
dynamic_cast<MWScript::InterpreterContext&>(runtime.getContext()).updatePtr(ptr,
|
||||||
|
MWBase::Environment::get().getWorld()->moveObject(ptr, objPos[0]+diff.x(), objPos[1]+diff.y(), objPos[2]+diff.z()));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1201,6 +1201,8 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MWBase::Environment::get().getWindowManager()->updateConsoleObjectPtr(ptr, newPtr);
|
||||||
}
|
}
|
||||||
if (haveToMove && newPtr.getRefData().getBaseNode())
|
if (haveToMove && newPtr.getRefData().getBaseNode())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue