Fixed possible deadlock added in the mouse support code

This commit is contained in:
Xawotihs
2010-10-12 21:53:41 +00:00
parent ce934123b0
commit bb6267bbe4
+3 -4
View File
@@ -59,7 +59,7 @@ void DuelLayers::init(){
void DuelLayers::CheckUserInput(int isAI){ void DuelLayers::CheckUserInput(int isAI){
JButton key; JButton key;
int x, y; int x, y;
while ((key = JGE::GetInstance()->ReadButton()) || JGE::GetInstance()->GetLeftClickCoordinates(x, y)) while ((key = JGE::GetInstance()->ReadButton()))
{ {
if ((!isAI) && (0 != key)) if ((!isAI) && (0 != key))
{ {
@@ -70,13 +70,12 @@ void DuelLayers::CheckUserInput(int isAI){
if (hand->CheckUserInput(key)) break; if (hand->CheckUserInput(key)) break;
if (cs->CheckUserInput(key)) break; if (cs->CheckUserInput(key)) break;
} }
else if((!isAI) && (x != -1 && y != -1)) }
if(JGE::GetInstance()->GetLeftClickCoordinates(x, y))
{ {
if (cs->CheckUserInput(x, y)) if (cs->CheckUserInput(x, y))
{ {
JGE::GetInstance()->LeftClickedProcessed(); JGE::GetInstance()->LeftClickedProcessed();
break;
}
} }
} }
} }