Submarine saving fixes, impact damage in sub-sub collisions, submarine ambient sounds
This commit is contained in:
@@ -1438,6 +1438,8 @@ namespace Barotrauma
|
||||
|
||||
element.Add(new XAttribute("name", prefab.Name),
|
||||
new XAttribute("ID", ID));
|
||||
|
||||
System.Diagnostics.Debug.Assert(Submarine != null);
|
||||
|
||||
if (ResizeHorizontal || ResizeVertical)
|
||||
{
|
||||
|
||||
@@ -13,20 +13,20 @@ namespace Barotrauma
|
||||
spawnQueue = new Queue<Pair<ItemPrefab, object>>();
|
||||
}
|
||||
|
||||
public void QueueItem(ItemPrefab itemPrefab, Vector2 position, bool isNetworkMessage = false)
|
||||
{
|
||||
if (!isNetworkMessage && GameMain.Client!=null)
|
||||
{
|
||||
//clients aren't allowed to spawn new items unless the server says so
|
||||
return;
|
||||
}
|
||||
//public void QueueItem(ItemPrefab itemPrefab, Vector2 position, bool isNetworkMessage = false)
|
||||
//{
|
||||
// if (!isNetworkMessage && GameMain.Client!=null)
|
||||
// {
|
||||
// //clients aren't allowed to spawn new items unless the server says so
|
||||
// return;
|
||||
// }
|
||||
|
||||
var itemInfo = new Pair<ItemPrefab, object>();
|
||||
itemInfo.First = itemPrefab;
|
||||
itemInfo.Second = position;
|
||||
// var itemInfo = new Pair<ItemPrefab, object>();
|
||||
// itemInfo.First = itemPrefab;
|
||||
// itemInfo.Second = position;
|
||||
|
||||
spawnQueue.Enqueue(itemInfo);
|
||||
}
|
||||
// spawnQueue.Enqueue(itemInfo);
|
||||
//}
|
||||
|
||||
public void QueueItem(ItemPrefab itemPrefab, Inventory inventory, bool isNetworkMessage = false)
|
||||
{
|
||||
@@ -54,16 +54,17 @@ namespace Barotrauma
|
||||
{
|
||||
var itemInfo = spawnQueue.Dequeue();
|
||||
|
||||
if (itemInfo.Second is Vector2)
|
||||
{
|
||||
//todo: take multiple subs into account
|
||||
Vector2 position = (Vector2)itemInfo.Second - Submarine.MainSub.HiddenSubPosition;
|
||||
//if (itemInfo.Second is Vector2)
|
||||
//{
|
||||
// //todo: take multiple subs into account
|
||||
// Vector2 position = (Vector2)itemInfo.Second - Submarine.MainSub.HiddenSubPosition;
|
||||
|
||||
items.Add(new Item(itemInfo.First, position, null));
|
||||
inventories.Add(null);
|
||||
// items.Add(new Item(itemInfo.First, position, null));
|
||||
// inventories.Add(null);
|
||||
|
||||
}
|
||||
else if (itemInfo.Second is Inventory)
|
||||
//}
|
||||
//else
|
||||
if (itemInfo.Second is Inventory)
|
||||
{
|
||||
var item = new Item(itemInfo.First, Vector2.Zero, null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user