# HG changeset patch # User Wuzzy # Date 1535932080 -7200 # Node ID d09366ca4d7bf984f7d95b95876bbc55f99f8bd2 # Parent 52959f686082d5829efc983455a58a6d9a84b108 Continental supplies: Fix health not being set immediately if skipping continent selection, provoking random continent diff -r 52959f686082 -r d09366ca4d7b share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua Mon Sep 03 01:09:14 2018 +0200 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua Mon Sep 03 01:48:00 2018 +0200 @@ -1639,8 +1639,11 @@ end end -function ShowContinentLabel() - if CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)] == 0 then +function ShowContinentLabel(continent) + if not continent then + continent = CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)] + end + if continent == 0 then AddCaption(loc("Random continent"), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) else AddCaption(CS.CONTINENT_INFORMATION[CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]][1], GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) @@ -1682,7 +1685,15 @@ CS.SELECT_CONTINENT_CHECK=false EndTurnCS(0) PlaySound(sndPlaced) - ShowContinentLabel() + if(CurrentHedgehog and CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]==0) + then + CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=GetRandom(table.maxn(CS.CONTINENT_INFORMATION))+1 + SetContinentWeapons() + HideMission() + ShowContinentLabel(0) + else + ShowContinentLabel() + end CS.CONFIRM_CONTINENT_SELECTION = -1 end