diff --git a/src/dehacked.c b/src/dehacked.c index 175c1fcfa..9abb708a9 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -4462,20 +4462,34 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile) ignorelines(f); } } - // Last I heard this crashes the game if you try to use it - // so this is disabled for now - // -- Monster Iestyn -/* else if (fastcmp(word, "SRB2")) + else if (fastcmp(word, "SRB2")) { - INT32 ver = searchvalue(strtok(NULL, "\n")); - if (ver != PATCHVERSION) - deh_warning("Patch is for SRB2 version %d,\nonly version %d is supported", ver, PATCHVERSION); + if (isdigit(word2[0])) + { + i = atoi(word2); + if (i != PATCHVERSION) + { + deh_warning( + "Patch is for SRB2 version %d, " + "only version %d is supported", + i, + PATCHVERSION + ); + } + } + else + { + deh_warning( + "SRB2 version definition has incorrect format, " + "use \"SRB2 %d\"", + PATCHVERSION + ); + } } // Clear all data in certain locations (mostly for unlocks) // Unless you REALLY want to piss people off, // define a custom gamedata /before/ doing this!! // (then again, modifiedgame will prevent game data saving anyway) -*/ else if (fastcmp(word, "CLEAR")) { boolean clearall = (fastcmp(word2, "ALL")); diff --git a/src/dehacked.h b/src/dehacked.h index d4fb07df0..2b34377fd 100644 --- a/src/dehacked.h +++ b/src/dehacked.h @@ -47,7 +47,7 @@ extern const char *superactions[MAXRECURSION]; extern UINT8 superstack; // If the dehacked patch does not match this version, we throw a warning -#define PATCHVERSION 210 +#define PATCHVERSION 220 #define MAXLINELEN 1024