@@ -67,9 +67,9 @@ static int get_features()
6767static int set_feature_envs (int feat )
6868{
6969 int i = 0 ;
70- static int sz [3 ] = {1 , 1 , 1 };
71- static int len [3 ] = {0 , 0 , 0 };
72- static int tmp [3 ] = {0 , 0 , 0 };
70+ int sz [3 ] = {1 , 1 , 1 };
71+ int len [3 ] = {0 , 0 , 0 };
72+ int tmp [3 ] = {0 , 0 , 0 };
7373
7474 while (i < 3 )
7575 {
@@ -78,16 +78,13 @@ static int set_feature_envs(int feat)
7878 i ++ ;
7979 continue ;
8080 }
81- if (i == 2 )
81+ if (i == 2 && (FEAT_CMP (feat , "Fancy Graphics" )
82+ || FEAT_CMP (feat , "Smooth Lighting" )
83+ || FEAT_CMP (feat , "Animated Water" )
84+ || FEAT_CMP (feat , "Disable gui_blocks Atlas" )))
8285 {
83- if (FEAT_CMP (feat , "Fancy Graphics" )
84- || FEAT_CMP (feat , "Smooth Lighting" )
85- || FEAT_CMP (feat , "Animated Water" )
86- || FEAT_CMP (feat , "Disable gui_blocks Atlas" ))
87- {
88- i ++ ;
89- continue ;
90- }
86+ i ++ ;
87+ continue ;
9188 }
9289 if (FEAT_INT (feat ) == TRUE || (i >= 2 && i <= 3 && FEAT_CMP (feat , "Force Mob Spawning" )))
9390 {
@@ -178,6 +175,7 @@ static void toggle_cb(__attribute__((unused)) GtkWidget* check, void* udata)
178175TAB (Features , features_cb , {
179176 int i = 0 ;
180177 int last_profile ;
178+ int last_featc ;
181179 char * tmp ;
182180 char * features_buff ;
183181 GtkWidget * feature_check ;
@@ -187,6 +185,8 @@ TAB(Features, features_cb, {
187185
188186 featc = 0 ;
189187 featc = get_features ();
188+ last_featc = gmcpil_config_get_last_featc (config );
189+ last_profile = gmcpil_config_get_last_profile (config );
190190
191191 features_envs [1 ] = (char * )malloc (1 );
192192 features_envs [2 ] = (char * )malloc (1 );
@@ -202,15 +202,15 @@ TAB(Features, features_cb, {
202202 if (features_buff != NULL )
203203 {
204204 i = 0 ;
205- while (i < featc )
205+ while (i < last_featc )
206206 {
207207 FEAT_BOOL (i ) = FALSE;
208208 i ++ ;
209209 }
210210
211211 i = 0 ;
212212 tmp = strtok (features_buff , "|" );
213- while (tmp != NULL && i < featc )
213+ while (tmp != NULL && i < last_featc )
214214 {
215215 feature = get_feature (tmp );
216216 if (feature != NULL )
@@ -244,8 +244,8 @@ TAB(Features, features_cb, {
244244 }
245245
246246 features_cb (NULL , (void * )TRUE);
247+ gmcpil_config_set_last_featc (config , featc );
247248 gmcpil_config_set_features (config , features_envs [4 ]);
248- last_profile = SAFE_ATOI (gmcpil_config_get_last_profile (config ));
249249 setenv ("MCPI_FEATURE_FLAGS" , features_envs [last_profile ], 1 );
250250 gtk_container_add (GTK_CONTAINER (scroll ), vbox );
251251 gtk_box_pack_start (GTK_BOX (tab ), scroll , TRUE, TRUE, 0 );
0 commit comments