Unstable 1.1.14.0
This commit is contained in:
@@ -162,26 +162,25 @@ namespace Barotrauma
|
||||
sw.Stop();
|
||||
GameMain.PerformanceCounter.AddElapsedTicks("Update:Level", sw.ElapsedTicks);
|
||||
|
||||
if (Character.Controlled != null)
|
||||
if (Character.Controlled is { } controlled)
|
||||
{
|
||||
if (Character.Controlled.SelectedItem != null && Character.Controlled.CanInteractWith(Character.Controlled.SelectedItem))
|
||||
if (controlled.SelectedItem != null && controlled.CanInteractWith(controlled.SelectedItem))
|
||||
{
|
||||
Character.Controlled.SelectedItem.UpdateHUD(cam, Character.Controlled, (float)deltaTime);
|
||||
controlled.SelectedItem.UpdateHUD(cam, controlled, (float)deltaTime);
|
||||
}
|
||||
if (Character.Controlled.Inventory != null)
|
||||
if (controlled.Inventory != null)
|
||||
{
|
||||
foreach (Item item in Character.Controlled.Inventory.AllItems)
|
||||
foreach (Item item in controlled.Inventory.AllItems)
|
||||
{
|
||||
if (Character.Controlled.HasEquippedItem(item))
|
||||
if (controlled.HasEquippedItem(item))
|
||||
{
|
||||
item.UpdateHUD(cam, Character.Controlled, (float)deltaTime);
|
||||
item.UpdateHUD(cam, controlled, (float)deltaTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sw.Restart();
|
||||
sw.Restart();
|
||||
|
||||
Character.UpdateAll((float)deltaTime, cam);
|
||||
#elif SERVER
|
||||
|
||||
@@ -30,28 +30,12 @@ namespace Barotrauma
|
||||
GameMain.Server.ServerSettings.SelectedLevelDifficulty = difficulty;
|
||||
lastUpdateID++;
|
||||
}
|
||||
#endif
|
||||
#if CLIENT
|
||||
#elif CLIENT
|
||||
levelDifficultyScrollBar.BarScroll = difficulty / 100.0f;
|
||||
levelDifficultyScrollBar.OnMoved(levelDifficultyScrollBar, levelDifficultyScrollBar.BarScroll);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void ToggleTraitorsEnabled(int dir)
|
||||
{
|
||||
#if SERVER
|
||||
if (GameMain.Server == null) return;
|
||||
|
||||
lastUpdateID++;
|
||||
|
||||
int index = (int)GameMain.Server.ServerSettings.TraitorsEnabled + dir;
|
||||
if (index < 0) index = 2;
|
||||
if (index > 2) index = 0;
|
||||
|
||||
SetTraitorsEnabled((YesNoMaybe)index);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void SetBotCount(int botCount)
|
||||
{
|
||||
#if SERVER
|
||||
@@ -89,13 +73,28 @@ namespace Barotrauma
|
||||
#endif
|
||||
}
|
||||
|
||||
public void SetTraitorsEnabled(YesNoMaybe enabled)
|
||||
public void SetTraitorProbability(float probability)
|
||||
{
|
||||
#if SERVER
|
||||
if (GameMain.Server != null) GameMain.Server.ServerSettings.TraitorsEnabled = enabled;
|
||||
#endif
|
||||
if (GameMain.NetworkMember != null)
|
||||
{
|
||||
GameMain.NetworkMember.ServerSettings.TraitorProbability = probability;
|
||||
}
|
||||
#if CLIENT
|
||||
traitorProbabilityText.Text = TextManager.Get(enabled.ToString());
|
||||
traitorProbabilitySlider.BarScroll = probability;
|
||||
traitorProbabilitySlider.OnMoved(traitorProbabilitySlider, traitorProbabilitySlider.BarScroll);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void SetTraitorDangerLevel(int dangerLevel)
|
||||
{
|
||||
if (GameMain.NetworkMember != null)
|
||||
{
|
||||
GameMain.NetworkMember.ServerSettings.TraitorDangerLevel = dangerLevel;
|
||||
}
|
||||
#if SERVER
|
||||
if (GameMain.Server != null) { GameMain.Server.ServerSettings.TraitorDangerLevel = dangerLevel; }
|
||||
#elif CLIENT
|
||||
SetTraitorDangerIndicators(dangerLevel);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user