Refactor 5 - Rename original file/var for gamerules

This commit is contained in:
Arkshine 2015-10-29 12:29:30 +01:00
parent 4333255571
commit 49184c86a3
7 changed files with 17 additions and 17 deletions

View File

@ -15,7 +15,7 @@ binary.sources = [
'fakemeta_amxx.cpp',
'pdata.cpp',
'pdata_entities.cpp',
'pdata_gc.cpp',
'pdata_gamerules.cpp',
'forward.cpp',
'fm_tr.cpp',
'pev.cpp',

View File

@ -65,7 +65,7 @@ void OnAmxxAttach()
}
MF_AddNatives(pdata_entities_natives);
MF_AddNatives(pdata_gc_natives);
MF_AddNatives(pdata_gamerules_natives);
}
void OnPluginsLoaded()

View File

@ -56,7 +56,7 @@ extern AMX_NATIVE_INFO dllfunc_natives[];
extern AMX_NATIVE_INFO forward_natives[];
extern AMX_NATIVE_INFO pdata_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 pev_natives[];
extern AMX_NATIVE_INFO glb_natives[];

View File

@ -105,7 +105,7 @@
<ClCompile Include="..\dllfunc.cpp" />
<ClCompile Include="..\engfunc.cpp" />
<ClCompile Include="..\pdata_entities.cpp" />
<ClCompile Include="..\pdata_gc.cpp" />
<ClCompile Include="..\pdata_gamerules.cpp" />
<ClCompile Include="..\pev.cpp" />
<ClCompile Include="..\forward.cpp" />
<ClCompile Include="..\glb.cpp" />

View File

@ -71,15 +71,15 @@
<ClCompile Include="..\..\..\public\sdk\amxxmodule.cpp">
<Filter>Module SDK\SDK Base</Filter>
</ClCompile>
<ClCompile Include="..\pdata_gc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\public\memtools\MemoryUtils.cpp">
<Filter>Memtools</Filter>
</ClCompile>
<ClCompile Include="..\pdata_entities.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\pdata_gamerules.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\fakemeta_amxx.h">

View File

@ -14,13 +14,6 @@
#include "fakemeta_amxx.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);
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 },
{ "set_gamerules_int" , set_gamerules_int },

View File

@ -63,6 +63,13 @@ enum class BaseFieldType
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
{
public:
@ -152,7 +159,7 @@ public:
}
else
{
set_pdata<int16>(pObject, data.fieldOffset, static_cast<uint16>(value), element);
set_pdata<int16>(pObject, data.fieldOffset, static_cast<int16>(value), element);
}
break;
}
@ -164,7 +171,7 @@ public:
}
else
{
set_pdata<int8>(pObject, data.fieldOffset, static_cast<uint8>(value), element);
set_pdata<int8>(pObject, data.fieldOffset, static_cast<int8>(value), element);
}
break;
}