diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 459e185e3..11c9b9fcb 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -884,6 +884,8 @@ consvar_t cv_automate = CVAR_INIT ("automate", "On", CV_NETVAR, CV_OnOff, NULL); consvar_t cv_debugmappatch = CVAR_INIT ("debugmappatch", "", 0, NULL, NULL); +consvar_t cv_allowmismatchmappatch = CVAR_INIT ("allowmismatchmappatch", "No", CV_NETVAR, CV_YesNo, NULL); + char timedemo_name[256]; boolean timedemo_csv; char timedemo_csv_id[256]; @@ -1212,6 +1214,7 @@ void D_RegisterServerCommands(void) #endif CV_RegisterVar(&cv_debugmappatch); + CV_RegisterVar(&cv_allowmismatchmappatch); COM_AddCommand("playsound", Command_PlaySound); RegisterNetXCmd(XD_PLAYSOUND, Got_PlaySound); diff --git a/src/d_netcmd.h b/src/d_netcmd.h index e938097fe..0fef71239 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -324,6 +324,8 @@ extern consvar_t cv_schedule; extern consvar_t cv_debugmappatch; +extern consvar_t cv_allowmismatchmappatch; + extern char timedemo_name[256]; extern boolean timedemo_csv; extern char timedemo_csv_id[256]; diff --git a/src/p_setup.c b/src/p_setup.c index cf165e9f3..3acc8325a 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1474,6 +1474,7 @@ static boolean TextmapCount(size_t size, boolean patch) if (!fastcmp(tkn, "namespace")) { CONS_Alert(CONS_ERROR, "No namespace at beginning of lump!\n"); + TracyCZoneEnd(__zone); return false; } @@ -1482,6 +1483,7 @@ static boolean TextmapCount(size_t size, boolean patch) if (!fastcmp(tkn, "blankart-patch")) { CONS_Alert(CONS_ERROR, "Invalid namespace '%s'. Only 'blankart-patch' is supported.\n", tkn); + TracyCZoneEnd(__zone); return false; } } @@ -1514,6 +1516,7 @@ static boolean TextmapCount(size_t size, boolean patch) if (!fastcmp(tkn, "checksum")) { CONS_Alert(CONS_ERROR, "No checksum in lump!\n"); + TracyCZoneEnd(__zone); return false; } @@ -1532,6 +1535,7 @@ static boolean TextmapCount(size_t size, boolean patch) if (end == hashstr || (*end && *end != '|')) { CONS_Alert(CONS_ERROR, "Invalid checksum string '%s'\n", tkn); + TracyCZoneEnd(__zone); return false; } hashstr = end + 1; @@ -1540,7 +1544,14 @@ static boolean TextmapCount(size_t size, boolean patch) tkn = M_TokenizerRead(0); if (!foundhash) + { CONS_Alert(CONS_WARNING, "This map patch is not compatible with the current map (checksum: " HASHFMT "). The patch may not work.\n", maphash); + if (cv_allowmismatchmappatch.value) + { + TracyCZoneEnd(__zone); + return false; + } + } } // check for things to remove from the base map @@ -1566,6 +1577,7 @@ static boolean TextmapCount(size_t size, boolean patch) if (end == typestr || (*end && *end != '|')) { CONS_Alert(CONS_ERROR, "Invalid basemaptyperemoval string '%s'\n", tkn); + TracyCZoneEnd(__zone); return false; }