Fix player data not updating on diplomacy change

f39e71cca0 moved the player data refresh after a diplomacy change
into a diplomacy colors change handler, which only runs when
diplomacy colors are enabled. With them disabled, the diplomacy
dialog's stance buttons didn't reflect the new stances.

Refresh the player data directly in the diplomacy notification
handler, before the diplomacy colors are recomputed, and remove
the now redundant diplomacy colors handler registration.
This commit is contained in:
Atrik
2026-09-13 10:44:47 +02:00
committed by Vantha
parent 779021c9dc
commit 0322d039f6
2 changed files with 1 additions and 1 deletions
@@ -146,6 +146,7 @@ var g_NotificationsTypes =
},
"diplomacy": function(notification, player)
{
updatePlayerData();
g_DiplomacyColors.onDiplomacyChange();
addChatMessage({
@@ -358,7 +358,6 @@ async function init(initData, hotloadData)
handler();
registerPlayersFinishedHandler(updatePlayerData);
g_DiplomacyColors.registerDiplomacyColorsChangeHandler(updatePlayerData);
registerCeasefireEndedHandler(updatePlayerData);
if (hotloadData)