Instead of all the natives being inside various include files, and then all included by natives.h we instead divide those natives into multiple .hpp and .cpp files, available in the natives directory. Very much mirroring the setup of our .inc files.
New way to register natives
No more global array, instead an std::vector is passed around by reference. The natives are then added to it by each .cpp module. Furthermore, macros to define native functions have been eliminated. Everything are now locally defined functions, only available in their respective .cpp file.
As of this PR, I wish that we adopt Rust's styling for .cpp and .hpp files. The extension never had a coding style to begin with, so I believe this is a good point to start introducing some.
New/updated natives
Added the following natives to the extension. The usefulness and 0 gamedata cost more than enough warrants the addition of such a useful methodmap to the extension.
Fixed CBaseNPC and CExtNPC natives not verifying invalid npc index. Leading to spectacular nullpointer crashes.
Prepare for TF2 x64 bits
In addition to everything above, speculative but correct changes have been made to hopefully prepare enough the extension for the eventual release of 64bits tf2. See alliedmodders/hl2sdk#127 for further details.
What's changed ?
Instead of all the natives being inside various include files, and then all included by
natives.h
we instead divide those natives into multiple.hpp
and.cpp
files, available in thenatives
directory. Very much mirroring the setup of our .inc files.New way to register natives
No more global array, instead an std::vector is passed around by reference. The natives are then added to it by each
.cpp
module. Furthermore, macros to define native functions have been eliminated. Everything are now locally defined functions, only available in their respective.cpp
file.Example :
New coding style for
{}
As of this PR, I wish that we adopt Rust's styling for
.cpp
and.hpp
files. The extension never had a coding style to begin with, so I believe this is a good point to start introducing some.New/updated natives
Added the following natives to the extension. The usefulness and 0 gamedata cost more than enough warrants the addition of such a useful methodmap to the extension.
Fixed
CBaseNPC
andCExtNPC
natives not verifying invalid npc index. Leading to spectacular nullpointer crashes.Prepare for TF2 x64 bits
In addition to everything above, speculative but correct changes have been made to hopefully prepare enough the extension for the eventual release of 64bits tf2. See alliedmodders/hl2sdk#127 for further details.