@@ -297,16 +297,22 @@ bool Spawner::StartScenario(const char* pScenarioName)
297
297
if (SessionClass::IsCampaign ())
298
298
{
299
299
pGameModeOptions->Crates = true ;
300
- return Config->LoadSaveGame ? Spawner::LoadSavedGame (Config->SaveGameName ) : ScenarioClass::StartScenario (pScenarioName, 1 , 0 );
300
+ return Config->LoadSaveGame
301
+ ? Spawner::LoadSavedGame (Config->SaveGameName )
302
+ : ScenarioClass::StartScenario (pScenarioName, 1 , 0 );
301
303
}
302
304
else if (SessionClass::IsSkirmish ())
303
305
{
304
- return Config->LoadSaveGame ? Spawner::LoadSavedGame (Config->SaveGameName ) : ScenarioClass::StartScenario (pScenarioName, 0 , -1 );
306
+ return Config->LoadSaveGame
307
+ ? Spawner::LoadSavedGame (Config->SaveGameName )
308
+ : ScenarioClass::StartScenario (pScenarioName, 0 , -1 );
305
309
}
306
310
else /* if (SessionClass::IsMultiplayer()) */
307
311
{
308
312
Spawner::InitNetwork ();
309
- bool result = Config->LoadSaveGame ? Spawner::LoadSavedGame (Config->SaveGameName ) : ScenarioClass::StartScenario (pScenarioName, 0 , -1 );
313
+ bool result = Config->LoadSaveGame
314
+ ? Spawner::LoadSavedGame (Config->SaveGameName )
315
+ : ScenarioClass::StartScenario (pScenarioName, 0 , -1 );
310
316
311
317
if (!result)
312
318
return false ;
@@ -434,15 +440,11 @@ bool Spawner::Reconcile_Players()
434
440
// Just use this as Playernodes.
435
441
auto players = SessionClass::Instance.StartSpots ;
436
442
437
- /* *
438
- * If there are no players, there's nothing to do.
439
- */
443
+ // If there are no players, there's nothing to do.
440
444
if (players.Count == 0 )
441
445
return true ;
442
446
443
- /* *
444
- * Make sure every name we're connected to can be found in a House.
445
- */
447
+ // Make sure every name we're connected to can be found in a House.
446
448
for (i = 0 ; i < players.Count ; i++)
447
449
{
448
450
found = false ;
@@ -485,9 +487,7 @@ bool Spawner::Reconcile_Players()
485
487
if (!pHouse)
486
488
continue ;
487
489
488
- /* *
489
- * Skip this house if it wasn't human to start with.
490
- */
490
+ // Skip this house if it wasn't human to start with.
491
491
if (!pHouse->IsHumanPlayer )
492
492
continue ;
493
493
@@ -506,9 +506,7 @@ bool Spawner::Reconcile_Players()
506
506
}
507
507
}
508
508
509
- /* *
510
- * If this name wasn't found, remove it
511
- */
509
+ // If this name wasn't found, remove it
512
510
if (!found)
513
511
{
514
512
/* *
@@ -548,9 +546,7 @@ void Spawner::LoadSidesStuff()
548
546
549
547
void Spawner::RespondToSaveGame (EventExt* event)
550
548
{
551
- /* *
552
- * Mark that we'd like to save the game.
553
- */
549
+ // Mark that we'd like to save the game.
554
550
Spawner::DoSave = true ;
555
551
}
556
552
@@ -562,19 +558,13 @@ void Spawner::RespondToSaveGame(EventExt* event)
562
558
*/
563
559
void Print_Saving_Game_Message ()
564
560
{
565
- /* *
566
- * Calculate the message delay.
567
- */
561
+ // Calculate the message delay.
568
562
const int message_delay = (int )(RulesClass::Instance->MessageDelay * 900 );
569
563
570
- /* *
571
- * Send the message.
572
- */
564
+ // Send the message.
573
565
MessageListClass::Instance.AddMessage (nullptr , 0 , L" Saving game..." , 4 , TextPrintType::Point6Grad | TextPrintType::UseGradPal | TextPrintType::FullShadow, message_delay, false );
574
566
575
- /* *
576
- * Force a redraw so that our message gets printed.
577
- */
567
+ // Force a redraw so that our message gets printed.
578
568
MapClass::Instance.MarkNeedsRedraw (2 );
579
569
MapClass::Instance.Render ();
580
570
}
@@ -592,12 +582,10 @@ void Spawner::After_Main_Loop()
592
582
{
593
583
auto pConfig = Spawner::GetConfig ();
594
584
595
- const bool doSaveCampaign = SessionClass::Instance.GameMode == GameMode::Campaign && pConfig->AutoSaveCount > 0 && pConfig->AutoSaveInterval > 0 ;
585
+ const bool doSaveCampaign = SessionClass::Instance.GameMode == GameMode::Campaign && pConfig->AutoSaveCount > 0 && pConfig->AutoSaveInterval > 0 ;
596
586
const bool doSaveMP = Spawner::Active && SessionClass::Instance.GameMode == GameMode::LAN && pConfig->AutoSaveInterval > 0 ;
597
587
598
- /* *
599
- * Schedule to make a save if it's time to autosave.
600
- */
588
+ // Schedule to make a save if it's time to autosave.
601
589
if (doSaveCampaign || doSaveMP)
602
590
{
603
591
if (Unsorted::CurrentFrame == Spawner::NextAutoSaveFrame)
@@ -608,60 +596,40 @@ void Spawner::After_Main_Loop()
608
596
609
597
if (Spawner::DoSave)
610
598
{
611
-
612
599
Print_Saving_Game_Message ();
613
600
614
- /* *
615
- * Campaign autosave.
616
- */
601
+ // Campaign autosave.
617
602
if (SessionClass::Instance.GameMode == GameMode::Campaign)
618
603
{
619
604
static char saveFileName[32 ];
620
605
static wchar_t saveDescription[32 ];
621
606
622
- /* *
623
- * Prepare the save name and description.
624
- */
607
+ // Prepare the save name and description.
625
608
std::sprintf (saveFileName, " AUTOSAVE%d.SAV" , Spawner::NextAutoSaveNumber + 1 );
626
609
std::swprintf (saveDescription, L" Mission Auto-Save (Slot %d)" , Spawner::NextAutoSaveNumber + 1 );
627
610
628
- /* *
629
- * Pause the mission timer.
630
- */
611
+ // Pause the mission timer.
631
612
ScenarioClass::PauseGame ();
632
613
Game::CallBack ();
633
614
634
- /* *
635
- * Save!
636
- */
615
+ // Save!
637
616
ScenarioClass::Instance->SaveGame (saveFileName, saveDescription);
638
617
639
- /* *
640
- * Unpause the mission timer.
641
- */
618
+ // Unpause the mission timer.
642
619
ScenarioClass::ResumeGame ();
643
620
644
- /* *
645
- * Increment the autosave number.
646
- */
621
+ // Increment the autosave number.
647
622
Spawner::NextAutoSaveNumber = (Spawner::NextAutoSaveNumber + 1 ) % pConfig->AutoSaveCount ;
648
623
649
- /* *
650
- * Schedule the next autosave.
651
- */
624
+ // Schedule the next autosave.
652
625
Spawner::NextAutoSaveFrame = Unsorted::CurrentFrame + pConfig->AutoSaveInterval ;
653
626
}
654
627
else if (SessionClass::Instance.GameMode == GameMode::LAN)
655
628
{
656
-
657
- /* *
658
- * Save!
659
- */
629
+ // Save!
660
630
ScenarioClass::Instance->SaveGame (" SAVEGAME.NET" , L" Multiplayer Game" );
661
631
662
- /* *
663
- * Schedule the next autosave.
664
- */
632
+ // Schedule the next autosave.
665
633
Spawner::NextAutoSaveFrame = Unsorted::CurrentFrame + pConfig->AutoSaveInterval ;
666
634
}
667
635
0 commit comments