Nitroglyserine -> nitroglycerin, fixed Mission.LoadRandom returning null if the missiontype parameter isn't set, cargo is placed at the cargo spawnpoint instead of a random position within the hull it's inside

This commit is contained in:
Regalis
2016-05-26 16:04:37 +03:00
parent da98ade77c
commit 1d06522bd8
4 changed files with 12 additions and 8 deletions
@@ -69,11 +69,11 @@ namespace Barotrauma
return;
}
Vector2 position = new Vector2(
Rand.Range(cargoRoom.Rect.X + 20, cargoRoom.Rect.Right - 20, false),
cargoRoom.Rect.Y - cargoRoom.Rect.Height + 10.0f);
//Vector2 position = new Vector2(
// Rand.Range(cargoRoom.Rect.X + 20, cargoRoom.Rect.Right - 20, false),
// cargoRoom.Rect.Y - cargoRoom.Rect.Height + 10.0f);
var item = new Item(itemPrefab, position, cargoRoom.Submarine);
var item = new Item(itemPrefab, cargoSpawnPos.Position + Rand.Vector(10.0f, false), cargoRoom.Submarine);
item.FindHull();
items.Add(item);
@@ -137,6 +137,10 @@ namespace Barotrauma
{
return null;
}
else if (string.IsNullOrWhiteSpace(missionType))
{
matchingElements = doc.Root.Elements().ToList();
}
else
{
matchingElements = doc.Root.Elements().ToList().FindAll(m => m.Name.ToString().ToLowerInvariant().Replace("mission", "") == missionType);