SteamWar/BauSystem2.0
Archiviert
12
0

Hotfixed failsafe
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
D4rkr34lm 2024-04-28 12:30:07 +02:00
Ursprung 929400b4d9
Commit ddb701cbd6

Datei anzeigen

@ -129,10 +129,18 @@ public class TraceRecorder implements Listener {
private void record() { private void record() {
for (Region region : activeTraces.keySet()) { for (Region region : activeTraces.keySet()) {
TraceRecordingWrapper wrappedTrace = activeTraces.get(region); TraceRecordingWrapper wrappedTrace = activeTraces.get(region);
for (TNTPrimed tnt : trackedTNT.getOrDefault(region, Collections.emptyList())) { Iterator<TNTPrimed> iter = trackedTNT.getOrDefault(region, Collections.emptyList()).iterator();
while (iter.hasNext()) {
TNTPrimed tnt = iter.next();
TNTPoint record = record(tnt, wrappedTrace, Collections.emptyList()); TNTPoint record = record(tnt, wrappedTrace, Collections.emptyList());
if (record == null) continue; if (record == null) {
wrappedTrace.addRecord(record); iter.remove();
tntSpawnRegion.remove(tnt);
historyMap.remove(tnt);
tntSpawnRegion.remove(tnt);
} else {
wrappedTrace.addRecord(record);
}
} }
wrappedTrace.commitRecorded(); wrappedTrace.commitRecorded();
} }
@ -150,12 +158,6 @@ public class TraceRecorder implements Listener {
List<TNTPoint> history = historyMap.getOrDefault(tntPrimed, new ArrayList<>()); List<TNTPoint> history = historyMap.getOrDefault(tntPrimed, new ArrayList<>());
// Failsave for tnt entering unloaded chunks // Failsave for tnt entering unloaded chunks
if (tntPrimed.isDead() || history.size() > 0 && history.get(history.size() - 1).getFuse() == tntPrimed.getFuseTicks()) { if (tntPrimed.isDead() || history.size() > 0 && history.get(history.size() - 1).getFuse() == tntPrimed.getFuseTicks()) {
Region region = tntSpawnRegion.get(tntPrimed);
if (region == null) return null;
trackedTNT.get(region).remove(tntPrimed);
tntSpawnRegion.remove(tntPrimed);
historyMap.remove(tntPrimed);
tntSpawnRegion.remove(tntPrimed);
return null; return null;
} }