mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-06 18:08:36 +00:00
Make plugins aware of pointer size
This commit is contained in:
parent
bf1ca7e1a4
commit
9dc2ce5036
@ -330,6 +330,13 @@ bool CPlugin::ReadInfo()
|
||||
else
|
||||
m_MaxClientsVar = nullptr;
|
||||
|
||||
if (base->FindPubvarByName("PointerSize", &idx) == SP_ERROR_NONE) {
|
||||
sp_pubvar_t* var = nullptr;
|
||||
if (base->GetPubvarByIndex(idx, &var) == SP_ERROR_NONE && var) {
|
||||
*var->offs = sizeof(void*);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -36,3 +36,4 @@
|
||||
#define _virtual_address_included
|
||||
|
||||
public const Address __Virtual_Address__ = 0;
|
||||
public const Address PointerSize = 0; /**< Size of a pointer in bytes (same as `sizeof(void*)`) */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user