fixed problem where unhiding a gate closes it

This commit is contained in:
Tobias Ottenweller 2012-03-15 12:02:28 +01:00
parent 52a9278dfc
commit ae60da9e29

View File

@ -116,11 +116,15 @@ public class Gate
setGateBlocks(blocks);
if (blocks == null)
{
return false;
}
if (isHidden() == false)
{
fillGate(blocks);
}
setOpen(true);
return true;
@ -170,14 +174,16 @@ public class Gate
this.isHidden = isHidden;
if (isHidden == true)
removeGateBlocks();
else if (isOpen() && !open())
{
removeGateBlocks();
}
else if (this.isOpen && !open())
{
// cannot open that gate (no frame!)
this.isHidden = false;
return false;
}
return true;
}