1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 08:47:17 +01:00

Fix the hide object function to calculate the correct coordinates but also implement the raw function.

This commit is contained in:
Sandu Liviu Catalin 2016-03-26 18:14:00 +02:00
parent f9ef0040c9
commit b486ecc2fb
3 changed files with 24 additions and 2 deletions

View File

@ -79,6 +79,7 @@ void Register_Misc(HSQUIRRELVM vm)
.Func(_SC("CreateExplosionEx"), &CreateExplosionEx) .Func(_SC("CreateExplosionEx"), &CreateExplosionEx)
.Func(_SC("HideMapObject"), &HideMapObject) .Func(_SC("HideMapObject"), &HideMapObject)
.Func(_SC("HideMapObjectEx"), &HideMapObjectEx) .Func(_SC("HideMapObjectEx"), &HideMapObjectEx)
.Func(_SC("HideMapObjectRaw"), &HideMapObjectRaw)
.Func(_SC("ShowMapObject"), &ShowMapObject) .Func(_SC("ShowMapObject"), &ShowMapObject)
.Func(_SC("ShowMapObjectEx"), &ShowMapObjectEx) .Func(_SC("ShowMapObjectEx"), &ShowMapObjectEx)
.Func(_SC("ShowAllMapObjects"), &ShowAllMapObjects) .Func(_SC("ShowAllMapObjects"), &ShowAllMapObjects)

View File

@ -171,9 +171,29 @@ void CreateExplosionEx(Int32 world, Int32 type, Float32 x, Float32 y, Float32 z,
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void HideMapObject(Int32 model, const Vector3 & pos) void HideMapObject(Int32 model, const Vector3 & pos)
{ _Func->HideMapObject(model, pos.x, pos.y, pos.z); } {
_Func->HideMapObject(model,
static_cast< Int32 >(std::floor(pos.x * 10.0f) + 0.5f),
static_cast< Int32 >(std::floor(pos.y * 10.0f) + 0.5f),
static_cast< Int32 >(std::floor(pos.z * 10.0f) + 0.5f)
);
}
// ------------------------------------------------------------------------------------------------
void HideMapObjectEx(Int32 model, Float32 x, Float32 y, Float32 z) void HideMapObjectEx(Int32 model, Float32 x, Float32 y, Float32 z)
{ _Func->HideMapObject(model, x, y, z); } {
_Func->HideMapObject(model,
static_cast< Int32 >(std::floor(x * 10.0f) + 0.5f),
static_cast< Int32 >(std::floor(y * 10.0f) + 0.5f),
static_cast< Int32 >(std::floor(z * 10.0f) + 0.5f)
);
}
// ------------------------------------------------------------------------------------------------
void HideMapObjectRaw(Int32 model, Int32 x, Int32 y, Int32 z)
{
_Func->HideMapObject(model, x, y, z);
}
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void ShowMapObject(Int32 model, const Vector3 & pos) void ShowMapObject(Int32 model, const Vector3 & pos)

View File

@ -90,6 +90,7 @@ void CreateExplosionEx(Int32 world, Int32 type, Float32 x, Float32 y, Float32 z,
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void HideMapObject(Int32 model, const Vector3 & pos); void HideMapObject(Int32 model, const Vector3 & pos);
void HideMapObjectEx(Int32 model, Float32 x, Float32 y, Float32 z); void HideMapObjectEx(Int32 model, Float32 x, Float32 y, Float32 z);
void HideMapObjectRaw(Int32 model, Int32 x, Int32 y, Int32 z);
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void ShowMapObject(Int32 model, const Vector3 & pos); void ShowMapObject(Int32 model, const Vector3 & pos);