Skip to content
Snippets Groups Projects
Commit c35cc6ee authored by mcmlxxix's avatar mcmlxxix
Browse files

get rid of that pesky infinite loop

parent 6f14b8a3
Branches
Tags
No related merge requests found
......@@ -781,9 +781,10 @@ function playGame(battle)
}
function moveShot(shot)
{
var newPosition=new Coords(0,0);
var count=0;
while(count<2) {
while(count<=2) {
count++;
var newPosition=new Coords(0,0);
switch(Number(shot.heading))
{
case 0:
......@@ -853,7 +854,7 @@ function playGame(battle)
}
break;
}
if(count == 2) {
if(count > 2) {
log("ERROR: infinite loop detected!");
exit();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment