refactor: remove incompatible code,
code blocking switching from attack to anothe command
This commit is contained in:
parent
afc26199f7
commit
ea3ede3c08
|
@ -647,29 +647,6 @@ void Gui::mouseDownDisplayUnitSkills(int posDisplay) {
|
||||||
if(selection.isUniform()) {
|
if(selection.isUniform()) {
|
||||||
const CommandType *ct = display.getCommandType(posDisplay);
|
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)) {
|
if(ct != NULL && unit->getFaction()->reqsOk(ct)) {
|
||||||
activeCommandType= ct;
|
activeCommandType= ct;
|
||||||
activeCommandClass= activeCommandType->getClass();
|
activeCommandClass= activeCommandType->getClass();
|
||||||
|
@ -681,9 +658,7 @@ void Gui::mouseDownDisplayUnitSkills(int posDisplay) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {//non uniform selection
|
||||||
//non uniform selection
|
|
||||||
else {
|
|
||||||
activeCommandType= NULL;
|
activeCommandType= NULL;
|
||||||
activeCommandClass= display.getCommandClass(posDisplay);
|
activeCommandClass= display.getCommandClass(posDisplay);
|
||||||
if (activeCommandClass == ccAttack) {
|
if (activeCommandClass == ccAttack) {
|
||||||
|
|
Loading…
Reference in New Issue