- clients don't spawn character jobitems themselves (item data is written in the StartGame network message)

- after receiving a StartGame message, clients will wait until the game is loaded before reading new messages from the server
- the Item(prefab, position, submarine) constructor uses the position as the center of the item, not as top-left corner
This commit is contained in:
Regalis
2016-07-29 18:38:42 +03:00
parent c773320a55
commit 4252f4b9d0
12 changed files with 146 additions and 110 deletions
+8 -3
View File
@@ -301,7 +301,12 @@ namespace Barotrauma
}
public Item(ItemPrefab itemPrefab, Vector2 position, Submarine submarine)
: this(new Rectangle((int)position.X, (int)position.Y, (int)itemPrefab.sprite.size.X, (int)itemPrefab.sprite.size.Y), itemPrefab, submarine)
: this(new Rectangle(
(int)(position.X - itemPrefab.sprite.size.X / 2),
(int)(position.Y + itemPrefab.sprite.size.Y / 2),
(int)itemPrefab.sprite.size.X,
(int)itemPrefab.sprite.size.Y),
itemPrefab, submarine)
{
}
@@ -511,6 +516,7 @@ namespace Barotrauma
return CurrentHull;
}
CurrentHull = Hull.FindHull(WorldPosition, CurrentHull);
if (body != null && body.Enabled)
{
@@ -689,8 +695,7 @@ namespace Barotrauma
ic.UpdateBroken(deltaTime, cam);
}
}
inWater = IsInWater();
if (inWater) ApplyStatusEffects(ActionType.InWater, deltaTime);