Skip to content

Commit

Permalink
Perform the rules fixup before fetching the players side information.
Browse files Browse the repository at this point in the history
  • Loading branch information
CCHyper committed Dec 5, 2022
1 parent c0edcfb commit e5618ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/extensions/rules/rulesext.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ class RulesClassExtension final : public GlobalExtensionClass<RulesClass>
bool AudioVisual(CCINIClass &ini);
bool Weapons(CCINIClass &ini);

void Fixups();

private:
void Check();
void Fixups();

public:
/**
Expand Down
9 changes: 9 additions & 0 deletions src/extensions/scenario/scenarioext_hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include "progressscreen.h"
#include "language.h"
#include "wsproto.h"
#include "rulesext.h"
#include "fatal.h"
#include "debughandler.h"
#include "asserthandler.h"
Expand All @@ -76,6 +77,14 @@ static void Init_Loading_Screen(const char *filename)
bool solo = Session.Singleplayer_Game();
int player_count = solo ? 1 : Session.Players.Count();

/**
* #EDGE-CASE/#BUGFIX:
*
* We need to do the fixup even earlier now as we need to use the Side
* value from the players HouseType.
*/
RuleExtension->Fixups();

/**
* For the campaign, we abuse the required CD to get the desired Side.
*/
Expand Down

0 comments on commit e5618ca

Please sign in to comment.