mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-01 12:01:51 +00:00
Call getUserPointer only for not nullptr collision object
nullptr can't have user pointer anyway so it saves a lookup in the unordered_map.
This commit is contained in:
parent
5f926bd129
commit
acf1e51a28
@ -275,10 +275,13 @@ namespace
|
|||||||
if (mAdvanceSimulation)
|
if (mAdvanceSimulation)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr standingOn;
|
MWWorld::Ptr standingOn;
|
||||||
auto* ptrHolder
|
if (frameData.mStandingOn != nullptr)
|
||||||
= static_cast<MWPhysics::PtrHolder*>(scheduler->getUserPointer(frameData.mStandingOn));
|
{
|
||||||
if (ptrHolder)
|
auto* const ptrHolder
|
||||||
standingOn = ptrHolder->getPtr();
|
= static_cast<MWPhysics::PtrHolder*>(scheduler->getUserPointer(frameData.mStandingOn));
|
||||||
|
if (ptrHolder != nullptr)
|
||||||
|
standingOn = ptrHolder->getPtr();
|
||||||
|
}
|
||||||
actor->setStandingOnPtr(standingOn);
|
actor->setStandingOnPtr(standingOn);
|
||||||
// the "on ground" state of an actor might have been updated by a traceDown, don't overwrite the
|
// the "on ground" state of an actor might have been updated by a traceDown, don't overwrite the
|
||||||
// change
|
// change
|
||||||
|
Loading…
Reference in New Issue
Block a user