Fix station income instantly accumulating roundstart (#36572)
Fix station money accumulating roundstart
This commit is contained in:
@@ -55,13 +55,13 @@ public sealed partial class CargoSystem
|
||||
!TryComp<StationCargoBountyDatabaseComponent>(station, out var bountyDb))
|
||||
return;
|
||||
|
||||
var untilNextSkip = bountyDb.NextSkipTime - _timing.CurTime;
|
||||
var untilNextSkip = bountyDb.NextSkipTime - Timing.CurTime;
|
||||
_uiSystem.SetUiState(uid, CargoConsoleUiKey.Bounty, new CargoBountyConsoleState(bountyDb.Bounties, bountyDb.History, untilNextSkip));
|
||||
}
|
||||
|
||||
private void OnPrintLabelMessage(EntityUid uid, CargoBountyConsoleComponent component, BountyPrintLabelMessage args)
|
||||
{
|
||||
if (_timing.CurTime < component.NextPrintTime)
|
||||
if (Timing.CurTime < component.NextPrintTime)
|
||||
return;
|
||||
|
||||
if (_station.GetOwningStation(uid) is not { } station)
|
||||
@@ -71,7 +71,7 @@ public sealed partial class CargoSystem
|
||||
return;
|
||||
|
||||
var label = Spawn(component.BountyLabelId, Transform(uid).Coordinates);
|
||||
component.NextPrintTime = _timing.CurTime + component.PrintDelay;
|
||||
component.NextPrintTime = Timing.CurTime + component.PrintDelay;
|
||||
SetupBountyLabel(label, station, bounty.Value);
|
||||
_audio.PlayPvs(component.PrintSound, uid);
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public sealed partial class CargoSystem
|
||||
if (_station.GetOwningStation(uid) is not { } station || !TryComp<StationCargoBountyDatabaseComponent>(station, out var db))
|
||||
return;
|
||||
|
||||
if (_timing.CurTime < db.NextSkipTime)
|
||||
if (Timing.CurTime < db.NextSkipTime)
|
||||
return;
|
||||
|
||||
if (!TryGetBountyFromId(station, args.BountyId, out var bounty))
|
||||
@@ -101,8 +101,8 @@ public sealed partial class CargoSystem
|
||||
return;
|
||||
|
||||
FillBountyDatabase(station);
|
||||
db.NextSkipTime = _timing.CurTime + db.SkipDelay;
|
||||
var untilNextSkip = db.NextSkipTime - _timing.CurTime;
|
||||
db.NextSkipTime = Timing.CurTime + db.SkipDelay;
|
||||
var untilNextSkip = db.NextSkipTime - Timing.CurTime;
|
||||
_uiSystem.SetUiState(uid, CargoConsoleUiKey.Bounty, new CargoBountyConsoleState(db.Bounties, db.History, untilNextSkip));
|
||||
_audio.PlayPvs(component.SkipSound, uid);
|
||||
}
|
||||
@@ -471,7 +471,7 @@ public sealed partial class CargoSystem
|
||||
skipped
|
||||
? CargoBountyHistoryData.BountyResult.Skipped
|
||||
: CargoBountyHistoryData.BountyResult.Completed,
|
||||
_timing.CurTime,
|
||||
Timing.CurTime,
|
||||
actorName));
|
||||
ent.Comp.Bounties.RemoveAt(i);
|
||||
return true;
|
||||
@@ -513,7 +513,7 @@ public sealed partial class CargoSystem
|
||||
continue;
|
||||
}
|
||||
|
||||
var untilNextSkip = db.NextSkipTime - _timing.CurTime;
|
||||
var untilNextSkip = db.NextSkipTime - Timing.CurTime;
|
||||
_uiSystem.SetUiState((uid, ui), CargoConsoleUiKey.Bounty, new CargoBountyConsoleState(db.Bounties, db.History, untilNextSkip));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user