JACoders / OpenJK

Community effort to maintain and improve Jedi Academy (SP & MP) + Jedi Outcast (SP only) released by Raven Software
GNU General Public License v2.0
1.97k stars 606 forks source link

avoid configstring index clash with base_entranced #1218

Closed Razish closed 4 months ago

Razish commented 4 months ago

Alereon pointed out that CS index 26 is used by deathsythe47/base_entranced@e62eda6, so let's try to not stamp over that with our CS_LEGACY_FIXES. Our configstring was only introduced very recently, so we can probably get away with just changing our index now.

base_entranced now also makes use of most of the other free CS indexes:

So I chose 36. I don't know if/what other mods might use this.

The next free slot is 1644 (max: 1700). We could also insert our new configstrings after this index, which hopefully no one else has? It would look like this:

diff --git a/codemp/game/bg_public.h b/codemp/game/bg_public.h
index 0326fb64f..69287fee3 100644
--- a/codemp/game/bg_public.h
+++ b/codemp/game/bg_public.h
@@ -120,8 +120,6 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #define CS_CLIENT_DUELHEALTHS  31      // nmckenzie: DUEL_HEALTH.  Hopefully adding this cs is safe and good?
 #define CS_GLOBAL_AMBIENT_SET  32

-#define CS_LEGACY_FIXES            36
-
 #define CS_AMBIENT_SET         37

 #define CS_SIEGE_STATE         (CS_AMBIENT_SET+MAX_AMBIENT_SETS)
@@ -152,7 +150,11 @@ Ghoul2 Insert End
 #define CS_TERRAINS                (CS_LIGHT_STYLES + (MAX_LIGHT_STYLES*3))
 #define CS_BSP_MODELS          (CS_TERRAINS + MAX_TERRAINS)

-#define CS_MAX                 (CS_BSP_MODELS + MAX_SUB_BSP)
+#define CS_MAX_RETAIL          (CS_BSP_MODELS + MAX_SUB_BSP)
+
+#define CS_LEGACY_FIXES            (CS_MAX_RETAIL+1)
+
+#define CS_MAX                 (CS_LEGACY_FIXES+1)

 #if (CS_MAX) > MAX_CONFIGSTRINGS
 #error overflow: (CS_MAX) > MAX_CONFIGSTRINGS

Otherwise, we can work our way backwards from MAX_CONFIGSTRINGS, but I don't like that idea :shrug: