mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-06-16 07:07:13 +02:00
Replace GetObject with GetObj to avoid collisions on Windows.
ef you MS
This commit is contained in:
@ -31,11 +31,6 @@
|
||||
#include <stdexcept>
|
||||
#include <algorithm>
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#ifdef GetObject
|
||||
#undef GetObject
|
||||
#endif // ef you MS
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
@ -371,6 +366,8 @@ bool Core::Initialize()
|
||||
// Initialize routines and tasks
|
||||
InitializeRoutines();
|
||||
InitializeTasks();
|
||||
// Initialize third-party
|
||||
|
||||
|
||||
// Initialization successful
|
||||
return true;
|
||||
@ -478,6 +475,8 @@ void Core::Terminate(bool shutdown)
|
||||
const ContainerCleaner cc_blips(m_Blips, ENT_BLIP, !shutdown);
|
||||
const ContainerCleaner cc_keybinds(m_Keybinds, ENT_KEYBIND, !shutdown);
|
||||
cLogDbg(m_Verbosity >= 1, "Terminating routines an commands");
|
||||
// Release third-party
|
||||
|
||||
// Release all resources from routines and tasks
|
||||
TerminateRoutines();
|
||||
TerminateTasks();
|
||||
|
@ -1056,7 +1056,7 @@ public:
|
||||
BlipInst & GetBlip(Int32 id) { return m_Blips.at(static_cast< size_t >(id)); }
|
||||
CheckpointInst & GetCheckpoint(Int32 id) { return m_Checkpoints.at(static_cast< size_t >(id)); }
|
||||
KeybindInst & GetKeybind(Int32 id) { return m_Keybinds.at(static_cast< size_t >(id)); }
|
||||
ObjectInst & GetObject(Int32 id) { return m_Objects.at(static_cast< size_t >(id)); }
|
||||
ObjectInst & GetObj(Int32 id) { return m_Objects.at(static_cast< size_t >(id)); }
|
||||
PickupInst & GetPickup(Int32 id) { return m_Pickups.at(static_cast< size_t >(id)); }
|
||||
PlayerInst & GetPlayer(Int32 id) { return m_Players.at(static_cast< size_t >(id)); }
|
||||
VehicleInst & GetVehicle(Int32 id) { return m_Vehicles.at(static_cast< size_t >(id)); }
|
||||
@ -1067,7 +1067,7 @@ public:
|
||||
const Blips & GetBlips() const { return m_Blips; }
|
||||
const Checkpoints & GetCheckpoints() const { return m_Checkpoints; }
|
||||
const Keybinds & GetKeybinds() const { return m_Keybinds; }
|
||||
const Objects & GetObjects() const { return m_Objects; }
|
||||
const Objects & GetObjs() const { return m_Objects; }
|
||||
const Pickups & GetPickups() const { return m_Pickups; }
|
||||
const Players & GetPlayers() const { return m_Players; }
|
||||
const Vehicles & GetVehicles() const { return m_Vehicles; }
|
||||
|
@ -193,7 +193,7 @@ static LightObj & SqGetKeybind(Int32 id)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static LightObj & SqGetObject(Int32 id)
|
||||
static LightObj & SqGetObj(Int32 id)
|
||||
{
|
||||
// Validate the identifier first
|
||||
if (INVALID_ENTITYEX(id, SQMOD_OBJECT_POOL))
|
||||
@ -201,7 +201,7 @@ static LightObj & SqGetObject(Int32 id)
|
||||
STHROWF("Out of range object identifier: %d", id);
|
||||
}
|
||||
// Return the requested information
|
||||
return Core::Get().GetObject(id).mObj;
|
||||
return Core::Get().GetObj(id).mObj;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
@ -345,7 +345,7 @@ void Register_Core(HSQUIRRELVM vm)
|
||||
.Func(_SC("GetBlip"), &SqGetBlip)
|
||||
.Func(_SC("GetCheckpoint"), &SqGetCheckpoint)
|
||||
.Func(_SC("GetKeybind"), &SqGetKeybind)
|
||||
.Func(_SC("GetObject"), &SqGetObject)
|
||||
.Func(_SC("GetObj"), &SqGetObj)
|
||||
.Func(_SC("GetPickup"), &SqGetPickup)
|
||||
.Func(_SC("GetPlayer"), &SqGetPlayer)
|
||||
.Func(_SC("GetVehicle"), &SqGetVehicle)
|
||||
|
@ -15,7 +15,7 @@ const Int32 CBlip::Max = SQMOD_BLIP_POOL;
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CBlip::SqGetNull(HSQUIRRELVM vm)
|
||||
{
|
||||
sq_pushobject(vm, Core::Get().GetNullBlip().GetObject());
|
||||
sq_pushobject(vm, Core::Get().GetNullBlip().GetObj());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ const Int32 CCheckpoint::Max = SQMOD_CHECKPOINT_POOL;
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CCheckpoint::SqGetNull(HSQUIRRELVM vm)
|
||||
{
|
||||
sq_pushobject(vm, Core::Get().GetNullCheckpoint().GetObject());
|
||||
sq_pushobject(vm, Core::Get().GetNullCheckpoint().GetObj());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ const Int32 CKeybind::Max = SQMOD_KEYBIND_POOL;
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CKeybind::SqGetNull(HSQUIRRELVM vm)
|
||||
{
|
||||
sq_pushobject(vm, Core::Get().GetNullKeybind().GetObject());
|
||||
sq_pushobject(vm, Core::Get().GetNullKeybind().GetObj());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ const Int32 CObject::Max = SQMOD_OBJECT_POOL;
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CObject::SqGetNull(HSQUIRRELVM vm)
|
||||
{
|
||||
sq_pushobject(vm, Core::Get().GetNullObject().GetObject());
|
||||
sq_pushobject(vm, Core::Get().GetNullObject().GetObj());
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ LightObj & CObject::GetEvents() const
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
// Return the associated event table
|
||||
return Core::Get().GetObject(m_ID).mEvents;
|
||||
return Core::Get().GetObj(m_ID).mEvents;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
@ -17,7 +17,7 @@ const Int32 CPickup::Max = SQMOD_PICKUP_POOL;
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CPickup::SqGetNull(HSQUIRRELVM vm)
|
||||
{
|
||||
sq_pushobject(vm, Core::Get().GetNullPickup().GetObject());
|
||||
sq_pushobject(vm, Core::Get().GetNullPickup().GetObj());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ const Int32 CPlayer::Max = SQMOD_PLAYER_POOL;
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CPlayer::SqGetNull(HSQUIRRELVM vm)
|
||||
{
|
||||
sq_pushobject(vm, Core::Get().GetNullPlayer().GetObject());
|
||||
sq_pushobject(vm, Core::Get().GetNullPlayer().GetObj());
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1329,7 +1329,7 @@ LightObj & CPlayer::StandingOnObject() const
|
||||
if (VALID_ENTITYEX(id, SQMOD_OBJECT_POOL))
|
||||
{
|
||||
// Return the requested information
|
||||
return Core::Get().GetObject(id).mObj;
|
||||
return Core::Get().GetObj(id).mObj;
|
||||
}
|
||||
// Default to a null object
|
||||
return Core::Get().GetNullObject();
|
||||
|
@ -20,7 +20,7 @@ const Int32 CVehicle::Max = SQMOD_VEHICLE_POOL;
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CVehicle::SqGetNull(HSQUIRRELVM vm)
|
||||
{
|
||||
sq_pushobject(vm, Core::Get().GetNullVehicle().GetObject());
|
||||
sq_pushobject(vm, Core::Get().GetNullVehicle().GetObj());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -661,7 +661,7 @@ Int32 SQLiteConnHnd::Flush(Uint32 num, Object & env, Function & func)
|
||||
num = mQueue.size();
|
||||
}
|
||||
// Generate the function that should be called upon error
|
||||
Function callback = Function(env.GetVM(), env.GetObject(), func.GetFunc());
|
||||
Function callback = Function(env.GetVM(), env.GetObj(), func.GetFunc());
|
||||
// Obtain iterators to the range of queries that should be flushed
|
||||
auto itr = mQueue.begin();
|
||||
auto end = mQueue.begin() + num;
|
||||
|
@ -712,7 +712,7 @@ template <> struct InstSpec< CObject >
|
||||
*/
|
||||
static inline Instances::const_iterator CBegin()
|
||||
{
|
||||
return Core::Get().GetObjects().cbegin();
|
||||
return Core::Get().GetObjs().cbegin();
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -720,7 +720,7 @@ template <> struct InstSpec< CObject >
|
||||
*/
|
||||
static inline Instances::const_iterator CEnd()
|
||||
{
|
||||
return Core::Get().GetObjects().cend();
|
||||
return Core::Get().GetObjs().cend();
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -907,7 +907,7 @@ template < typename T > struct AppendElemFunc
|
||||
void operator () (const typename InstSpec< T >::Instance & inst) const
|
||||
{
|
||||
// Push the script object on the stack
|
||||
sq_pushobject(mVM, inst.mObj.GetObject());
|
||||
sq_pushobject(mVM, inst.mObj.GetObj());
|
||||
// Append the object at the back of the array
|
||||
if (SQ_FAILED(sq_arrayappend(mVM, mIdx)))
|
||||
{
|
||||
|
@ -640,7 +640,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
m_OnFail = Function(env.GetVM(), env.GetObject(), func.GetFunc());
|
||||
m_OnFail = Function(env.GetVM(), env.GetObj(), func.GetFunc());
|
||||
}
|
||||
}
|
||||
|
||||
@ -669,7 +669,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
m_OnAuth = Function(env.GetVM(), env.GetObject(), func.GetFunc());
|
||||
m_OnAuth = Function(env.GetVM(), env.GetObj(), func.GetFunc());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1761,7 +1761,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
m_OnExec = Function(env.GetVM(), env.GetObject(), func.GetFunc());
|
||||
m_OnExec = Function(env.GetVM(), env.GetObj(), func.GetFunc());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1790,7 +1790,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
m_OnAuth = Function(env.GetVM(), env.GetObject(), func.GetFunc());
|
||||
m_OnAuth = Function(env.GetVM(), env.GetObj(), func.GetFunc());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1819,7 +1819,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
m_OnPost = Function(env.GetVM(), env.GetObject(), func.GetFunc());
|
||||
m_OnPost = Function(env.GetVM(), env.GetObj(), func.GetFunc());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1848,7 +1848,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
m_OnFail = Function(env.GetVM(), env.GetObject(), func.GetFunc());
|
||||
m_OnFail = Function(env.GetVM(), env.GetObj(), func.GetFunc());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -434,7 +434,7 @@ public:
|
||||
*/
|
||||
void SetEnv(const LightObj & env)
|
||||
{
|
||||
GetValid().mEnv = env.IsNull() ? LightObj(RootTable().GetObject()) : env;
|
||||
GetValid().mEnv = env.IsNull() ? LightObj(RootTable().GetObj()) : env;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
|
@ -113,7 +113,7 @@ protected:
|
||||
* Forwarding constructor.
|
||||
*/
|
||||
Slot(Object & env, Function & func)
|
||||
: Slot(env.GetObject(), func.GetFunc())
|
||||
: Slot(env.GetObj(), func.GetFunc())
|
||||
{
|
||||
/* ... */
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ LightObj & Tasks::FindEntity(Int32 id, Int32 type)
|
||||
case ENT_BLIP: return Core::Get().GetBlip(id).mObj;
|
||||
case ENT_CHECKPOINT: return Core::Get().GetCheckpoint(id).mObj;
|
||||
case ENT_KEYBIND: return Core::Get().GetKeybind(id).mObj;
|
||||
case ENT_OBJECT: return Core::Get().GetObject(id).mObj;
|
||||
case ENT_OBJECT: return Core::Get().GetObj(id).mObj;
|
||||
case ENT_PICKUP: return Core::Get().GetPickup(id).mObj;
|
||||
case ENT_PLAYER: return Core::Get().GetPlayer(id).mObj;
|
||||
case ENT_VEHICLE: return Core::Get().GetVehicle(id).mObj;
|
||||
@ -244,7 +244,7 @@ SQInteger Tasks::Create(Int32 id, Int32 type, HSQUIRRELVM vm)
|
||||
// Attempt to retrieve the entity instance
|
||||
try
|
||||
{
|
||||
inst = FindEntity(id, type).GetObject();
|
||||
inst = FindEntity(id, type).GetObj();
|
||||
}
|
||||
catch (const std::exception & e)
|
||||
{
|
||||
|
Reference in New Issue
Block a user