Skip to content

Commit

Permalink
Fixes #344 Infinite loop when ray trace hits an unloaded block
Browse files Browse the repository at this point in the history
  • Loading branch information
joserobjr committed Dec 24, 2015
1 parent f4e7c1a commit 7a775ef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/mods/eln/misc/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -918,11 +918,11 @@ public static ArrayList<Block> traceRay(World world, double x, double y,
double d = 0;

while (d < norm) {
if (!Utils.isBlockLoaded(world, x, y, z))
continue;
Block b = Utils.getBlock(world, x, y, z);
if (b != null)
blockList.add(b);
if (Utils.isBlockLoaded(world, x, y, z)) {
Block b = Utils.getBlock(world, x, y, z);
if (b != null)
blockList.add(b);
}

x += dx;
y += dy;
Expand Down

0 comments on commit 7a775ef

Please sign in to comment.