File tree 2 files changed +11
-11
lines changed
2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -10806,12 +10806,6 @@ static void read_prefs(void)
10806
10806
opt .player_name [50 ] = '\0' ;
10807
10807
}
10808
10808
10809
- /* Check empty campaign name */
10810
- if (!opt .campaign_name )
10811
- {
10812
- opt .campaign_name = "" ;
10813
- }
10814
-
10815
10809
/* Read GUI options */
10816
10810
opt .hide_card = g_key_file_get_integer (pref_file , "gui" ,
10817
10811
"full_reduced" , NULL );
@@ -11698,12 +11692,12 @@ static void update_sensitivity()
11698
11692
int i ;
11699
11693
campaign * camp ;
11700
11694
11695
+ /* Find campaign */
11696
+ camp = find_campaign (next_campaign );
11697
+
11701
11698
/* Check for campaign */
11702
- if (strcmp ( next_campaign , "" ) )
11699
+ if (camp )
11703
11700
{
11704
- /* Find campaign */
11705
- camp = find_campaign (next_campaign );
11706
-
11707
11701
/* Set expansion button active */
11708
11702
gtk_toggle_button_set_active (
11709
11703
GTK_TOGGLE_BUTTON (expansion_radio [camp -> expanded ]), TRUE);
@@ -12283,7 +12277,7 @@ static void gui_new_parameters(GtkMenuItem *menu_item, gpointer data)
12283
12277
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog )-> vbox ), options_frame );
12284
12278
12285
12279
/* Create campaign label */
12286
- campaign_label = gtk_label_new (strcmp (opt .campaign_name , "" ) ? opt .campaign_name : "None" );
12280
+ campaign_label = gtk_label_new (( opt . campaign_name && strcmp (opt .campaign_name , "" ) ) ? opt .campaign_name : "None" );
12287
12281
12288
12282
/* Remember campaign */
12289
12283
next_campaign = opt .campaign_name ;
Original file line number Diff line number Diff line change @@ -944,6 +944,12 @@ campaign *find_campaign(char *campaign_name)
944
944
{
945
945
int i ;
946
946
947
+ /* Check for no campaign set */
948
+ if (!campaign_name )
949
+ {
950
+ return NULL ;
951
+ }
952
+
947
953
/* Loop over available campaigns */
948
954
for (i = 0 ; i < num_campaign ; i ++ )
949
955
{
You can’t perform that action at this time.
0 commit comments