refactor: remove incompatible code,

code blocking switching from attack to anothe command
This commit is contained in:
pavanvo 2022-08-16 21:58:18 +04:00
parent afc26199f7
commit ea3ede3c08
No known key found for this signature in database
GPG Key ID: 34C1C36681B4AD84
1 changed files with 1 additions and 26 deletions

View File

@ -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) {