aboutsummaryrefslogtreecommitdiff
path: root/src/l4dwarp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/l4dwarp.c')
-rw-r--r--src/l4dwarp.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/l4dwarp.c b/src/l4dwarp.c
index 03edb9e..7ddb4cc 100644
--- a/src/l4dwarp.c
+++ b/src/l4dwarp.c
@@ -19,6 +19,7 @@
#include <math.h>
#include "accessor.h"
+#include "chunklets/x86.h"
#include "clientcon.h"
#include "con_.h"
#include "engineapi.h"
@@ -26,13 +27,11 @@
#include "ent.h"
#include "feature.h"
#include "gamedata.h"
-#include "gametype.h"
#include "intdefs.h"
#include "langext.h"
#include "mem.h"
#include "trace.h"
#include "vcall.h"
-#include "x86.h"
#include "x86util.h"
FEATURE("Left 4 Dead warp testing")
@@ -110,10 +109,10 @@ DEF_FEAT_CCMD_HERE(sst_l4d_testwarp, "Simulate a bot warping to you "
CON_SERVERSIDE | CON_CHEAT) {
bool staystuck = false;
// TODO(autocomplete): suggest this argument
- if (cmd->argc == 2 && !strcmp(cmd->argv[1], "staystuck")) {
+ if (argc == 2 && !strcmp(argv[1], "staystuck")) {
staystuck = true;
}
- else if (cmd->argc != 1) {
+ else if (argc != 1) {
clientcon_reply("usage: sst_l4d_testwarp [staystuck]\n");
return;
}
@@ -268,9 +267,8 @@ DEF_CCMD_HERE_UNREG(sst_l4d_previewwarp, "Visualise bot warp unstuck logic "
}
}
-static bool find_EntityPlacementTest(con_cmdcb z_add_cb) {
+static bool find_EntityPlacementTest(const uchar *insns) {
#ifdef _WIN32
- const uchar *insns = (const uchar *)z_add_cb;
for (const uchar *p = insns; p - insns < 0x300;) {
// Find 0, 0x200400B and 1 being pushed to the stack
if (p[0] == X86_PUSHI8 && p[1] == 0 &&
@@ -314,7 +312,7 @@ static bool init_filter() {
INIT {
struct con_cmd *z_add = con_findcmd("z_add");
- if (!z_add || !find_EntityPlacementTest(z_add->cb)) {
+ if (!z_add || !find_EntityPlacementTest(z_add->cb_insns)) {
errmsg_errorx("couldn't find EntityPlacementTest function");
return FEAT_INCOMPAT;
}