mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-29 22:20:33 +00:00
Activate/OnActivate fix (Bug #3712)
This commit is contained in:
parent
73aa07b81b
commit
69ce9f32bc
@ -13,7 +13,8 @@ namespace
|
||||
enum RefDataFlags
|
||||
{
|
||||
Flag_SuppressActivate = 1, // If set, activation will be suppressed and redirected to the OnActivate flag, which can then be handled by a script.
|
||||
Flag_OnActivate = 2
|
||||
Flag_OnActivate = 2,
|
||||
Flag_ActivationBuffered = 4
|
||||
};
|
||||
}
|
||||
|
||||
@ -241,38 +242,32 @@ namespace MWWorld
|
||||
return mChanged || !mAnimationState.empty();
|
||||
}
|
||||
|
||||
bool RefData::activateByScript()
|
||||
{
|
||||
bool ret = (mFlags & Flag_ActivationBuffered);
|
||||
mFlags &= ~(Flag_SuppressActivate|Flag_OnActivate);
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool RefData::activate()
|
||||
{
|
||||
if (!(mFlags & Flag_SuppressActivate))
|
||||
return true;
|
||||
if (mFlags & Flag_SuppressActivate)
|
||||
{
|
||||
mFlags |= Flag_OnActivate|Flag_ActivationBuffered;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
mFlags |= Flag_OnActivate;
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool RefData::onActivate()
|
||||
{
|
||||
bool ret = mFlags & Flag_OnActivate;
|
||||
mFlags |= Flag_SuppressActivate;
|
||||
|
||||
if (mFlags & Flag_OnActivate)
|
||||
{
|
||||
mFlags &= (~Flag_OnActivate);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool RefData::activateByScript()
|
||||
{
|
||||
if (mFlags & Flag_SuppressActivate)
|
||||
{
|
||||
mFlags &= (~Flag_SuppressActivate);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
mFlags &= (~Flag_OnActivate);
|
||||
return ret;
|
||||
}
|
||||
|
||||
const ESM::AnimationState& RefData::getAnimationState() const
|
||||
|
Loading…
x
Reference in New Issue
Block a user