mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-17 19:20:49 +00:00
Add timer for updateEquippedLight
This commit is contained in:
parent
1eb3384043
commit
a2cede8f34
@ -396,7 +396,6 @@ namespace MWMechanics
|
|||||||
{
|
{
|
||||||
updateDrowning(ptr, duration);
|
updateDrowning(ptr, duration);
|
||||||
calculateNpcStatModifiers(ptr, duration);
|
calculateNpcStatModifiers(ptr, duration);
|
||||||
updateEquippedLight(ptr, duration);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Actors::adjustMagicEffects (const MWWorld::Ptr& creature)
|
void Actors::adjustMagicEffects (const MWWorld::Ptr& creature)
|
||||||
@ -1018,10 +1017,13 @@ namespace MWMechanics
|
|||||||
{
|
{
|
||||||
static float timerUpdateAITargets = 0;
|
static float timerUpdateAITargets = 0;
|
||||||
static float timerUpdateHeadTrack = 0;
|
static float timerUpdateHeadTrack = 0;
|
||||||
|
static float timerUpdateEquippedLight = 0;
|
||||||
|
const float updateEquippedLightInterval = 1.0f;
|
||||||
|
|
||||||
// target lists get updated once every 1.0 sec
|
// target lists get updated once every 1.0 sec
|
||||||
if (timerUpdateAITargets >= 1.0f) timerUpdateAITargets = 0;
|
if (timerUpdateAITargets >= 1.0f) timerUpdateAITargets = 0;
|
||||||
if (timerUpdateHeadTrack >= 0.3f) timerUpdateHeadTrack = 0;
|
if (timerUpdateHeadTrack >= 0.3f) timerUpdateHeadTrack = 0;
|
||||||
|
if (timerUpdateEquippedLight >= updateEquippedLightInterval) timerUpdateEquippedLight = 0;
|
||||||
|
|
||||||
MWWorld::Ptr player = getPlayer();
|
MWWorld::Ptr player = getPlayer();
|
||||||
|
|
||||||
@ -1096,7 +1098,12 @@ namespace MWMechanics
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(iter->first.getTypeName() == typeid(ESM::NPC).name())
|
if(iter->first.getTypeName() == typeid(ESM::NPC).name())
|
||||||
|
{
|
||||||
updateNpc(iter->first, duration);
|
updateNpc(iter->first, duration);
|
||||||
|
|
||||||
|
if (timerUpdateEquippedLight == 0)
|
||||||
|
updateEquippedLight(iter->first, updateEquippedLightInterval);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user