mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2025-01-26 05:38:04 +03:00
Refactor 5 - Rename original file/var for gamerules
This commit is contained in:
parent
4333255571
commit
49184c86a3
@ -15,7 +15,7 @@ binary.sources = [
|
|||||||
'fakemeta_amxx.cpp',
|
'fakemeta_amxx.cpp',
|
||||||
'pdata.cpp',
|
'pdata.cpp',
|
||||||
'pdata_entities.cpp',
|
'pdata_entities.cpp',
|
||||||
'pdata_gc.cpp',
|
'pdata_gamerules.cpp',
|
||||||
'forward.cpp',
|
'forward.cpp',
|
||||||
'fm_tr.cpp',
|
'fm_tr.cpp',
|
||||||
'pev.cpp',
|
'pev.cpp',
|
||||||
|
@ -65,7 +65,7 @@ void OnAmxxAttach()
|
|||||||
}
|
}
|
||||||
|
|
||||||
MF_AddNatives(pdata_entities_natives);
|
MF_AddNatives(pdata_entities_natives);
|
||||||
MF_AddNatives(pdata_gc_natives);
|
MF_AddNatives(pdata_gamerules_natives);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnPluginsLoaded()
|
void OnPluginsLoaded()
|
||||||
|
@ -56,7 +56,7 @@ extern AMX_NATIVE_INFO dllfunc_natives[];
|
|||||||
extern AMX_NATIVE_INFO forward_natives[];
|
extern AMX_NATIVE_INFO forward_natives[];
|
||||||
extern AMX_NATIVE_INFO pdata_natives[];
|
extern AMX_NATIVE_INFO pdata_natives[];
|
||||||
extern AMX_NATIVE_INFO pdata_entities_natives[];
|
extern AMX_NATIVE_INFO pdata_entities_natives[];
|
||||||
extern AMX_NATIVE_INFO pdata_gc_natives[];
|
extern AMX_NATIVE_INFO pdata_gamerules_natives[];
|
||||||
extern AMX_NATIVE_INFO tr_Natives[];
|
extern AMX_NATIVE_INFO tr_Natives[];
|
||||||
extern AMX_NATIVE_INFO pev_natives[];
|
extern AMX_NATIVE_INFO pev_natives[];
|
||||||
extern AMX_NATIVE_INFO glb_natives[];
|
extern AMX_NATIVE_INFO glb_natives[];
|
||||||
|
@ -105,7 +105,7 @@
|
|||||||
<ClCompile Include="..\dllfunc.cpp" />
|
<ClCompile Include="..\dllfunc.cpp" />
|
||||||
<ClCompile Include="..\engfunc.cpp" />
|
<ClCompile Include="..\engfunc.cpp" />
|
||||||
<ClCompile Include="..\pdata_entities.cpp" />
|
<ClCompile Include="..\pdata_entities.cpp" />
|
||||||
<ClCompile Include="..\pdata_gc.cpp" />
|
<ClCompile Include="..\pdata_gamerules.cpp" />
|
||||||
<ClCompile Include="..\pev.cpp" />
|
<ClCompile Include="..\pev.cpp" />
|
||||||
<ClCompile Include="..\forward.cpp" />
|
<ClCompile Include="..\forward.cpp" />
|
||||||
<ClCompile Include="..\glb.cpp" />
|
<ClCompile Include="..\glb.cpp" />
|
||||||
|
@ -71,15 +71,15 @@
|
|||||||
<ClCompile Include="..\..\..\public\sdk\amxxmodule.cpp">
|
<ClCompile Include="..\..\..\public\sdk\amxxmodule.cpp">
|
||||||
<Filter>Module SDK\SDK Base</Filter>
|
<Filter>Module SDK\SDK Base</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\pdata_gc.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\..\public\memtools\MemoryUtils.cpp">
|
<ClCompile Include="..\..\..\public\memtools\MemoryUtils.cpp">
|
||||||
<Filter>Memtools</Filter>
|
<Filter>Memtools</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\pdata_entities.cpp">
|
<ClCompile Include="..\pdata_entities.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\pdata_gamerules.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\fakemeta_amxx.h">
|
<ClInclude Include="..\fakemeta_amxx.h">
|
||||||
|
@ -14,13 +14,6 @@
|
|||||||
#include "fakemeta_amxx.h"
|
#include "fakemeta_amxx.h"
|
||||||
#include "pdata_shared.h"
|
#include "pdata_shared.h"
|
||||||
|
|
||||||
#define CHECK_GAMERULES() \
|
|
||||||
if (!GameRulesAddress) \
|
|
||||||
{ \
|
|
||||||
MF_LogError(amx, AMX_ERR_NATIVE, "%s is disabled. Check your AMXX log.", __FUNCTION__); \
|
|
||||||
return 0; \
|
|
||||||
}
|
|
||||||
|
|
||||||
// native any:get_gamerules_int(const class[], const member[], element = 0);
|
// native any:get_gamerules_int(const class[], const member[], element = 0);
|
||||||
static cell AMX_NATIVE_CALL get_gamerules_int(AMX *amx, cell *params)
|
static cell AMX_NATIVE_CALL get_gamerules_int(AMX *amx, cell *params)
|
||||||
{
|
{
|
||||||
@ -229,7 +222,7 @@ static cell AMX_NATIVE_CALL find_gamerules_info(AMX *amx, cell *params)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AMX_NATIVE_INFO pdata_gc_natives[] =
|
AMX_NATIVE_INFO pdata_gamerules_natives[] =
|
||||||
{
|
{
|
||||||
{ "get_gamerules_int" , get_gamerules_int },
|
{ "get_gamerules_int" , get_gamerules_int },
|
||||||
{ "set_gamerules_int" , set_gamerules_int },
|
{ "set_gamerules_int" , set_gamerules_int },
|
@ -63,6 +63,13 @@ enum class BaseFieldType
|
|||||||
return 0; \
|
return 0; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define CHECK_GAMERULES() \
|
||||||
|
if (!GameRulesAddress) \
|
||||||
|
{ \
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "%s is disabled. Check your AMXX log.", __FUNCTION__); \
|
||||||
|
return 0; \
|
||||||
|
}
|
||||||
|
|
||||||
class PvData
|
class PvData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -152,7 +159,7 @@ public:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
set_pdata<int16>(pObject, data.fieldOffset, static_cast<uint16>(value), element);
|
set_pdata<int16>(pObject, data.fieldOffset, static_cast<int16>(value), element);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -164,7 +171,7 @@ public:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
set_pdata<int8>(pObject, data.fieldOffset, static_cast<uint8>(value), element);
|
set_pdata<int8>(pObject, data.fieldOffset, static_cast<int8>(value), element);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user