(27eca7ad9) Some network optimization: - Don't create network events for hulls that are very far from all clients (e.g. ruin hulls). - Don't create network events for triggers that are set to limit the triggerer's velocity when there are no triggerers.
This commit is contained in:
@@ -432,12 +432,16 @@ namespace Barotrauma
|
||||
{
|
||||
if (ForceFluctuationStrength > 0.0f)
|
||||
{
|
||||
forceFluctuationTimer += deltaTime;
|
||||
if (forceFluctuationTimer > ForceFluctuationInterval)
|
||||
//no need for force fluctuation (or network updates) if the trigger limits velocity and there are no triggerers
|
||||
if (forceMode != TriggerForceMode.LimitVelocity || triggerers.Any())
|
||||
{
|
||||
NeedsNetworkSyncing = true;
|
||||
currentForceFluctuation = Rand.Range(1.0f - ForceFluctuationStrength, 1.0f);
|
||||
forceFluctuationTimer = 0.0f;
|
||||
forceFluctuationTimer += deltaTime;
|
||||
if (forceFluctuationTimer > ForceFluctuationInterval)
|
||||
{
|
||||
NeedsNetworkSyncing = true;
|
||||
currentForceFluctuation = Rand.Range(1.0f - ForceFluctuationStrength, 1.0f);
|
||||
forceFluctuationTimer = 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user