Maelstrom: Save the multiplayer lives and frags values when they change

From d0ae6b7dfd832ffef6586bd1b6cf212a7fff67ca Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 22 Apr 2026 23:41:26 -0700
Subject: [PATCH] Save the multiplayer lives and frags values when they change

---
 game/lobby.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/game/lobby.cpp b/game/lobby.cpp
index e4697203..656a9e38 100644
--- a/game/lobby.cpp
+++ b/game/lobby.cpp
@@ -386,6 +386,15 @@ void
 LobbyDialogDelegate::LivesChanged(void *, const char *text)
 {
 	m_game.lives = SDL_atoi(text);
+
+	if (m_state == STATE_HOSTING) {
+		if (m_game.IsDeathmatch()) {
+			prefs->SetNumber(PREFERENCES_MULTIPLAYER_FRAGS, m_game.lives);
+		} else {
+			prefs->SetNumber(PREFERENCES_MULTIPLAYER_LIVES, m_game.lives);
+		}
+	}
+
 	UpdateUI();
 }