Fix save comment not having the proper string

This commit is contained in:
smallmodel 2024-11-02 21:00:14 +01:00
parent 6e6dac0b74
commit 6991c9f9f7
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512
2 changed files with 13 additions and 7 deletions

View file

@ -1233,7 +1233,7 @@ void TriggerSave::SaveGame(Event *ev)
void TriggerSave::EventSaveName(Event *ev)
{
m_sSaveName = ev->GetConstString(1);
m_sSaveName = ev->GetString(1);
}
void TriggerSave::Archive(Archiver& arc)

View file

@ -28,6 +28,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# include "../uilib/ui_public.h"
#endif
#include "../sys/win_localization.h"
/*
===============================================================================
@ -2049,17 +2051,21 @@ qboolean SV_ArchiveServerFile(qboolean loading, qboolean autosave)
time(&aclock);
if (autosave) {
Com_sprintf(comment, sizeof(comment), "%s - Starting", sv.configstrings[CS_MESSAGE]);
Com_sprintf(comment, sizeof(comment), "%s - %s", sv.configstrings[CS_MESSAGE], Sys_LV_CL_ConvertString("Starting"));
} else if (sv.configstrings[CS_SAVENAME] && *sv.configstrings[CS_SAVENAME]) {
Com_sprintf(
comment, sizeof(comment), "%s - %s", sv.configstrings[CS_MESSAGE], sv.configstrings[CS_SAVENAME]
);
if (com_target_game->integer >= TG_MOHTA) {
// Fixed in 2.0
// In 2.0 and above, the full save name is set by the level
Com_sprintf(comment, sizeof(comment), "%s", Sys_LV_CL_ConvertString(sv.configstrings[CS_SAVENAME]));
} else {
Com_sprintf(comment, sizeof(comment), "%s - %s", Sys_LV_CL_ConvertString(sv.configstrings[CS_MESSAGE]), Sys_LV_CL_ConvertString(sv.configstrings[CS_SAVENAME]));
}
} else {
Com_sprintf(comment, sizeof(comment), "%s", sv.configstrings[CS_MESSAGE]);
Com_sprintf(comment, sizeof(comment), "%s", Sys_LV_CL_ConvertString(sv.configstrings[CS_MESSAGE]));
}
if (strstr(name, "quick.ssv")) {
Com_sprintf(save.comment, sizeof(save.comment), "QuickSave - %s", comment);
Com_sprintf(save.comment, sizeof(save.comment), "%s - %s", Sys_LV_CL_ConvertString("QuickSave"), comment);
} else {
Q_strncpyz(save.comment, comment, sizeof(save.comment));
}