@@ -221,23 +221,67 @@ void dsda_InitSkills(void) {
221
221
}
222
222
}
223
223
224
- static void dsda_ResetGameFlags (void )
224
+ // At startup, set-up temp game modifier configs based off args / persistent cfgs
225
+ // Only set once, as modifiers can break away from args
226
+ //
227
+ // "Always Pistol Start" is the only persistent cfg (saved in cfg file)
228
+ //
229
+
230
+ void dsda_InitGameModifiers (void )
231
+ {
232
+ if (dsda_Flag (dsda_arg_pistol_start ) || dsda_IntConfig (dsda_config_always_pistol_start ))
233
+ dsda_UpdateIntConfig (dsda_config_pistol_start , true, true);
234
+ if (dsda_Flag (dsda_arg_respawn ))
235
+ dsda_UpdateIntConfig (dsda_config_respawn_monsters , true, true);
236
+ if (dsda_Flag (dsda_arg_fast ))
237
+ dsda_UpdateIntConfig (dsda_config_fast_monsters , true, true);
238
+ if (dsda_Flag (dsda_arg_nomonsters ))
239
+ dsda_UpdateIntConfig (dsda_config_no_monsters , true, true);
240
+ if (dsda_Flag (dsda_arg_coop_spawns ))
241
+ dsda_UpdateIntConfig (dsda_config_coop_spawns , true, true);
242
+ }
243
+
244
+ // if "Pistol Start" is disabled, disable "Always Pistol Start" (avoid impossible condition)
245
+ void dsda_RefreshPistolStart (void )
246
+ {
247
+ dboolean pistol_start_conflict = dsda_IntConfig (dsda_config_always_pistol_start ) && !dsda_IntConfig (dsda_config_pistol_start );
248
+
249
+ if (allow_incompatibility || in_game )
250
+ if (pistol_start_conflict )
251
+ {
252
+ dsda_UpdateIntConfig (dsda_config_always_pistol_start , false, true);
253
+ dsda_ResetGameModifiers ();
254
+ }
255
+ }
256
+
257
+ // if "Always Pistol Start" is enabled, enable "Pistol Start" (avoid impossible condition)
258
+ void dsda_RefreshAlwaysPistolStart (void )
259
+ {
260
+ dboolean pistol_start_conflict = dsda_IntConfig (dsda_config_always_pistol_start ) && !dsda_IntConfig (dsda_config_pistol_start );
261
+
262
+ if (allow_incompatibility || in_game )
263
+ if (pistol_start_conflict )
264
+ {
265
+ dsda_UpdateIntConfig (dsda_config_pistol_start , true, true);
266
+ dsda_ResetGameModifiers ();
267
+ }
268
+ }
269
+
270
+ // During demo recording/playback only use args, else use cfgs
271
+ void dsda_ResetGameModifiers (void )
225
272
{
226
- respawnparm = dsda_Flag (dsda_arg_respawn ) ||
227
- (allow_incompatibility && dsda_IntConfig (dsda_config_respawn_monsters ));
228
- fastparm = dsda_Flag (dsda_arg_fast ) ||
229
- (allow_incompatibility && dsda_IntConfig (dsda_config_fast_monsters ));
230
- nomonsters = dsda_Flag (dsda_arg_nomonsters ) ||
231
- (allow_incompatibility && dsda_IntConfig (dsda_config_no_monsters ));
232
- coop_spawns = dsda_Flag (dsda_arg_coop_spawns ) ||
233
- (allow_incompatibility && dsda_IntConfig (dsda_config_coop_spawns ));
273
+ pistolstart = (allow_incompatibility ? dsda_IntConfig (dsda_config_pistol_start ) : false); // pistolstart not allowed in demos
274
+ respawnparm = (allow_incompatibility ? dsda_IntConfig (dsda_config_respawn_monsters ) : dsda_Flag (dsda_arg_respawn ));
275
+ fastparm = (allow_incompatibility ? dsda_IntConfig (dsda_config_fast_monsters ) : dsda_Flag (dsda_arg_fast ));
276
+ nomonsters = (allow_incompatibility ? dsda_IntConfig (dsda_config_no_monsters ) : dsda_Flag (dsda_arg_nomonsters ));
277
+ coop_spawns = (allow_incompatibility ? dsda_IntConfig (dsda_config_coop_spawns ) : dsda_Flag (dsda_arg_coop_spawns ));
234
278
}
235
279
236
280
void dsda_RefreshGameSkill (void ) {
237
281
void G_RefreshFastMonsters (void );
238
282
239
283
if (allow_incompatibility )
240
- dsda_ResetGameFlags ();
284
+ dsda_ResetGameModifiers ();
241
285
242
286
skill_info = skill_infos [gameskill ];
243
287
0 commit comments