fixed a null pointer problem in gui

This commit is contained in:
titiger
2015-09-05 22:46:15 +02:00
parent fd8e29c901
commit c3e2305e41

View File

@@ -629,7 +629,7 @@ void Gui::mouseDownDisplayUnitSkills(int posDisplay) {
const CommandType *ct = display.getCommandType(posDisplay);
// try to switch to next attack type
if(activeCommandClass == ccAttack) {
if(activeCommandClass == ccAttack && activeCommandType!=NULL) {
int maxI = unit->getType()->getCommandTypeCount();
int cmdTypeId = activeCommandType->getId();
@@ -651,7 +651,7 @@ void Gui::mouseDownDisplayUnitSkills(int posDisplay) {
}
if(ct != NULL && unit->getFaction()->reqsOk(ct)) {
activeCommandType= display.getCommandType(posDisplay);
activeCommandType= ct;
activeCommandClass= activeCommandType->getClass();
}
else {