Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

Editing a droid template causes it to disappear from factories #4199

Closed
wzdev-ci opened this issue Apr 17, 2014 · 11 comments
Closed

Editing a droid template causes it to disappear from factories #4199

wzdev-ci opened this issue Apr 17, 2014 · 11 comments

Comments

@wzdev-ci
Copy link
Contributor

resolution_duplicate type_bug | by anidev


Editing an existing template in the design view causes it to disappear from the menu when attempting to produce new units with factories. New designs do not show up at all. Looking at the save files, the templates that do not show up somehow have enabled=false while the templates that appear have enabled=true.

This only happens after saving the game and reloading it. While the game is running, new templates and edited existing templates are perfectly usable. However, after saving the game, restarting the program, and loading it again, the edited templates and the new templates are not available to manufacture, even though they show up in design view.

I have attached a savegame which has this issue. Two templates are already unusable; new ones will become unusable after saving and reloading, while simply clicking on existing templates will cause them to be "edited" and will also become unusable after saving and reloading.


Issue migrated from trac:4199 at 2022-04-16 11:43:22 -0700

@wzdev-ci
Copy link
Contributor Author

anidev uploaded file Test.zip (54.0 KiB)

@wzdev-ci
Copy link
Contributor Author

NoQ changed _comment0 which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

NoQ commented


The two templates in your savegame actually don't work for me as well, but when i re-design them and save-load, they start working again. And also existing templates don't disappear after i re-design them. Tested on 3.1.1.

For the two templates that fail to work in the savegame, i see "enabled=false" in templates.ini. When i change it to "true", it starts working.

@wzdev-ci
Copy link
Contributor Author

NoQ uploaded file 2.zip (53.5 KiB)

Proof.

@wzdev-ci
Copy link
Contributor Author

anidev commented


Yes, changing enabled=false to enabled=true makes them work again. I'm not sure why I'm having this issue while you are not. I compiled the game from the sources in warzone2100-3.1.1.tar.xz, downloaded from SourceForge. The only way I was able to continue playing the game was by modifying the DROID_TEMPLATE constructor in template.cpp to initialize the enabled bool to true. Specifically:

--- template-orig.cpp        2014-04-18 13:58:51.833114541 -0400
+++ template.cpp        2014-04-20 11:04:49.882812613 -0400
@@ -296,7 +296,6 @@ DROID_TEMPLATE::DROID_TEMPLATE()  // Thi
        , psNext(NULL)
        , prefab(false)
        , stored(false)
+       , enabled(true)
 {
        aName[0] = '\0';
        std::fill_n(asParts, DROID_MAXCOMP, 0);

After this fix, I no longer had this issue. However, I don't know if this is really the cause of the problem, or a hack that happens to somehow fix it.

@wzdev-ci
Copy link
Contributor Author

Pangaea commented


Looks like the same problem as in [#4193]. I have the same problem and uploaded some files there. As mentioned here, it does seem to work as intended while playing the game, but save, quit and reload, and designs will go AWOL.

I use 3.1.1 btw, so the problem is there too.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Jul 6, 2015

vexed changed status from new to closed

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Jul 6, 2015

vexed changed resolution from `` to duplicate

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Jul 6, 2015

vexed changed blocking which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Jul 6, 2015

vexed changed blockedby which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Jul 6, 2015

vexed commented


Consolidating all of these 'design' issues into one ticket (#3893) that has the most information about the issue.
refs #3094, #4141, #4142, #4149, #4150, #4208, #4207, #4199, #4193, #4162, #4124, #4040
(NOTE, each of the above listed tickets may have more information about issue as well as savegames )

@wzdev-ci wzdev-ci closed this as completed Jul 6, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant