aboutsummaryrefslogtreecommitdiff
path: root/src/gameserver.c
diff options
context:
space:
mode:
authorGravatar Michael Smith <mikesmiffy128@gmail.com> 2025-08-02 14:43:19 +0100
committerGravatar Michael Smith <mikesmiffy128@gmail.com> 2025-08-02 14:43:19 +0100
commit0d905d7998a031c2d7a1cdc5d0d1148b55b610a2 (patch)
treeea73c7cadd583a8c95b4a7ba6edaa10e99067098 /src/gameserver.c
parentf2f9f18a893527ee80260a2d57bca3023f8fd44f (diff)
downloadsst-0d905d7998a031c2d7a1cdc5d0d1148b55b610a2.tar.gz
sst-0d905d7998a031c2d7a1cdc5d0d1148b55b610a2.zip
Make additional use of untyped command callbacks
Diffstat (limited to 'src/gameserver.c')
-rw-r--r--src/gameserver.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gameserver.c b/src/gameserver.c
index 6f3d394..5cd8b0c 100644
--- a/src/gameserver.c
+++ b/src/gameserver.c
@@ -35,13 +35,12 @@ static struct CGameServer *sv;
int gameserver_spawncount() { return GetSpawnCount(sv); }
-static bool find_sv(con_cmdcb pause_cb) {
+static bool find_sv(const uchar *insns) {
#ifdef _WIN32
// The last thing pause does is call BroadcastPrintf with 4 args including
// `this`, all on the stack since it's varargs. 2 of the args are pushed
// immediately before `this`, so we can just look for 3 back-to-back pushes
// and a call.
- const uchar *insns = (const uchar *)pause_cb;
int pushes = 0;
for (const uchar *p = insns; p - insns < 256;) {
if (*p == X86_PUSHIW || *p >= X86_PUSHEAX && *p <= X86_PUSHEDI) {
@@ -68,7 +67,7 @@ static bool find_sv(con_cmdcb pause_cb) {
INIT {
struct con_cmd *pause = con_findcmd("pause");
- if_cold (!find_sv(pause->cb)) {
+ if_cold (!find_sv(pause->cb_insns)) {
errmsg_errorx("couldn't find game server object");
return FEAT_INCOMPAT;
}