1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-02-21 20:27:13 +01:00

Avoid creating checkpoints for invalid player instances.

This commit is contained in:
Sandu Liviu Catalin 2016-06-25 00:08:16 +03:00
parent 36e3ed8f7a
commit 254bd9eee6

View File

@ -1205,6 +1205,9 @@ void CPlayer::PlaySound(Int32 sound_id) const
Object & CPlayer::CreateCheckpointEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z, Object & CPlayer::CreateCheckpointEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Float32 radius) const Uint8 r, Uint8 g, Uint8 b, Uint8 a, Float32 radius) const
{ {
// Validate the managed identifier
Validate();
// Perform the requested operation
return Core::Get().NewCheckpoint(m_ID, world, sphere, x, y, z, r, g, b, a, radius, return Core::Get().NewCheckpoint(m_ID, world, sphere, x, y, z, r, g, b, a, radius,
SQMOD_CREATE_DEFAULT, NullObject()); SQMOD_CREATE_DEFAULT, NullObject());
} }
@ -1214,6 +1217,9 @@ Object & CPlayer::CreateCheckpointEx(Int32 world, bool sphere, Float32 x, Float3
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Float32 radius, Uint8 r, Uint8 g, Uint8 b, Uint8 a, Float32 radius,
Int32 header, Object & payload) const Int32 header, Object & payload) const
{ {
// Validate the managed identifier
Validate();
// Perform the requested operation
return Core::Get().NewCheckpoint(m_ID, world, sphere, x, y, z, r, g, b, a, return Core::Get().NewCheckpoint(m_ID, world, sphere, x, y, z, r, g, b, a,
radius, header, payload); radius, header, payload);
} }
@ -1222,6 +1228,9 @@ Object & CPlayer::CreateCheckpointEx(Int32 world, bool sphere, Float32 x, Float3
Object & CPlayer::CreateCheckpoint(Int32 world, bool sphere, const Vector3 & pos, Object & CPlayer::CreateCheckpoint(Int32 world, bool sphere, const Vector3 & pos,
const Color4 & color, Float32 radius) const const Color4 & color, Float32 radius) const
{ {
// Validate the managed identifier
Validate();
// Perform the requested operation
return Core::Get().NewCheckpoint(m_ID, world, sphere, pos.x, pos.y, pos.z, return Core::Get().NewCheckpoint(m_ID, world, sphere, pos.x, pos.y, pos.z,
color.r, color.g, color.b, color.a, radius, color.r, color.g, color.b, color.a, radius,
SQMOD_CREATE_DEFAULT, NullObject()); SQMOD_CREATE_DEFAULT, NullObject());
@ -1231,6 +1240,9 @@ Object & CPlayer::CreateCheckpoint(Int32 world, bool sphere, const Vector3 & pos
Object & CPlayer::CreateCheckpoint(Int32 world, bool sphere, const Vector3 & pos, const Color4 & color, Object & CPlayer::CreateCheckpoint(Int32 world, bool sphere, const Vector3 & pos, const Color4 & color,
Float32 radius, Int32 header, Object & payload) const Float32 radius, Int32 header, Object & payload) const
{ {
// Validate the managed identifier
Validate();
// Perform the requested operation
return Core::Get().NewCheckpoint(m_ID, world, sphere, pos.x, pos.y, pos.z, return Core::Get().NewCheckpoint(m_ID, world, sphere, pos.x, pos.y, pos.z,
color.r, color.g, color.b, color.a, radius, header, payload); color.r, color.g, color.b, color.a, radius, header, payload);
} }