Audio Fixes

Reactor load RTPC wasn't being set correctly
Turns out you actually have to assign audio emitter positions manually, wow
This commit is contained in:
Reinier Vens 2021-03-16 18:17:38 +00:00
commit c0494ee3d8
11 changed files with 107 additions and 61 deletions

View file

@ -80,7 +80,6 @@ public class Reactor : IBehavior, IOrderedBehavior
// This behavior executes last, so any components drawing power have already done so
CurrentLoadRatio = Draw / max(charge, .01f);
// Subtract the baseline charge from draw
Draw -= charge;
@ -90,6 +89,7 @@ public class Reactor : IBehavior, IOrderedBehavior
// We have an energy deficit, have to overload the reactor
if (Draw > .01f)
{
CurrentLoadRatio = (Draw + charge) / max(charge, .01f);
var overloadEfficiency = Item.Evaluate(_data.OverloadEfficiency);
// Generate heat using overload efficiency, usually much less efficient!
@ -122,9 +122,14 @@ public class Reactor : IBehavior, IOrderedBehavior
// We still have an energy surplus, try to throttle the reactor to reduce heat generation
if (Draw < -.01f)
{
CurrentLoadRatio = (Draw + charge) / max(charge, .01f);
heat -= Draw / efficiency * (1 - 1 / Item.Evaluate(_data.ThrottlingFactor));
Draw = 0;
}
else
{
CurrentLoadRatio = 1;
}
Item.AddHeat(heat);
return true;