forked from mirror/openmw-tes3mp
Add timer for updateEquippedLight
This commit is contained in:
parent
1eb3384043
commit
a2cede8f34
1 changed files with 8 additions and 1 deletions
|
@ -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…
Reference in a new issue