2f107db...5202af9
This commit is contained in:
@@ -23,6 +23,7 @@ namespace Barotrauma
|
||||
public AICharacter(string file, Vector2 position, string seed, CharacterInfo characterInfo = null, bool isNetworkPlayer = false, RagdollParams ragdoll = null)
|
||||
: base(file, position, seed, characterInfo, isNetworkPlayer, ragdoll)
|
||||
{
|
||||
InitProjSpecific();
|
||||
}
|
||||
|
||||
partial void InitProjSpecific();
|
||||
@@ -50,12 +51,13 @@ namespace Barotrauma
|
||||
if (!IsRemotePlayer)
|
||||
{
|
||||
float characterDist = Vector2.DistanceSquared(cam.WorldViewCenter, WorldPosition);
|
||||
#if SERVER
|
||||
if (GameMain.Server != null)
|
||||
{
|
||||
//get the distance from the closest player to this character
|
||||
foreach (Character c in CharacterList)
|
||||
{
|
||||
if (c != this && (c.IsRemotePlayer || c == GameMain.Server.Character))
|
||||
if (c != this && c.IsRemotePlayer)
|
||||
{
|
||||
float dist = Vector2.DistanceSquared(c.WorldPosition, WorldPosition);
|
||||
if (dist < characterDist)
|
||||
@@ -66,6 +68,7 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (characterDist > EnableSimplePhysicsDistSqr)
|
||||
{
|
||||
@@ -78,15 +81,14 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
if (IsDead || Vitality <= 0.0f || IsUnconscious || Stun > 0.0f) return;
|
||||
if (Controlled == this || !aiController.Enabled) return;
|
||||
if (!aiController.Enabled) return;
|
||||
if (GameMain.NetworkMember != null && !GameMain.NetworkMember.IsServer) return;
|
||||
if (Controlled == this) return;
|
||||
|
||||
SoundUpdate(deltaTime);
|
||||
|
||||
if (!IsRemotePlayer)
|
||||
{
|
||||
aiController.Update(deltaTime);
|
||||
}
|
||||
}
|
||||
partial void SoundUpdate(float deltaTime);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user