mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Fix diode reentry behaviour being wonky due to shallow history copy
Fix diode error handling, will always fail if a particle can't leave a diode
This commit is contained in:
parent
67fbcfd3c2
commit
cac7aa6705
@ -424,8 +424,14 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs
|
||||
p.cl1 = cl1;
|
||||
p.expired = expired;
|
||||
p.plugs = new ArrayList<TileEntityHadronPower>(plugs);
|
||||
p.history = new HashMap<TileEntityHadronDiode, List<ForgeDirection>>(history);
|
||||
p.cloned = true;
|
||||
|
||||
//Deep clone the history
|
||||
p.history = new HashMap<TileEntityHadronDiode, List<ForgeDirection>>(history);
|
||||
for(TileEntityHadronDiode diode : p.history.keySet()) {
|
||||
p.history.put(diode, new ArrayList<ForgeDirection>(p.history.get(diode)));
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
@ -752,8 +758,11 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs
|
||||
//Add the used direction to the main particle AFTER cloning, so the clones don't get incorrect travel history
|
||||
usedDirections.add(p.dir);
|
||||
|
||||
//If we managed to exit, keep going
|
||||
if(hasTurnedCurrent) return;
|
||||
//If we failed to exit, raise DIODE_COLLISION
|
||||
if(!hasTurnedCurrent)
|
||||
expire(p, EnumHadronState.ERROR_DIODE_COLLISION);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//next step is air or the core, proceed
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user