WeiDUorg / weidu

WeiDU is a program used to develop, distribute and install modifications for games based on the Infinity Engine.
http://www.weidu.org
GNU General Public License v2.0
87 stars 19 forks source link

Mod installation order should be preserved when uninstalling mod components #232

Open Argent77 opened 9 months ago

Argent77 commented 9 months ago

How to reproduce

1. Create first mod script in game folder: mod1.tp2

BACKUP ~weidu_external/backup/mod1~
AUTHOR ~Argent77~

BEGIN ~Component A~ DESIGNATED 1
BEGIN ~Component B~ DESIGNATED 2

2. Create a second mod script in game folder: mod2.tp2

BACKUP ~weidu_external/backup/mod2~
AUTHOR ~Argent77~

BEGIN ~Component 1~ DESIGNATED 1

3. Install mod components:

weidu mod1.tp2 --force-install 1
weidu mod2.tp2 --force-install 1
weidu mod1.tp2 --force-install 2

Resulting WeiDU.log content:

~MOD1.TP2~ #0 #1 // Component A
~MOD2.TP2~ #0 #1 // Component 1
~MOD1.TP2~ #0 #2 // Component B

4. Uninstall the first mod component of "mod1" (Component A):

weidu mod1.tp2 --force-uninstall 1

Resulting WeiDU.log content:

~MOD1.TP2~ #0 #2 // Component B
~MOD2.TP2~ #0 #1 // Component 1

Expected WeiDU.log content:

~MOD2.TP2~ #0 #1 // Component 1
~MOD1.TP2~ #0 #2 // Component B
FredrikLindgren commented 9 months ago

Yeah, the fix for this is superficially easy, but it's one of those things I worry could have unintended consequences. I guess I'll think about it. For future me or other interested parties, this is caused by this conditional. Knock it out and everything should be handled by this and beyond.