(aa49312e0) Fixed bots failing to do almost anything in multiplayer due to the submarine's team ID not matching theirs
This commit is contained in:
@@ -1126,6 +1126,18 @@ namespace Barotrauma.Networking
|
|||||||
mirrorLevel: campaign.Map.CurrentLocation != campaign.Map.SelectedConnection.Locations[0]);
|
mirrorLevel: campaign.Map.CurrentLocation != campaign.Map.SelectedConnection.Locations[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < Submarine.MainSubs.Length; i++)
|
||||||
|
{
|
||||||
|
if (!loadSecondSub && i > 0) { break; }
|
||||||
|
|
||||||
|
var teamID = i == 0 ? Character.TeamType.Team1 : Character.TeamType.Team2;
|
||||||
|
Submarine.MainSubs[i].TeamID = teamID;
|
||||||
|
foreach (Submarine sub in Submarine.MainSubs[i].DockedTo)
|
||||||
|
{
|
||||||
|
sub.TeamID = teamID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Level.Loaded.EqualityCheckVal != levelEqualityCheckVal)
|
if (Level.Loaded.EqualityCheckVal != levelEqualityCheckVal)
|
||||||
{
|
{
|
||||||
string errorMsg = "Level equality check failed. The level generated at your end doesn't match the level generated by the server (seed " + Level.Loaded.Seed + ").";
|
string errorMsg = "Level equality check failed. The level generated at your end doesn't match the level generated by the server (seed " + Level.Loaded.Seed + ").";
|
||||||
|
|||||||
@@ -1767,6 +1767,12 @@ namespace Barotrauma.Networking
|
|||||||
{
|
{
|
||||||
var teamID = n == 0 ? Character.TeamType.Team1 : Character.TeamType.Team2;
|
var teamID = n == 0 ? Character.TeamType.Team1 : Character.TeamType.Team2;
|
||||||
|
|
||||||
|
Submarine.MainSubs[n].TeamID = teamID;
|
||||||
|
foreach (Submarine sub in Submarine.MainSubs[n].DockedTo)
|
||||||
|
{
|
||||||
|
sub.TeamID = teamID;
|
||||||
|
}
|
||||||
|
|
||||||
//find the clients in this team
|
//find the clients in this team
|
||||||
List<Client> teamClients = teamCount == 1 ?
|
List<Client> teamClients = teamCount == 1 ?
|
||||||
new List<Client>(connectedClients) :
|
new List<Client>(connectedClients) :
|
||||||
|
|||||||
Reference in New Issue
Block a user