Fixed warning in CBrain

master
krzys-h 2015-07-22 13:56:51 +02:00
parent 329393a65a
commit 2e606f4dcb
1 changed files with 8 additions and 4 deletions

View File

@ -255,12 +255,16 @@ bool CBrain::EventProcess(const Event &event)
if(event.key.slot == INPUT_SLOT_ACTION && bAlt) if(event.key.slot == INPUT_SLOT_ACTION && bAlt)
{ {
Ui::CButton* pb = static_cast< Ui::CButton* >(pw->SearchControl(EVENT_OBJECT_PROGRUN)); pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
if(pb != nullptr) if ( pw != 0 )
{ {
if(pb->TestState(Ui::STATE_ENABLE)) Ui::CButton* pb = static_cast< Ui::CButton* >(pw->SearchControl(EVENT_OBJECT_PROGRUN));
if(pb != nullptr)
{ {
queue->AddEvent(Event(EVENT_OBJECT_PROGRUN)); if(pb->TestState(Ui::STATE_ENABLE))
{
queue->AddEvent(Event(EVENT_OBJECT_PROGRUN));
}
} }
} }
return false; return false;