#Thermal Signature/Heat System not updating properly
1 messages · Page 1 of 1 (latest)
nope
strange, notable is that LastUpdateHeat isn't being updated seemingly
my theory is that it just only uses the heat that it gets when it shows up on the mass scanner and it stays static
wat is it..
public override void Update(float frameTime)
{
if (_timing.CurTime < _nextUpdateTime)
return;
_nextUpdateTime = _timing.CurTime + UpdateInterval;
var gridQuery = EntityQueryEnumerator<MapGridComponent, ThermalSignatureComponent>();
while (gridQuery.MoveNext(out _, out _, out var gridSigComp))
{
gridSigComp.TotalHeat = 0f;
}
var query = EntityQueryEnumerator<ThermalSignatureComponent>();
while (query.MoveNext(out var uid, out var sigComp))
{
var ev = new GetThermalSignatureEvent();
RaiseLocalEvent(uid, ref ev);
sigComp.StoredHeat += ev.Signature * UpdateIntervalSeconds;
sigComp.StoredHeat *= MathF.Pow(sigComp.HeatDissipation, UpdateIntervalSeconds);
if (_mapGridQuery.HasComp(uid))
{
sigComp.TotalHeat += sigComp.StoredHeat;
// don't sync it if it didn't change heat much since last time, we don't need to sync 500 cold asteroids every system update
if (sigComp.TotalHeat <= sigComp.LastUpdateHeat * HeatChangeThreshold
&& sigComp.TotalHeat >= sigComp.LastUpdateHeat / HeatChangeThreshold)
continue;
sigComp.LastUpdateHeat = sigComp.TotalHeat;
Dirty(uid, sigComp);
}
else
{
var xform = Transform(uid);
sigComp.TotalHeat = sigComp.StoredHeat;
if (xform.GridUid != null && _sigQuery.TryGetComponent(xform.GridUid.Value, out var gridSig))
gridSig.TotalHeat += sigComp.StoredHeat;
}
}
}
do you see it
uhh no
it updates grids in the same loop as other entities
which means it can go through a couple entities, run into the grid, then update the rest
ahh ok
after having synced only partially updated heat
resolved i think