1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-15 14:47:13 +02:00

Implement a new event to receive notifications when a checkpoint radius has changed.

This commit is contained in:
Sandu Liviu Catalin
2016-08-18 16:10:18 +03:00
parent f38aa16b5f
commit 5f60d7b90d
6 changed files with 30 additions and 3 deletions

View File

@ -294,8 +294,18 @@ void CCheckpoint::SetRadius(Float32 radius) const
{
// Validate the managed identifier
Validate();
// Perform the requested operation
// Grab the current value for this property
const Float32 current = _Func->GetCheckPointRadius(m_ID);
// Avoid property unwind from a recursive call
_Func->SetCheckPointRadius(m_ID, radius);
// Avoid infinite recursive event loops
if (!(m_CircularLocks & CHECKPOINTCL_EMIT_CHECKPOINT_RADIUS))
{
// Prevent this event from triggering while executed
BitGuardU32 bg(m_CircularLocks, CHECKPOINTCL_EMIT_CHECKPOINT_RADIUS);
// Now forward the event call
Core::Get().EmitCheckpointRadius(m_ID, current, radius);
}
}
// ------------------------------------------------------------------------------------------------