(1968ab79f) v0.9.9.1
This commit is contained in:
@@ -343,15 +343,17 @@ namespace Barotrauma
|
||||
UInt16 targetEntityID = msg.ReadUInt16();
|
||||
int targetLimbIndex = msg.ReadByte();
|
||||
|
||||
//255 = entity already removed, no need to do anything
|
||||
if (attackLimbIndex == 255) { break; }
|
||||
|
||||
if (attackLimbIndex >= AnimController.Limbs.Length)
|
||||
{
|
||||
DebugConsole.ThrowError($"Received invalid ExecuteAttack message. Limb index out of bounds ({attackLimbIndex})");
|
||||
break;
|
||||
}
|
||||
Limb attackLimb = AnimController.Limbs[attackLimbIndex];
|
||||
IDamageable targetEntity = FindEntityByID(targetEntityID) as IDamageable;
|
||||
Limb targetLimb = null;
|
||||
if (targetEntity == null)
|
||||
if (!(FindEntityByID(targetEntityID) is IDamageable targetEntity))
|
||||
{
|
||||
DebugConsole.ThrowError($"Received invalid ExecuteAttack message. Target entity not found (ID {targetEntityID})");
|
||||
break;
|
||||
@@ -365,8 +367,10 @@ namespace Barotrauma
|
||||
}
|
||||
targetLimb = targetCharacter.AnimController.Limbs[targetLimbIndex];
|
||||
}
|
||||
|
||||
attackLimb.ExecuteAttack(targetEntity, targetLimb, out _);
|
||||
if (attackLimb?.attack != null)
|
||||
{
|
||||
attackLimb.ExecuteAttack(targetEntity, targetLimb, out _);
|
||||
}
|
||||
break;
|
||||
}
|
||||
msg.ReadPadBits();
|
||||
|
||||
@@ -2124,6 +2124,7 @@ namespace Barotrauma.Networking
|
||||
GameMain.GameSession.SubmarineInfo = new SubmarineInfo(subPath, "");
|
||||
}
|
||||
SaveUtil.LoadGame(GameMain.GameSession.SavePath, GameMain.GameSession);
|
||||
GameMain.GameSession?.SubmarineInfo?.Reload();
|
||||
GameMain.GameSession?.SubmarineInfo?.CheckSubsLeftBehind();
|
||||
if (GameMain.GameSession?.SubmarineInfo?.Name != null)
|
||||
{
|
||||
@@ -3007,6 +3008,11 @@ namespace Barotrauma.Networking
|
||||
if (GameMain.GameSession?.GameMode != null)
|
||||
{
|
||||
errorLines.Add("Game mode: " + GameMain.GameSession.GameMode.Name);
|
||||
if (GameMain.GameSession?.GameMode is MultiPlayerCampaign campaign)
|
||||
{
|
||||
errorLines.Add("Campaign ID: " + campaign.CampaignID);
|
||||
errorLines.Add("Campaign save ID: " + campaign.LastSaveID + "(pending: " + campaign.PendingSaveID + ")");
|
||||
}
|
||||
}
|
||||
if (GameMain.GameSession?.Submarine != null)
|
||||
{
|
||||
@@ -3015,6 +3021,13 @@ namespace Barotrauma.Networking
|
||||
if (Level.Loaded != null)
|
||||
{
|
||||
errorLines.Add("Level: " + Level.Loaded.Seed + ", " + Level.Loaded.EqualityCheckVal);
|
||||
errorLines.Add("Entity count before generating level: " + Level.Loaded.EntityCountBeforeGenerate);
|
||||
errorLines.Add("Entities:");
|
||||
foreach (Entity e in Level.Loaded.EntitiesBeforeGenerate)
|
||||
{
|
||||
errorLines.Add(" " + e.ID + ": " + e.ToString());
|
||||
}
|
||||
errorLines.Add("Entity count after generating level: " + Level.Loaded.EntityCountAfterGenerate);
|
||||
}
|
||||
|
||||
errorLines.Add("Entity IDs:");
|
||||
|
||||
@@ -370,7 +370,7 @@ namespace Barotrauma.Steam
|
||||
if (Enum.TryParse(lobby.GetData("traitors"), out YesNoMaybe traitorsEnabled)) { serverInfo.TraitorsEnabled = traitorsEnabled; }
|
||||
|
||||
serverInfo.GameStarted = lobby.GetData("gamestarted") == "True";
|
||||
serverInfo.GameMode = lobby.GetData("gamemode");
|
||||
serverInfo.GameMode = lobby.GetData("gamemode") ?? "";
|
||||
if (Enum.TryParse(lobby.GetData("playstyle"), out PlayStyle playStyle)) serverInfo.PlayStyle = playStyle;
|
||||
|
||||
if (serverInfo.ContentPackageNames.Count != serverInfo.ContentPackageHashes.Count ||
|
||||
@@ -1052,7 +1052,7 @@ namespace Barotrauma.Steam
|
||||
Directory.CreateDirectory(targetPath);
|
||||
File.WriteAllText(copyingPath, "TEMPORARY FILE");
|
||||
|
||||
SaveUtil.CopyFolder(item?.Directory, targetPath, copySubDirs: true, overwriteExisting: true);
|
||||
SaveUtil.CopyFolder(item?.Directory, targetPath, copySubDirs: true, overwriteExisting: item?.Owner.Id != Steamworks.SteamClient.SteamId);
|
||||
|
||||
File.Delete(copyingPath);
|
||||
return "";
|
||||
@@ -1145,7 +1145,7 @@ namespace Barotrauma.Steam
|
||||
|
||||
//make sure the destination directory exists
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(contentFile.Path));
|
||||
CorrectContentFileCopy(contentPackage, sourceFile, contentFile.Path, overwrite: true);
|
||||
CorrectContentFileCopy(contentPackage, sourceFile, contentFile.Path, overwrite: item?.Owner.Id != Steamworks.SteamClient.SteamId);
|
||||
}
|
||||
|
||||
foreach (string nonContentFile in nonContentFiles)
|
||||
@@ -1154,7 +1154,7 @@ namespace Barotrauma.Steam
|
||||
if (!File.Exists(sourceFile)) { continue; }
|
||||
string destinationPath = CorrectContentFilePath(nonContentFile, contentPackage, false);
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(destinationPath));
|
||||
CorrectContentFileCopy(contentPackage, sourceFile, destinationPath, overwrite: true);
|
||||
CorrectContentFileCopy(contentPackage, sourceFile, destinationPath, overwrite: item?.Owner.Id != Steamworks.SteamClient.SteamId);
|
||||
}
|
||||
|
||||
File.Delete(copyingPath);
|
||||
@@ -1507,6 +1507,8 @@ namespace Barotrauma.Steam
|
||||
|
||||
private static void CorrectContentFileCopy(ContentPackage package, string src, string dest, bool overwrite)
|
||||
{
|
||||
if (!overwrite && File.Exists(dest)) { return; }
|
||||
|
||||
if (Path.GetExtension(src).Equals(".xml", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
XDocument doc = XMLExtensions.TryLoadXml(src);
|
||||
@@ -1529,12 +1531,12 @@ namespace Barotrauma.Steam
|
||||
}
|
||||
else
|
||||
{
|
||||
File.Copy(src, dest, overwrite: overwrite);
|
||||
File.Copy(src, dest, overwrite: true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
File.Copy(src, dest, overwrite: overwrite);
|
||||
File.Copy(src, dest, overwrite: true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -148,7 +148,8 @@ namespace Barotrauma
|
||||
if (GameMain.Config != null)
|
||||
{
|
||||
sb.AppendLine("Graphics mode: " + GameMain.Config.GraphicsWidth + "x" + GameMain.Config.GraphicsHeight + " (" + GameMain.Config.WindowMode.ToString() + ")");
|
||||
sb.AppendLine("VSync "+ (GameMain.Config.VSyncEnabled ? "ON" : "OFF"));
|
||||
sb.AppendLine("VSync " + (GameMain.Config.VSyncEnabled ? "ON" : "OFF"));
|
||||
sb.AppendLine("Language: " + (GameMain.Config.Language ?? "none"));
|
||||
}
|
||||
if (GameMain.SelectedPackages != null)
|
||||
{
|
||||
|
||||
@@ -422,7 +422,7 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
// Game mode Selection
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.05f), filters.Content.RectTransform), TextManager.Get("gamemode")) { CanBeFocused = false };
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.05f), filters.Content.RectTransform), TextManager.Get("gamemode"), font: GUI.SubHeadingFont) { CanBeFocused = false };
|
||||
|
||||
gameModeTickBoxes = new List<GUITickBox>();
|
||||
foreach (GameModePreset mode in GameModePreset.List)
|
||||
@@ -1013,7 +1013,7 @@ namespace Barotrauma
|
||||
foreach (GUITickBox tickBox in gameModeTickBoxes)
|
||||
{
|
||||
var gameMode = (string)tickBox.UserData;
|
||||
if (!tickBox.Selected && serverInfo.GameMode.Equals(gameMode, StringComparison.OrdinalIgnoreCase))
|
||||
if (!tickBox.Selected && serverInfo.GameMode != null && serverInfo.GameMode.Equals(gameMode, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
child.Visible = false;
|
||||
break;
|
||||
|
||||
@@ -3103,8 +3103,7 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
// TODO adjust when the new inventory stuff rolls in
|
||||
if (PlayerInput.KeyHit(Keys.Q) && mode == Mode.Default)
|
||||
if (GameMain.Config.KeyBind(InputType.ToggleInventory).IsHit() && mode == Mode.Default)
|
||||
{
|
||||
toggleEntityMenuButton.OnClicked?.Invoke(toggleEntityMenuButton, toggleEntityMenuButton.UserData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user