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
@@ -104,7 +104,7 @@
</Item>
<Item
name="Nitroglyserine"
name="Nitroglycerin"
category="Material"
description="A highly unstable liquid that may explode when subjected to heat or physical shock."
spritecolor="1.0,1.0,1.0,1.0"
+3 -3
View File
@@ -129,16 +129,16 @@
<CargoMission
name="Handle with care"
description="Local reseachers are offering 2000 credits for delivering a large amount of nitroglycerine to [location2]."
description="Local reseachers are offering 2000 credits for delivering a large amount of nitroglycerin to [location2]."
commonness="15"
reward="2000"
successmessage="The chemicals have been successfully delivered.">
<Items>
<Item name="Explosive Crate">
<Item name="Nitroglyserine" amount="10"/>
<Item name="Nitroglycerin" amount="10"/>
</Item>
<Item name="Explosive Crate">
<Item name="Nitroglyserine" amount="10"/>
<Item name="Nitroglycerin" amount="10"/>
</Item>
</Items>
</CargoMission>
@@ -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);