mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-30 01:47:13 +00:00
Remove some previous asymmetric behavior kept (not introduced) in 2011-10-16T16:26:07Z!shadowm@wesnoth.org
The behavior in question was apparently put in place to avoid a segmentation fault due to unchecked access to a vector's first element; ensure there'll always be a first element instead.
This commit is contained in:
parent
75920c02ce
commit
b0e6c09d23
@ -183,12 +183,20 @@ void show_about(display &disp, const std::string &campaign)
|
|||||||
|
|
||||||
std::vector<std::string> image_list;
|
std::vector<std::string> image_list;
|
||||||
if(campaign.size() && !images[campaign].empty()){
|
if(campaign.size() && !images[campaign].empty()){
|
||||||
image_list=utils::parenthetical_split(images[campaign], ',', "(", ")");
|
image_list = utils::parenthetical_split(images[campaign], ',');
|
||||||
}else{
|
} else{
|
||||||
image_list=utils::parenthetical_split(images_default, ',', "(", ")", utils::STRIP_SPACES);
|
image_list = utils::parenthetical_split(images_default, ',');
|
||||||
}
|
}
|
||||||
surface map_image(scale_surface(image::get_image(image_list[0]), screen->w, screen->h));
|
|
||||||
if(! map_image){
|
surface map_image;
|
||||||
|
|
||||||
|
if(!image_list.empty()) {
|
||||||
|
map_image = scale_surface(image::get_image(image_list[0]), screen->w, screen->h);
|
||||||
|
} else {
|
||||||
|
image_list.push_back("");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!map_image){
|
||||||
image_list[0]=game_config::images::game_title;
|
image_list[0]=game_config::images::game_title;
|
||||||
map_image=surface(scale_surface(image::get_image(image_list[0]), screen->w, screen->h));
|
map_image=surface(scale_surface(image::get_image(image_list[0]), screen->w, screen->h));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user