Fixed possible deadlock added in the mouse support code
This commit is contained in:
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user