Skip to content

Commit

Permalink
Ship weapon functions as a separate module
Browse files Browse the repository at this point in the history
Also remove doubtful (and broken on 1.2) functions:
setdefaultweapon()
ingoreweapon()
resetignoreweapons()
  • Loading branch information
voron00 committed Feb 8, 2017
1 parent 92f58ae commit 81851a4
Show file tree
Hide file tree
Showing 10 changed files with 309 additions and 421 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@
!gsc_player.hpp
!gsc_utils.cpp
!gsc_utils.hpp
!gsc_weapons.cpp
!gsc_weapons.hpp
!libcod.cpp
!README.md
1 change: 1 addition & 0 deletions config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#define COMPILE_BOTS 1
#define COMPILE_MEMORY 1
#define COMPILE_UTILS 1
#define COMPILE_WEAPONS 1

// RATE LIMITER
#define COMPILE_RATELIMITER 1
Expand Down
3 changes: 3 additions & 0 deletions doit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ $cc $options $constants -c gsc_player.cpp -o objects_$1/gsc_player.opp
echo "##### COMPILE $1 GSC_UTILS.CPP #####"
$cc $options $constants -c gsc_utils.cpp -o objects_$1/gsc_utils.opp

echo "##### COMPILE $1 GSC_WEAPONS.CPP #####"
$cc $options $constants -c gsc_weapons.cpp -o objects_$1/gsc_weapons.opp

if [ -d extra ]; then
echo "##### COMPILE $1 EXTRAS #####"
cd extra
Expand Down
40 changes: 20 additions & 20 deletions gsc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,30 +196,30 @@ scr_function_t scriptFunctions[] =
{"dlopen", gsc_dlopen, 0},
{"dlsym", gsc_dlsym, 0},
{"dlclose", gsc_dlclose, 0},
{"resetignoredweapons", gsc_utils_resetignoredweapons, 0},
{"ignoreweapon", gsc_utils_ignoreweapon, 0},
{"setdefaultweapon", gsc_utils_setdefaultweapon, 0},
{"getweaponmaxammo", gsc_utils_getweaponmaxammo, 0},
{"getweaponclipsize", gsc_utils_getweaponclipsize, 0},
{"getweapondamage", gsc_utils_getweapondamage, 0},
{"setweapondamage", gsc_utils_setweapondamage, 0},
{"getweaponmeleedamage", gsc_utils_getweaponmeleedamage, 0},
{"setweaponmeleedamage", gsc_utils_setweaponmeleedamage, 0},
{"getweaponfiretime", gsc_utils_getweaponfiretime, 0},
{"setweaponfiretime", gsc_utils_setweaponfiretime, 0},
{"getweaponmeleetime", gsc_utils_getweaponmeleetime, 0},
{"setweaponmeleetime", gsc_utils_setweaponmeleetime, 0},
{"getweaponreloadtime", gsc_utils_getweaponreloadtime, 0},
{"setweaponreloadtime", gsc_utils_setweaponreloadtime, 0},
{"getweaponreloademptytime", gsc_utils_getweaponreloademptytime, 0},
{"setweaponreloademptytime", gsc_utils_setweaponreloademptytime, 0},
{"getweaponhitlocmultiplier", gsc_utils_getweaponhitlocmultiplier, 0},
{"setweaponhitlocmultiplier", gsc_utils_setweaponhitlocmultiplier, 0},
{"getloadedweapons", gsc_utils_getloadedweapons, 0},
{"sqrt", gsc_utils_sqrt, 0},
{"sqrtInv", gsc_utils_sqrtInv, 0},
#endif

#if COMPILE_WEAPONS == 1
{"getweaponmaxammo", gsc_weapons_getweaponmaxammo, 0},
{"getweaponclipsize", gsc_weapons_getweaponclipsize, 0},
{"getweapondamage", gsc_weapons_getweapondamage, 0},
{"setweapondamage", gsc_weapons_setweapondamage, 0},
{"getweaponmeleedamage", gsc_weapons_getweaponmeleedamage, 0},
{"setweaponmeleedamage", gsc_weapons_setweaponmeleedamage, 0},
{"getweaponfiretime", gsc_weapons_getweaponfiretime, 0},
{"setweaponfiretime", gsc_weapons_setweaponfiretime, 0},
{"getweaponmeleetime", gsc_weapons_getweaponmeleetime, 0},
{"setweaponmeleetime", gsc_weapons_setweaponmeleetime, 0},
{"getweaponreloadtime", gsc_weapons_getweaponreloadtime, 0},
{"setweaponreloadtime", gsc_weapons_setweaponreloadtime, 0},
{"getweaponreloademptytime", gsc_weapons_getweaponreloademptytime, 0},
{"setweaponreloademptytime", gsc_weapons_setweaponreloademptytime, 0},
{"getweaponhitlocmultiplier", gsc_weapons_getweaponhitlocmultiplier, 0},
{"setweaponhitlocmultiplier", gsc_weapons_setweaponhitlocmultiplier, 0},
{"getloadedweapons", gsc_weapons_getloadedweapons, 0},
#endif

#ifdef EXTRA_FUNCTIONS_INC
#include "extra/functions.hpp"
#endif
Expand Down
1 change: 1 addition & 0 deletions gsc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ extern "C" {
#include "gsc_mysql.hpp"
#include "gsc_memory.hpp"
#include "gsc_utils.hpp"
#include "gsc_weapons.hpp"
#include "cracking.hpp"

#ifdef EXTRA_INCLUDES_INC
Expand Down
Loading

0 comments on commit 81851a4

Please sign in to comment.