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