From ea3ede3c081665ab70d76b26d57124791496bcb7 Mon Sep 17 00:00:00 2001 From: pavanvo Date: Tue, 16 Aug 2022 21:58:18 +0400 Subject: [PATCH] refactor: remove incompatible code, code blocking switching from attack to anothe command --- source/glest_game/gui/gui.cpp | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/source/glest_game/gui/gui.cpp b/source/glest_game/gui/gui.cpp index 8ace6f90..cc501604 100644 --- a/source/glest_game/gui/gui.cpp +++ b/source/glest_game/gui/gui.cpp @@ -647,29 +647,6 @@ void Gui::mouseDownDisplayUnitSkills(int posDisplay) { if(selection.isUniform()) { const CommandType *ct = display.getCommandType(posDisplay); - // try to switch to next attack type - if(activeCommandClass == ccAttack && activeCommandType!=NULL) { - - int maxI = unit->getType()->getCommandTypeCount(); - int cmdTypeId = activeCommandType->getId(); - int cmdTypeIdNext = cmdTypeId+1; - - while(cmdTypeIdNext != cmdTypeId) { - if(cmdTypeIdNext >= maxI) { - cmdTypeIdNext = 0; - } - const CommandType *ctype = display.getCommandType(cmdTypeIdNext); - if(ctype != NULL && ctype->getClass() == ccAttack) { - if(ctype != NULL && unit->getFaction()->reqsOk(ctype)) { - posDisplay=cmdTypeIdNext; - ct = display.getCommandType(posDisplay); - break; - } - } - cmdTypeIdNext++; - } - } - if(ct != NULL && unit->getFaction()->reqsOk(ct)) { activeCommandType= ct; activeCommandClass= activeCommandType->getClass(); @@ -681,9 +658,7 @@ void Gui::mouseDownDisplayUnitSkills(int posDisplay) { return; } } - - //non uniform selection - else { + else {//non uniform selection activeCommandType= NULL; activeCommandClass= display.getCommandClass(posDisplay); if (activeCommandClass == ccAttack) {