Cargo spawns at the floor of the cargo room, item configs are fetched from the prefab instead of reloading the config files every time when placing an item
This commit is contained in:
@@ -69,12 +69,14 @@ 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(
|
||||
cargoSpawnPos.Position.X + Rand.Range(-20.0f, 20.0f, false),
|
||||
cargoRoom.Rect.Y - cargoRoom.Rect.Height + 16.0f);
|
||||
|
||||
var item = new Item(itemPrefab, cargoSpawnPos.Position + Rand.Vector(10.0f, false), cargoRoom.Submarine);
|
||||
var item = new Item(itemPrefab, position, cargoRoom.Submarine);
|
||||
item.FindHull();
|
||||
|
||||
|
||||
items.Add(item);
|
||||
|
||||
if (parent != null) parent.Combine(item);
|
||||
|
||||
Reference in New Issue
Block a user