From 79e6bdd5fbeb8099aca2214770e42287152e96ac Mon Sep 17 00:00:00 2001 From: "Colton G. Rushton" Date: Wed, 28 Aug 2019 00:36:34 -0300 Subject: [PATCH 1/4] Update MSG_FOREVER to be much longer Bumped up the time given to bots in MSG_FOREVER to the largest possible float value in the C language. This might need testing. --- code/game/ai_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/ai_cmd.c b/code/game/ai_cmd.c index 2944fb06d3..f4d3f4ba24 100644 --- a/code/game/ai_cmd.c +++ b/code/game/ai_cmd.c @@ -208,7 +208,7 @@ float BotGetTime(bot_match_t *match) { //match it to find out if the time is in seconds or minutes if (trap_BotFindMatch(timestring, &timematch, MTCONTEXT_TIME)) { if (timematch.type == MSG_FOREVER) { - t = 99999999.0f; + t = 3.402823466e+38f; } else if (timematch.type == MSG_FORAWHILE) { t = 10 * 60; // 10 minutes From 8b295670181b4566f579e5a0db4a9f98aee18155 Mon Sep 17 00:00:00 2001 From: "Colton G. Rushton" Date: Tue, 24 Sep 2019 18:45:17 -0300 Subject: [PATCH 2/4] Add FLT_MAX to bg_lib.h --- code/game/bg_lib.h | 1 + 1 file changed, 1 insertion(+) diff --git a/code/game/bg_lib.h b/code/game/bg_lib.h index 75e3a44e3f..823af2cd21 100644 --- a/code/game/bg_lib.h +++ b/code/game/bg_lib.h @@ -56,6 +56,7 @@ typedef char * va_list; #define INT_MAX 0x7fffffff /* maximum (signed) int value */ #define INT_MIN (-INT_MAX - 1) /* minimum (signed) int value */ #define UINT_MAX 0xffffffff /* maximum unsigned int value */ +#define FLT_MAX 0x7f7fffff /* maximum float value */ #define LONG_MAX 0x7fffffffL /* maximum (signed) long value */ #define LONG_MIN (-LONG_MAX - 1) /* minimum (signed) long value */ #define ULONG_MAX 0xffffffffUL /* maximum unsigned long value */ From 2a8731186d13e45ff3850481f482cb0374544011 Mon Sep 17 00:00:00 2001 From: "Colton G. Rushton" Date: Tue, 24 Sep 2019 18:48:02 -0300 Subject: [PATCH 3/4] Update ai_cmd.c to add the FLT_MAX macro --- code/game/ai_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/ai_cmd.c b/code/game/ai_cmd.c index f4d3f4ba24..906fe5f4d7 100644 --- a/code/game/ai_cmd.c +++ b/code/game/ai_cmd.c @@ -208,7 +208,7 @@ float BotGetTime(bot_match_t *match) { //match it to find out if the time is in seconds or minutes if (trap_BotFindMatch(timestring, &timematch, MTCONTEXT_TIME)) { if (timematch.type == MSG_FOREVER) { - t = 3.402823466e+38f; + t = FLT_MAX; // 3.402823466e+38 minutes } else if (timematch.type == MSG_FORAWHILE) { t = 10 * 60; // 10 minutes From de0ebca4a59a8881e1bffa17aa99daa7862b4512 Mon Sep 17 00:00:00 2001 From: rawr51919 Date: Sat, 12 Aug 2023 16:00:19 -0300 Subject: [PATCH 4/4] Update ai_cmd.c fix comment according to zturtleman's old post in the relevant PR --- code/game/ai_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/ai_cmd.c b/code/game/ai_cmd.c index 906fe5f4d7..94beba87ea 100644 --- a/code/game/ai_cmd.c +++ b/code/game/ai_cmd.c @@ -208,7 +208,7 @@ float BotGetTime(bot_match_t *match) { //match it to find out if the time is in seconds or minutes if (trap_BotFindMatch(timestring, &timematch, MTCONTEXT_TIME)) { if (timematch.type == MSG_FOREVER) { - t = FLT_MAX; // 3.402823466e+38 minutes + t = FLT_MAX; // 3.402823466e+38 seconds } else if (timematch.type == MSG_FORAWHILE) { t = 10 * 60; // 10 minutes