added powered update interval
This commit is contained in:
@@ -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>();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user