mirror of
https://github.com/glest/glest-source.git
synced 2025-08-29 10:49:48 +02:00
fixed a null pointer problem in gui
This commit is contained in:
@@ -629,7 +629,7 @@ void Gui::mouseDownDisplayUnitSkills(int posDisplay) {
|
|||||||
const CommandType *ct = display.getCommandType(posDisplay);
|
const CommandType *ct = display.getCommandType(posDisplay);
|
||||||
|
|
||||||
// try to switch to next attack type
|
// try to switch to next attack type
|
||||||
if(activeCommandClass == ccAttack) {
|
if(activeCommandClass == ccAttack && activeCommandType!=NULL) {
|
||||||
|
|
||||||
int maxI = unit->getType()->getCommandTypeCount();
|
int maxI = unit->getType()->getCommandTypeCount();
|
||||||
int cmdTypeId = activeCommandType->getId();
|
int cmdTypeId = activeCommandType->getId();
|
||||||
@@ -651,7 +651,7 @@ void Gui::mouseDownDisplayUnitSkills(int posDisplay) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(ct != NULL && unit->getFaction()->reqsOk(ct)) {
|
if(ct != NULL && unit->getFaction()->reqsOk(ct)) {
|
||||||
activeCommandType= display.getCommandType(posDisplay);
|
activeCommandType= ct;
|
||||||
activeCommandClass= activeCommandType->getClass();
|
activeCommandClass= activeCommandType->getClass();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user