added powered update interval

This commit is contained in:
Evil Factory
2022-05-05 13:18:50 -03:00
parent f132fdb36e
commit c8ec13fb56
2 changed files with 13 additions and 1 deletions

View File

@@ -67,12 +67,19 @@ namespace Barotrauma
set { MapEntity.GapUpdateInterval = value; }
}
public int poweredUpdateInterval
{
get { return MapEntity.PoweredUpdateInterval; }
set { MapEntity.PoweredUpdateInterval = value; }
}
public int characterUpdateInterval
{
get { return Character.CharacterUpdateInterval; }
set { Character.CharacterUpdateInterval = value; }
}
public HashSet<Item> updatePriorityItems = new HashSet<Item>();
public HashSet<Character> updatePriorityCharacters = new HashSet<Character>();

View File

@@ -21,6 +21,7 @@ namespace Barotrauma
public static int MapEntityUpdateInterval = 1;
public static int GapUpdateInterval = 4;
public static int PoweredUpdateInterval = 1;
private static int mapEntityUpdateTick;
/// <summary>
@@ -591,9 +592,13 @@ namespace Barotrauma
}
}
if (mapEntityUpdateTick % PoweredUpdateInterval == 0)
{
Powered.UpdatePower(deltaTime * PoweredUpdateInterval);
}
if (mapEntityUpdateTick % MapEntityUpdateInterval == 0)
{
Powered.UpdatePower(deltaTime * MapEntityUpdateInterval);
foreach (Item item in Item.ItemList)
{
if (GameMain.LuaCs.Game.updatePriorityItems.Contains(item)) continue;