mirror of
https://github.com/rehlds/reapi.git
synced 2025-01-01 01:25:47 +03:00
Fixed pmtrace natives
Added error if native requires one of the unexisting addons
This commit is contained in:
parent
b03360a268
commit
1ba339a98b
@ -88,7 +88,7 @@ native any:get_movevar(const MoveVars:var, any:...);
|
|||||||
*
|
*
|
||||||
* @return 1 on success.
|
* @return 1 on success.
|
||||||
*/
|
*/
|
||||||
native set_pmtrace(const PMTrace:var, any:...);
|
native set_pmtrace(const tracehandle, const PMTrace:var, any:...);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns a pmtrace vars
|
* Returns a pmtrace vars
|
||||||
@ -97,7 +97,7 @@ native set_pmtrace(const PMTrace:var, any:...);
|
|||||||
*
|
*
|
||||||
* @return If an integer or boolean or one byte, array or everything else is passed via 3rd argument and more, look at argument list for specified mvar
|
* @return If an integer or boolean or one byte, array or everything else is passed via 3rd argument and more, look at argument list for specified mvar
|
||||||
*/
|
*/
|
||||||
native any:get_pmtrace(const PMTrace:var, any:...);
|
native any:get_pmtrace(const tracehandle, const PMTrace:var, any:...);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Assign the number of the player animations.
|
* Assign the number of the player animations.
|
||||||
|
@ -108,9 +108,12 @@ AMX_NATIVE_INFO Reunion_Natives[] =
|
|||||||
|
|
||||||
void RegisterNatives_Addons()
|
void RegisterNatives_Addons()
|
||||||
{
|
{
|
||||||
if (api_cfg.hasVTC())
|
if (!api_cfg.hasVTC())
|
||||||
g_amxxapi.AddNatives(Vtc_Natives);
|
fillNatives(Vtc_Natives, [](AMX *amx, cell *params) -> cell { MF_LogError(amx, AMX_ERR_NATIVE, "%s: isn't available", "VTC"); return FALSE; });
|
||||||
|
|
||||||
if (api_cfg.hasReunion())
|
if (!api_cfg.hasReunion())
|
||||||
|
fillNatives(Reunion_Natives, [](AMX *amx, cell *params) -> cell { MF_LogError(amx, AMX_ERR_NATIVE, "%s: isn't available", "Reunion"); return FALSE; });
|
||||||
|
|
||||||
|
g_amxxapi.AddNatives(Vtc_Natives);
|
||||||
g_amxxapi.AddNatives(Reunion_Natives);
|
g_amxxapi.AddNatives(Reunion_Natives);
|
||||||
}
|
}
|
||||||
|
@ -93,3 +93,9 @@ private:
|
|||||||
AMX* m_amx;
|
AMX* m_amx;
|
||||||
cell* m_params;
|
cell* m_params;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline void fillNatives(AMX_NATIVE_INFO* table, cell (AMX_NATIVE_CALL with)(AMX *, cell *))
|
||||||
|
{
|
||||||
|
for (size_t i = 0; table[i].name; i++)
|
||||||
|
table[i].func = with;
|
||||||
|
}
|
||||||
|
@ -295,6 +295,8 @@ AMX_NATIVE_INFO HookChain_Natives[] =
|
|||||||
|
|
||||||
void RegisterNatives_HookChains()
|
void RegisterNatives_HookChains()
|
||||||
{
|
{
|
||||||
if (api_cfg.hasReHLDS() || api_cfg.hasReGameDLL())
|
if (!api_cfg.hasReHLDS() && !api_cfg.hasReGameDLL())
|
||||||
|
fillNatives(HookChain_Natives, [](AMX *amx, cell *params) -> cell { MF_LogError(amx, AMX_ERR_NATIVE, "You need ReHlds or ReGameDll for use hookchains"); return FALSE; });
|
||||||
|
|
||||||
g_amxxapi.AddNatives(HookChain_Natives);
|
g_amxxapi.AddNatives(HookChain_Natives);
|
||||||
}
|
}
|
||||||
|
@ -433,9 +433,10 @@ AMX_NATIVE_INFO ReGameVars_Natives[] =
|
|||||||
|
|
||||||
void RegisterNatives_Members()
|
void RegisterNatives_Members()
|
||||||
{
|
{
|
||||||
if (api_cfg.hasReGameDLL())
|
if (!api_cfg.hasReGameDLL())
|
||||||
g_amxxapi.AddNatives(ReGameVars_Natives);
|
fillNatives(ReGameVars_Natives, [](AMX *amx, cell *params) -> cell { MF_LogError(amx, AMX_ERR_NATIVE, "%s: isn't available", "ReGameDll"); return FALSE; });
|
||||||
|
|
||||||
|
g_amxxapi.AddNatives(ReGameVars_Natives);
|
||||||
g_amxxapi.AddNatives(EngineVars_Natives);
|
g_amxxapi.AddNatives(EngineVars_Natives);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1760,11 +1760,13 @@ AMX_NATIVE_INFO Misc_Natives_Checks[] =
|
|||||||
|
|
||||||
void RegisterNatives_Misc()
|
void RegisterNatives_Misc()
|
||||||
{
|
{
|
||||||
if (api_cfg.hasReGameDLL())
|
if (!api_cfg.hasReGameDLL())
|
||||||
|
fillNatives(Misc_Natives_RG, [](AMX *amx, cell *params) -> cell { MF_LogError(amx, AMX_ERR_NATIVE, "%s: isn't available", "ReGameDll"); return FALSE; });
|
||||||
|
|
||||||
|
if (!api_cfg.hasReHLDS())
|
||||||
|
fillNatives(Misc_Natives_RH, [](AMX *amx, cell *params) -> cell { MF_LogError(amx, AMX_ERR_NATIVE, "%s: isn't available", "ReHlds"); return FALSE; });
|
||||||
|
|
||||||
g_amxxapi.AddNatives(Misc_Natives_RG);
|
g_amxxapi.AddNatives(Misc_Natives_RG);
|
||||||
|
|
||||||
if (api_cfg.hasReHLDS())
|
|
||||||
g_amxxapi.AddNatives(Misc_Natives_RH);
|
g_amxxapi.AddNatives(Misc_Natives_RH);
|
||||||
|
|
||||||
g_amxxapi.AddNatives(Misc_Natives_Checks);
|
g_amxxapi.AddNatives(Misc_Natives_Checks);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user