mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 00:37:15 +01:00
Fix the hide object function to calculate the correct coordinates but also implement the raw function.
This commit is contained in:
parent
f9ef0040c9
commit
b486ecc2fb
@ -79,6 +79,7 @@ void Register_Misc(HSQUIRRELVM vm)
|
||||
.Func(_SC("CreateExplosionEx"), &CreateExplosionEx)
|
||||
.Func(_SC("HideMapObject"), &HideMapObject)
|
||||
.Func(_SC("HideMapObjectEx"), &HideMapObjectEx)
|
||||
.Func(_SC("HideMapObjectRaw"), &HideMapObjectRaw)
|
||||
.Func(_SC("ShowMapObject"), &ShowMapObject)
|
||||
.Func(_SC("ShowMapObjectEx"), &ShowMapObjectEx)
|
||||
.Func(_SC("ShowAllMapObjects"), &ShowAllMapObjects)
|
||||
|
@ -171,9 +171,29 @@ void CreateExplosionEx(Int32 world, Int32 type, Float32 x, Float32 y, Float32 z,
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
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)
|
||||
{ _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)
|
||||
|
@ -90,6 +90,7 @@ void CreateExplosionEx(Int32 world, Int32 type, Float32 x, Float32 y, Float32 z,
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void HideMapObject(Int32 model, const Vector3 & pos);
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user