- The server doesn't disable client-controlled AI characters that are far from all other players.

- Clients aren't allowed to flip swimming FishAnimControllers unless the server says so (occasionally caused creatures to flip around constantly because the clients ignore the 1-second "flipping cooldown").
- Moved Character.ReadStatus to the client project.
This commit is contained in:
Joonas Rikkonen
2017-09-21 17:44:52 +03:00
parent f291a22976
commit dd86b5745a
4 changed files with 101 additions and 103 deletions
@@ -1314,7 +1314,9 @@ namespace Barotrauma
//disable AI characters that are far away from all clients and the host's character and not controlled by anyone
c.Enabled =
c == controlled ||
c.IsRemotePlayer ||
CharacterList.Any(c2 =>
c != c2 &&
(c2.IsRemotePlayer || c2 == GameMain.Server.Character) &&
Vector2.DistanceSquared(c2.WorldPosition, c.WorldPosition) < NetConfig.CharacterIgnoreDistanceSqr);
}