mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-01-28 22:05:01 +01:00
Hell on Overworld
- Fixed incorrect dimension data in train map sync
This commit is contained in:
parent
86ceb9e954
commit
8ca03ded64
1 changed files with 10 additions and 1 deletions
|
@ -52,6 +52,7 @@ public class TrainMapSync {
|
||||||
|
|
||||||
// Clientside
|
// Clientside
|
||||||
public float[] prevPositions;
|
public float[] prevPositions;
|
||||||
|
public List<ResourceKey<Level>> prevDims;
|
||||||
|
|
||||||
// Updated every 5 ticks
|
// Updated every 5 ticks
|
||||||
public float[] positions;
|
public float[] positions;
|
||||||
|
@ -130,14 +131,22 @@ public class TrainMapSync {
|
||||||
|
|
||||||
public void updateFrom(TrainMapSyncEntry other, boolean light) {
|
public void updateFrom(TrainMapSyncEntry other, boolean light) {
|
||||||
prevPositions = positions;
|
prevPositions = positions;
|
||||||
|
prevDims = dimensions;
|
||||||
|
|
||||||
positions = other.positions;
|
positions = other.positions;
|
||||||
|
dimensions = other.dimensions;
|
||||||
state = other.state;
|
state = other.state;
|
||||||
signalState = other.signalState;
|
signalState = other.signalState;
|
||||||
fueled = other.fueled;
|
fueled = other.fueled;
|
||||||
backwards = other.backwards;
|
backwards = other.backwards;
|
||||||
targetStationDistance = other.targetStationDistance;
|
targetStationDistance = other.targetStationDistance;
|
||||||
|
|
||||||
|
if (prevDims != null)
|
||||||
|
for (int i = 0; i < Math.min(prevDims.size(), dimensions.size()); i++)
|
||||||
|
if (prevDims.get(i) != dimensions.get(i))
|
||||||
|
for (int j = 0; j < 6; j++)
|
||||||
|
prevPositions[i * 6 + j] = positions[i * 6 + j];
|
||||||
|
|
||||||
if (light)
|
if (light)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -252,7 +261,7 @@ public class TrainMapSync {
|
||||||
|
|
||||||
ResourceKey<Level> carriageDim = (leadingDim == null || leadingDim != trailingDim) ? null : leadingDim;
|
ResourceKey<Level> carriageDim = (leadingDim == null || leadingDim != trailingDim) ? null : leadingDim;
|
||||||
entry.dimensions.add(carriageDim);
|
entry.dimensions.add(carriageDim);
|
||||||
|
|
||||||
leadingPos = leading.getPosition(train.graph);
|
leadingPos = leading.getPosition(train.graph);
|
||||||
trailingPos = trailing.getPosition(train.graph);
|
trailingPos = trailing.getPosition(train.graph);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue