mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-06 18:08:36 +00:00
Add virtual address to remaining natives
This commit is contained in:
parent
29aa1ff3ca
commit
021ed61998
@ -155,11 +155,10 @@ static cell_t smn_GameConfGetAddress(IPluginContext *pCtx, const cell_t *params)
|
|||||||
if (!gc->GetAddress(key, &val))
|
if (!gc->GetAddress(key, &val))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#ifdef KE_ARCH_X86
|
if (pCtx->GetRuntime()->FindPubvarByName("__Virtual_Address__", nullptr) == SP_ERROR_NONE) {
|
||||||
return (cell_t)val;
|
return pseudoAddr.ToPseudoAddress(val);
|
||||||
#else
|
}
|
||||||
return pseudoAddr.ToPseudoAddress(val);
|
return reinterpret_cast<uintptr_t>(val);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell_t smn_GameConfGetMemSig(IPluginContext *pCtx, const cell_t *params)
|
static cell_t smn_GameConfGetMemSig(IPluginContext *pCtx, const cell_t *params)
|
||||||
@ -187,11 +186,10 @@ static cell_t smn_GameConfGetMemSig(IPluginContext *pCtx, const cell_t *params)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef KE_ARCH_X86
|
if (pCtx->GetRuntime()->FindPubvarByName("__Virtual_Address__", nullptr) == SP_ERROR_NONE) {
|
||||||
return (cell_t)val;
|
return pseudoAddr.ToPseudoAddress(val);
|
||||||
#else
|
}
|
||||||
return pseudoAddr.ToPseudoAddress(val);
|
return reinterpret_cast<uintptr_t>(val);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static GameConfigsNatives s_GameConfigsNatives;
|
static GameConfigsNatives s_GameConfigsNatives;
|
||||||
|
|||||||
@ -834,11 +834,10 @@ static cell_t SetEntDataEnt2(IPluginContext *pContext, const cell_t *params)
|
|||||||
|
|
||||||
static cell_t StoreEntityToHandleAddress(IPluginContext *pContext, const cell_t *params)
|
static cell_t StoreEntityToHandleAddress(IPluginContext *pContext, const cell_t *params)
|
||||||
{
|
{
|
||||||
#ifdef KE_ARCH_X86
|
|
||||||
void *addr = reinterpret_cast<void*>(params[1]);
|
void *addr = reinterpret_cast<void*>(params[1]);
|
||||||
#else
|
if (pContext->GetRuntime()->FindPubvarByName("__Virtual_Address__", nullptr) == SP_ERROR_NONE) {
|
||||||
void *addr = g_SourceMod.FromPseudoAddress(params[1]);
|
addr = g_SourceMod.FromPseudoAddress(params[1]);
|
||||||
#endif
|
}
|
||||||
|
|
||||||
if (addr == NULL)
|
if (addr == NULL)
|
||||||
{
|
{
|
||||||
@ -2771,11 +2770,10 @@ static cell_t GetEntityAddress(IPluginContext *pContext, const cell_t *params)
|
|||||||
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
|
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef KE_ARCH_X86
|
if (pContext->GetRuntime()->FindPubvarByName("__Virtual_Address__", nullptr) == SP_ERROR_NONE) {
|
||||||
return reinterpret_cast<cell_t>(pEntity);
|
return g_SourceMod.ToPseudoAddress(pEntity);
|
||||||
#else
|
}
|
||||||
return g_SourceMod.ToPseudoAddress(pEntity);
|
return reinterpret_cast<uintptr_t>(pEntity);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
REGISTER_NATIVES(entityNatives)
|
REGISTER_NATIVES(entityNatives)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user