shdwp / dcs_liberation

DCS World singleplayer/co-op dynamic campaign.
https://forums.eagle.ru/showthread.php?t=214834
GNU Lesser General Public License v3.0
51 stars 15 forks source link

Restart campaign doesn't clear assets at locations #60

Open Rushyo opened 5 years ago

Rushyo commented 5 years ago

Clicking 'restart campaign' doesn't seem to clear the OPFOR assets at locations, so restarted campaigns are always harder than the first one and get harder the more you do it.

Workaround is to delete the campaign files and restart the application.

Issue is present in 1.5 RC1

JohanAberg commented 5 years ago

I can reproduce this. The issue appears to be the ConflictTheater class implementations.

https://github.com/shdwp/dcs_liberation/blob/63da35022362147e66bba9f6be5b7f4e6026caa4/theater/persiangulf.py#L24

The control points are store as class attributes (apposed to instance attributes), so they will be remembered even when a new instance of say PersianGulfTheater is made after File > Restart Campain. I was able to get the right/expected behaviour by making the ControlPoints instance attributes.

Khopa commented 5 years ago

Reproduced and fixed in my dev branch.

https://github.com/Khopa/dcs_liberation/blob/fbd01fbfdbe204dc36a64829471101a15b30c981/theater/start_generator.py#L27-L32

Another related issue is that "strike targets' (namely 'ground objects') were not cleared either. Also fixed in my dev branch.

https://github.com/Khopa/dcs_liberation/blob/fbd01fbfdbe204dc36a64829471101a15b30c981/theater/start_generator.py#L86-L87

In the meantime, you can also fall back to the old way of restarting the game, that consist of deleting the save file : C:/Users//Saved Games/dcs/liberation_save. And then restart DCS liberation to get a clean new start.

shdwp commented 5 years ago

@Khopa are you able to merge into develop and master? I think I gave you maintainer access, meaning that you should be able to make releases as well.

Khopa commented 5 years ago

Yes i think i should be able to do this it when needed.

But the version on my branch is not stable yet, moreover I and @wrycu have some pending changes on our branches as well, so personally, i am not planning to make a release immediately.