From f64da81ec798e0bd9ce436d0ab5337e5344d3614 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Wed, 14 Jun 2023 09:30:34 -0400 Subject: [PATCH] ACS AddBot: Push -1 on fail instead of MAXPLAYERS --- src/acs/call-funcs.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/acs/call-funcs.cpp b/src/acs/call-funcs.cpp index bc8657118..69b648352 100644 --- a/src/acs/call-funcs.cpp +++ b/src/acs/call-funcs.cpp @@ -1908,6 +1908,7 @@ bool CallFunc_AddBot(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word botStyle_e style = BOT_STYLE_NORMAL; UINT8 newplayernum = 0; + bool success = false; (void)argC; @@ -1932,8 +1933,8 @@ bool CallFunc_AddBot(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word style = BOT_STYLE_NORMAL; } - K_AddBot(skin, difficulty, style, &newplayernum); - thread->dataStk.push(newplayernum); + success = K_AddBot(skin, difficulty, style, &newplayernum); + thread->dataStk.push(success ? newplayernum : -1); return false; }