- clients ignore lobby updates if they already received a more up-to-date one

- server tells clients their ID in the first lobby update
- clients take control of a spawned character if their ID matches the ownerID of the character (-> respawning works now)
This commit is contained in:
Regalis
2017-01-11 21:31:19 +02:00
parent dc3885a2da
commit 037bd09c2c
3 changed files with 53 additions and 45 deletions
+2 -2
View File
@@ -2436,10 +2436,10 @@ namespace Barotrauma
CharacterInfo ch = new CharacterInfo(configPath, newName, isFemale ? Gender.Female : Gender.Male, jobPrefab);
ch.HeadSpriteId = headSpriteID;
character = Character.Create(configPath, position, ch, GameMain.Client.MyCharacterID != id, hasAi);
character = Character.Create(configPath, position, ch, GameMain.Client.ID != ownerId, hasAi);
character.ID = id;
if (GameMain.Client.MyCharacterID == id)
if (GameMain.Client.ID == ownerId)
{
GameMain.Client.Character = character;
Controlled = character;