mirror of
https://github.com/glest/glest-source.git
synced 2025-08-21 15:41:24 +02:00
bugfix for crash ( when no unit is selected and display text is calculated )
This commit is contained in:
@@ -615,7 +615,7 @@ string Gui::computeDefaultInfoString(){
|
|||||||
|
|
||||||
string result="";
|
string result="";
|
||||||
|
|
||||||
if(selection.isCommandable() && selection.isUniform()){
|
if((!selection.isEmpty()) && selection.isCommandable() && selection.isUniform()){
|
||||||
// default is the description extension
|
// default is the description extension
|
||||||
result=selection.getFrontUnit()->getDescExtension();
|
result=selection.getFrontUnit()->getDescExtension();
|
||||||
}
|
}
|
||||||
@@ -631,7 +631,7 @@ void Gui::computeInfoString(int posDisplay){
|
|||||||
|
|
||||||
display.setInfoText(computeDefaultInfoString());
|
display.setInfoText(computeDefaultInfoString());
|
||||||
|
|
||||||
if(posDisplay!=invalidPos && selection.isCommandable()){
|
if((!selection.isEmpty()) && posDisplay!=invalidPos && selection.isCommandable()){
|
||||||
if(!selectingBuilding){
|
if(!selectingBuilding){
|
||||||
if(posDisplay==cancelPos){
|
if(posDisplay==cancelPos){
|
||||||
display.setInfoText(lang.get("Cancel"));
|
display.setInfoText(lang.get("Cancel"));
|
||||||
|
Reference in New Issue
Block a user