mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 00:37:15 +01:00
Change the order of custom Object events to happen before performing the action.
This commit is contained in:
parent
e60e2958f0
commit
e4aa96a8c3
@ -163,16 +163,16 @@ void CObject::SetWorld(int32_t world)
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Avoid property unwind from a recursive call
|
|
||||||
_Func->SetObjectWorld(m_ID, world);
|
|
||||||
// Avoid infinite recursive event loops
|
// Avoid infinite recursive event loops
|
||||||
if (!(m_CircularLocks & OBJECTCL_EMIT_OBJECT_WORLD))
|
else if (!(m_CircularLocks & OBJECTCL_EMIT_OBJECT_WORLD))
|
||||||
{
|
{
|
||||||
// Prevent this event from triggering while executed
|
// Prevent this event from triggering while executed
|
||||||
BitGuardU32 bg(m_CircularLocks, OBJECTCL_EMIT_OBJECT_WORLD);
|
BitGuardU32 bg(m_CircularLocks, OBJECTCL_EMIT_OBJECT_WORLD);
|
||||||
// Now forward the event call
|
// Now forward the event call
|
||||||
Core::Get().EmitObjectWorld(m_ID, current, world);
|
Core::Get().EmitObjectWorld(m_ID, current, world);
|
||||||
}
|
}
|
||||||
|
// Avoid property unwind from a recursive call
|
||||||
|
_Func->SetObjectWorld(m_ID, world);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -202,16 +202,16 @@ void CObject::SetAlphaEx(int32_t alpha, uint32_t time)
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Avoid property unwind from a recursive call
|
|
||||||
_Func->SetObjectAlpha(m_ID, alpha, time);
|
|
||||||
// Avoid infinite recursive event loops
|
// Avoid infinite recursive event loops
|
||||||
if (!(m_CircularLocks & OBJECTCL_EMIT_OBJECT_ALPHA))
|
else if (!(m_CircularLocks & OBJECTCL_EMIT_OBJECT_ALPHA))
|
||||||
{
|
{
|
||||||
// Prevent this event from triggering while executed
|
// Prevent this event from triggering while executed
|
||||||
BitGuardU32 bg(m_CircularLocks, OBJECTCL_EMIT_OBJECT_ALPHA);
|
BitGuardU32 bg(m_CircularLocks, OBJECTCL_EMIT_OBJECT_ALPHA);
|
||||||
// Now forward the event call
|
// Now forward the event call
|
||||||
Core::Get().EmitObjectAlpha(m_ID, current, alpha, time);
|
Core::Get().EmitObjectAlpha(m_ID, current, alpha, time);
|
||||||
}
|
}
|
||||||
|
// Avoid property unwind from a recursive call
|
||||||
|
_Func->SetObjectAlpha(m_ID, alpha, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -400,16 +400,16 @@ void CObject::SetShotReport(bool toggle)
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Avoid property unwind from a recursive call
|
|
||||||
_Func->SetObjectShotReportEnabled(m_ID, static_cast< uint8_t >(toggle));
|
|
||||||
// Avoid infinite recursive event loops
|
// Avoid infinite recursive event loops
|
||||||
if (!(m_CircularLocks & OBJECTCL_EMIT_OBJECT_REPORT))
|
else if (!(m_CircularLocks & OBJECTCL_EMIT_OBJECT_REPORT))
|
||||||
{
|
{
|
||||||
// Prevent this event from triggering while executed
|
// Prevent this event from triggering while executed
|
||||||
BitGuardU32 bg(m_CircularLocks, OBJECTCL_EMIT_OBJECT_REPORT);
|
BitGuardU32 bg(m_CircularLocks, OBJECTCL_EMIT_OBJECT_REPORT);
|
||||||
// Now forward the event call
|
// Now forward the event call
|
||||||
Core::Get().EmitObjectReport(m_ID, current, toggle, false);
|
Core::Get().EmitObjectReport(m_ID, current, toggle, false);
|
||||||
}
|
}
|
||||||
|
// Avoid property unwind from a recursive call
|
||||||
|
_Func->SetObjectShotReportEnabled(m_ID, static_cast< uint8_t >(toggle));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -433,16 +433,16 @@ void CObject::SetTouchedReport(bool toggle)
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Avoid property unwind from a recursive call
|
|
||||||
_Func->SetObjectTouchedReportEnabled(m_ID, static_cast< uint8_t >(toggle));
|
|
||||||
// Avoid infinite recursive event loops
|
// Avoid infinite recursive event loops
|
||||||
if (!(m_CircularLocks & OBJECTCL_EMIT_OBJECT_REPORT))
|
else if (!(m_CircularLocks & OBJECTCL_EMIT_OBJECT_REPORT))
|
||||||
{
|
{
|
||||||
// Prevent this event from triggering while executed
|
// Prevent this event from triggering while executed
|
||||||
BitGuardU32 bg(m_CircularLocks, OBJECTCL_EMIT_OBJECT_REPORT);
|
BitGuardU32 bg(m_CircularLocks, OBJECTCL_EMIT_OBJECT_REPORT);
|
||||||
// Now forward the event call
|
// Now forward the event call
|
||||||
Core::Get().EmitObjectReport(m_ID, current, toggle, true);
|
Core::Get().EmitObjectReport(m_ID, current, toggle, true);
|
||||||
}
|
}
|
||||||
|
// Avoid property unwind from a recursive call
|
||||||
|
_Func->SetObjectTouchedReportEnabled(m_ID, static_cast< uint8_t >(toggle));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user