Skip to content

Commit e0d69a3

Browse files
authored
fix clicking LISTBOX_LOG (#3138)
1 parent d706084 commit e0d69a3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

gframe/event_handler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,7 +1978,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
19781978
switch(id) {
19791979
case LISTBOX_LOG: {
19801980
int sel = mainGame->lstLog->getSelected();
1981-
if(sel != -1 && (int)mainGame->logParam.size() >= sel && mainGame->logParam[sel]) {
1981+
if(sel >= 0 && (int)mainGame->logParam.size() > sel && mainGame->logParam[sel] > 0) {
19821982
mainGame->ShowCardInfo(mainGame->logParam[sel]);
19831983
}
19841984
return true;
@@ -1991,7 +1991,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
19911991
switch(id) {
19921992
case LISTBOX_LOG: {
19931993
int sel = mainGame->lstLog->getSelected();
1994-
if(sel != -1 && (int)mainGame->logParam.size() >= sel && mainGame->logParam[sel]) {
1994+
if(sel >= 0 && (int)mainGame->logParam.size() > sel && mainGame->logParam[sel] > 0) {
19951995
mainGame->wInfos->setActiveTab(0);
19961996
}
19971997
return true;

0 commit comments

Comments
 (0)