HomeWildfire Games

Do not allow to start pyrogenesis with incompatible mods

Description

Do not allow to start pyrogenesis with incompatible mods

Fixing following problems:
Issue number one:
Enable mod with a23 compatibility in a23b.
Save configuration.
Start a24.
Better result:
Mod will be enabled and invisible in mod selection screen producing various errors.
Worse result:
Game will crash and refuse to start.

Issue number two:
Mods can silently set loaded mods without restarting the engine, so mods can unlist themselves from compatibility detection.

Solution:
Enable necessary mods instead if running with gui and open mod page.
Open information window on top of mod page to infom why mod page is showing up.
On mod page show mods which failed in compatibility check and color the resposnible ones.
Disable start button without enabled mods.
Show non existed mods if they failed in compatibility check.

Else just log to mainlog and close.

Another fixes:
Display in enabled mods really enabled mods as current logic confuses players about which mods they have enabled and is not helpful (ref #4881)

Note:
this will not solve issue with mods claiming being compatible with engine version while in fact being incompatible.

Comments by: @vladislavbelov, @Stan, @Imarok
Tested by: @wraitii
Differential revision: D3592
Fixes: #6044 #4881

Event Timeline

You have some warnings:

s/Mod.cpp: In function 'void Mod::SetDefaultMods(const CmdLineArgs&, int)':
../../../source/ps/Mod.cpp:146:45: warning: unused parameter 'args' [-Wunused-parameter]
 void Mod::SetDefaultMods(const CmdLineArgs& args, int flags)
                          ~~~~~~~~~~~~~~~~~~~^~~~
../../../source/ps/Mod.cpp:146:55: warning: unused parameter 'flags' [-Wunused-parameter]
 void Mod::SetDefaultMods(const CmdLineArgs& args, int flags)
                                                   ~~~~^~~~~
../../../source/ps/Mod.cpp: In function 'bool Mod::CompareVersionStrings(const CStr8&, const CStr8&, const CStr8&)':
../../../source/ps/Mod.cpp:273:10: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   if (gt && diff > 0 || lt && diff < 0)
       ~~~^~~~~~~~~~~
../../../source/ps/Mod.cpp:276:10: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   if (gt && diff < 0 || lt && diff > 0 || eq && diff)
       ~~~^~~~~~~~~~~
../../../source/ps/Mod.cpp:276:46: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   if (gt && diff < 0 || lt && diff > 0 || eq && diff)

(I think the build failure is spurious)

wraitii raised a concern with this commit.Sep 17 2021, 11:22 AM
wraitii added inline comments.
/ps/trunk/source/ps/Mod.cpp
238

I believe those should be break, or a mod can be pushed several times.

This commit now has outstanding concerns.Sep 17 2021, 11:22 AM
Silier requested verification of this commit.Oct 30 2021, 12:45 PM
This commit now requires verification by auditors.Oct 30 2021, 12:45 PM
wraitii resigned from this commit.Jul 6 2022, 9:18 AM
This commit no longer requires audit.Jul 6 2022, 9:18 AM