1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-01-31 18:07:14 +01:00

Prevent exceptions during event callbacks from blocking the the decrease of the track counter.

This commit is contained in:
Sandu Liviu Catalin 2016-07-14 19:56:13 +03:00
parent 6be526924d
commit 27f2a57573

View File

@ -911,12 +911,13 @@ void Core::EmitPlayerUpdate(Int32 player_id, vcmpPlayerUpdate update_type)
// Trigger the event specific to this change // Trigger the event specific to this change
if (inst.mTrackHeading != 0) if (inst.mTrackHeading != 0)
{ {
EmitPlayerHeading(player_id, inst.mLastHeading, heading);
// Should we decrease the tracked position changes? // Should we decrease the tracked position changes?
if (inst.mTrackHeading) if (inst.mTrackHeading)
{ {
--inst.mTrackHeading; --inst.mTrackHeading;
} }
// Now emit the event
EmitPlayerHeading(player_id, inst.mLastHeading, heading);
} }
// Update the tracked value // Update the tracked value
inst.mLastHeading = heading; inst.mLastHeading = heading;
@ -931,12 +932,13 @@ void Core::EmitPlayerUpdate(Int32 player_id, vcmpPlayerUpdate update_type)
// Trigger the event specific to this change // Trigger the event specific to this change
if (inst.mTrackPosition != 0) if (inst.mTrackPosition != 0)
{ {
EmitPlayerPosition(player_id);
// Should we decrease the tracked position changes? // Should we decrease the tracked position changes?
if (inst.mTrackPosition) if (inst.mTrackPosition)
{ {
--inst.mTrackPosition; --inst.mTrackPosition;
} }
// Now emit the event
EmitPlayerPosition(player_id);
} }
// Update the tracked value // Update the tracked value
inst.mLastPosition = pos; inst.mLastPosition = pos;
@ -998,12 +1000,13 @@ void Core::EmitVehicleUpdate(Int32 vehicle_id, vcmpVehicleUpdate update_type)
// Trigger the event specific to this change // Trigger the event specific to this change
if (inst.mTrackPosition != 0) if (inst.mTrackPosition != 0)
{ {
EmitVehiclePosition(vehicle_id);
// Should we decrease the tracked position changes? // Should we decrease the tracked position changes?
if (inst.mTrackPosition) if (inst.mTrackPosition)
{ {
--inst.mTrackPosition; --inst.mTrackPosition;
} }
// Now emit the event
EmitVehiclePosition(vehicle_id);
} }
// Update the tracked value // Update the tracked value
_Func->GetVehiclePosition(vehicle_id, &inst.mLastPosition.x, _Func->GetVehiclePosition(vehicle_id, &inst.mLastPosition.x,
@ -1046,12 +1049,13 @@ void Core::EmitVehicleUpdate(Int32 vehicle_id, vcmpVehicleUpdate update_type)
// Trigger the event specific to this change // Trigger the event specific to this change
if (inst.mTrackRotation != 0) if (inst.mTrackRotation != 0)
{ {
EmitVehicleRotation(vehicle_id);
// Should we decrease the tracked rotation changes? // Should we decrease the tracked rotation changes?
if (inst.mTrackRotation) if (inst.mTrackRotation)
{ {
--inst.mTrackRotation; --inst.mTrackRotation;
} }
// Now emit the event
EmitVehicleRotation(vehicle_id);
} }
// Obtain the current rotation of this instance // Obtain the current rotation of this instance
_Func->GetVehicleRotation(vehicle_id, &inst.mLastRotation.x, &inst.mLastRotation.y, _Func->GetVehicleRotation(vehicle_id, &inst.mLastRotation.x, &inst.mLastRotation.y,