Skip to content

Commit

Permalink
LOC FILES: Always load when playing back demo
Browse files Browse the repository at this point in the history
Reported as broken by !Nico on Discord
Previous forced to always load by MVD stats code,
  which was fixed by QW-Group@84cb09d
But didn't load .locs during demoplayback by default
  (this seems over 17 years old)
Now always load during demoplayback, and get rid of
  the workaround in mvd stats code
  • Loading branch information
meag committed Feb 24, 2021
1 parent 24e83be commit d8b6125
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
3 changes: 0 additions & 3 deletions match_tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ cvar_t match_name_on = {"match_name_on", "on"};
cvar_t match_name_nick = {"match_name_nick", ""};
cvar_t match_name_spec = {"match_name_spec", "(SPEC)"};

int loc_loaded = 0;

char *CL_DemoDirectory(void);

static char *MT_CleanString(char *string, qbool allow_spaces_and_slashes) {
Expand Down Expand Up @@ -754,7 +752,6 @@ void MT_NewMap(void)
{
MT_CancelMatch();
MT_ClearClientState();
loc_loaded=0;
}

void MT_Disconnect(void)
Expand Down
8 changes: 0 additions & 8 deletions mvd_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ static int fixed_ordering = 0;

extern cvar_t tp_name_none, tp_weapon_order;
char mvd_info_best_weapon[20];
extern int loc_loaded;

extern qbool TP_LoadLocFile(char* path, qbool quiet);
extern char* TP_LocationName(vec3_t location);
Expand Down Expand Up @@ -1045,7 +1044,6 @@ char* MVD_BestAmmo(int i) {
}
}


void MVD_Info(void) {
char str[1024];
char mvd_info_final_string[1024], mvd_info_powerups[20], mvd_info_header_string[1024];
Expand All @@ -1059,12 +1057,6 @@ void MVD_Info(void) {

z = 1;

if (loc_loaded == 0) {
char* mapname = TP_MapName();
TP_LoadLocFile(mapname, true);
loc_loaded = 1;
}

if (!mvd_info.value)
return;

Expand Down
4 changes: 3 additions & 1 deletion teamplay_locfiles.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,9 @@ void TP_LocFiles_NewMap(void)

if (strcmp(mapname, last_map)) { // map name has changed
TP_ClearLocs(); // clear loc file
if (tp_loadlocs.integer && cl.deathmatch && !cls.demoplayback) {

// always load when playing back demos (teaminfo might be enabled etc)
if ((tp_loadlocs.integer && cl.deathmatch) || cls.demoplayback) {
if (!TP_LoadLocFile(va("%s.loc", mapname), true)) {
if ((groupname = TP_GetMapGroupName(mapname, &system)) && !system) {
TP_LoadLocFile(va("%s.loc", groupname), true);
Expand Down

0 comments on commit d8b6125

Please sign in to comment.