Fixed removed (e.g. eaten) characters not appearing in the round summary, but still spawning during the next round
This commit is contained in:
@@ -308,10 +308,13 @@ namespace Barotrauma
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
CharacterInfo deadInfo = CharacterInfos.Find(x => c.Info == x);
|
CharacterInfos.Remove(c.Info);
|
||||||
if (deadInfo != null) CharacterInfos.Remove(deadInfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//remove characterinfos whose character doesn't exist anymore
|
||||||
|
//(i.e. character was removed during the round)
|
||||||
|
CharacterInfos.RemoveAll(c => c.Character == null);
|
||||||
|
|
||||||
characters.Clear();
|
characters.Clear();
|
||||||
listBox.ClearChildren();
|
listBox.ClearChildren();
|
||||||
orderListBox.ClearChildren();
|
orderListBox.ClearChildren();
|
||||||
|
|||||||
@@ -240,6 +240,8 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
|
|
||||||
Submarine.Unload();
|
Submarine.Unload();
|
||||||
|
|
||||||
|
GameMain.LobbyScreen.Select();
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool TryEndRound(GUIButton button, object obj)
|
private bool TryEndRound(GUIButton button, object obj)
|
||||||
|
|||||||
+8
-7
@@ -59,10 +59,10 @@ namespace Barotrauma
|
|||||||
GUIListBox listBox = new GUIListBox(new Rectangle(0,y,0,90), null, Alignment.TopLeft, "", innerFrame, true);
|
GUIListBox listBox = new GUIListBox(new Rectangle(0,y,0,90), null, Alignment.TopLeft, "", innerFrame, true);
|
||||||
|
|
||||||
int x = 0;
|
int x = 0;
|
||||||
foreach (Character character in gameSession.CrewManager.characters)
|
foreach (CharacterInfo characterInfo in gameSession.CrewManager.CharacterInfos)
|
||||||
{
|
{
|
||||||
if (GameMain.GameSession.Mission is CombatMission &&
|
if (GameMain.GameSession.Mission is CombatMission &&
|
||||||
character.TeamID != GameMain.GameSession.CrewManager.WinningTeam)
|
characterInfo.TeamID != GameMain.GameSession.CrewManager.WinningTeam)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -72,15 +72,16 @@ namespace Barotrauma
|
|||||||
characterFrame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
characterFrame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
||||||
characterFrame.CanBeFocused = false;
|
characterFrame.CanBeFocused = false;
|
||||||
|
|
||||||
character.Info.CreateCharacterFrame(characterFrame,
|
characterInfo.CreateCharacterFrame(characterFrame,
|
||||||
character.Info.Job != null ? (character.Info.Name + '\n' + "(" + character.Info.Job.Name + ")") : character.Info.Name, null);
|
characterInfo.Job != null ? (characterInfo.Name + '\n' + "(" + characterInfo.Job.Name + ")") : characterInfo.Name, null);
|
||||||
|
|
||||||
string statusText = "OK";
|
string statusText = "OK";
|
||||||
Color statusColor = Color.DarkGreen;
|
Color statusColor = Color.DarkGreen;
|
||||||
|
|
||||||
if (character.IsDead)
|
Character character = characterInfo.Character;
|
||||||
|
if (character == null || character.IsDead)
|
||||||
{
|
{
|
||||||
statusText = InfoTextManager.GetInfoText("CauseOfDeath." + character.CauseOfDeath.ToString());
|
statusText = InfoTextManager.GetInfoText("CauseOfDeath." + characterInfo.CauseOfDeath.ToString());
|
||||||
statusColor = Color.DarkRed;
|
statusColor = Color.DarkRed;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -72,7 +72,16 @@ namespace Barotrauma
|
|||||||
private Item selectedConstruction;
|
private Item selectedConstruction;
|
||||||
private Item[] selectedItems;
|
private Item[] selectedItems;
|
||||||
|
|
||||||
public byte TeamID = 0;
|
private byte teamID;
|
||||||
|
public byte TeamID
|
||||||
|
{
|
||||||
|
get { return teamID; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
teamID = value;
|
||||||
|
if (info != null) info.TeamID = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public AnimController AnimController;
|
public AnimController AnimController;
|
||||||
|
|
||||||
@@ -1706,6 +1715,7 @@ namespace Barotrauma
|
|||||||
isDead = true;
|
isDead = true;
|
||||||
|
|
||||||
this.causeOfDeath = causeOfDeath;
|
this.causeOfDeath = causeOfDeath;
|
||||||
|
if (info != null) info.CauseOfDeath = causeOfDeath;
|
||||||
AnimController.movement = Vector2.Zero;
|
AnimController.movement = Vector2.Zero;
|
||||||
AnimController.TargetMovement = Vector2.Zero;
|
AnimController.TargetMovement = Vector2.Zero;
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,10 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public bool StartItemsGiven;
|
public bool StartItemsGiven;
|
||||||
|
|
||||||
|
public CauseOfDeath CauseOfDeath;
|
||||||
|
|
||||||
|
public byte TeamID;
|
||||||
|
|
||||||
public List<ushort> PickedItemIDs
|
public List<ushort> PickedItemIDs
|
||||||
{
|
{
|
||||||
get { return pickedItems; }
|
get { return pickedItems; }
|
||||||
|
|||||||
@@ -232,17 +232,6 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
if (Mission != null) Mission.End();
|
if (Mission != null) Mission.End();
|
||||||
|
|
||||||
if (GameMain.Server != null)
|
|
||||||
{
|
|
||||||
//CoroutineManager.StartCoroutine(GameMain.Server.EndGame(endMessage));
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (GameMain.Client == null)
|
|
||||||
{
|
|
||||||
//Submarine.Unload();
|
|
||||||
GameMain.LobbyScreen.Select();
|
|
||||||
}
|
|
||||||
|
|
||||||
#if CLIENT
|
#if CLIENT
|
||||||
if (roundSummary != null)
|
if (roundSummary != null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user