Skip to content

Commit

Permalink
Fix potential bounds exception in Smeltery.
Browse files Browse the repository at this point in the history
While playing around with trying to find the max row size of a smeltery I ran into this nice bug. Desync between capacity number and temps array.
Start out with this setup:
http://puu.sh/icShZ/041dc26b52.jpg {underneth the seared brick is more seared brick to be a valid base}
Then start digging out the trough to make the smeltery wider.
If anything falls in and updates you'll get a crash and the world won't be loadable anymore.
This little check allows for the smeltery to recover itself.
  • Loading branch information
LexManos committed Jun 5, 2015
1 parent a7405a3 commit 25c54b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java
Expand Up @@ -561,7 +561,7 @@ private void updateCurrentLiquid() {

private void updateTemperatures ()
{
for (int i = 0; i < maxBlockCapacity; i++)
for (int i = 0; i < maxBlockCapacity && i < meltingTemps.length; i++)
{
meltingTemps[i] = Smeltery.getLiquifyTemperature(inventory[i]) * 10; // temperatures are *10 for more progress control
}
Expand Down

0 comments on commit 25c54b4

Please sign in to comment.