Anonymous Login
2017-11-20 21:47 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001906OpenClonkObjectspublic2017-10-27 18:54
ReporterArmin 
Assigned ToK-Pone 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target Version8.0Fixed in Version8.0 
Summary0001906: Last man standing keeps creating new Rule_Relaunch objects
DescriptionIf you place the Last man standing rule in your scenario, it will also create Rule_Relaunch if it didnt exist already. But if you save the scenario and load it again, it will create a new one so after a few sessions you have like 10 Rule_Relaunchs in your Objects.c which makes it impossible to edit the settings of the relaunch rule since the new one is one that seems to have impact on the game.
Additional InformationMaybe relevant:

snapshot/Objects.ocd/Rules.ocd/Relaunch.ocd/Script.c:374:
return FindObject(Find_ID(Rule_Relaunch)) || CreateObject(Rule_Relaunch);
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0005656

Fulgen (reporter)

The LastManStanding rule itself only creates Rule_Relaunch if it isn't present and the player wins a relaunch by killing other players. But even then the condition to create the rule shouldn't fail...

~0005670

Maikel (developer)

There is no last man standing rule.

The goal does not seem to involve the relaunch rule. So where is the problem exactly?

~0005709

Maikel (developer)

Okay, I see the problem now. Scenario saving of the relaunch rule should check if it is not already created and also some of the properties do not seem to be saved at the moment.

~0005831

Clonkonaut (developer)

Can someone explain to me, why Rule_Relaunch gets created when I place the last man standing goal in the editor? I don't get how that works.

~0005875

K-Pone (developer)

@Clonkonaut Rule_Relaunch is created because Scoreboard_Relaunch calls it in its Initialize() function.

As stated in the Additional Information field, the function GetRelaunchRule() creates the relaunch rule when being called and it has not been created yet.

I just found this out by adding a LogCallStack() to Rule_Relaunch's Initialize().

Came up with this:
 by: Object(19)->Initialize() (ot.ocs\System.ocg\rl.c:6)
 by: Object(18)->GetRelaunchRule() (Objects.ocd\Rules.ocd\Relaunch.ocd\Script.c:405)
 by: Object(18)->Initialize() (Objects.ocd\Libraries.ocd\Scoreboard.ocd\Relaunch.ocd\Script.c:19)
 by: Object(18)->Initialize() (Objects.ocd\Goals.ocd\LastManStanding.ocd\Script.c:28)

~0005876

K-Pone (developer)

Anyhow, I cannot reproduce this savegame creating relaunch objects thing. I tested by creating the Goal_LastManStanding object, saving, and then loading the saved game and see how many Rule_Relaunch objects are there. Only one was there, as expected.

~0005877

Clonkonaut (developer)

It probably depends on the order in which the objects are saved in Objects.c
If Last Man Standing comes first, then Relaunch won't be present upon creation.

~0005878

K-Pone (developer)

I think this doesn't necessarily needs to be present when Goal_LastManStanding doesn't call its Initialize() function. Or are objects calling Initialize() on savegames and only the scenario script is not doing this?

~0005879

Clonkonaut (developer)

If I understand this bug report correctly, this isn't about savegames but about scenario creation. In a saved scenario, objects will of course call Initialize.

~0005880

K-Pone (developer)

Well, then I understood that wrong. Just tested, and yes, when saving the scenario and reloading it, Rule_Relaunch is created twice. One by Goal_LastManStanding and another one by the Objects.c afterwards.

~0005881

occ (reporter)

Hi! There's been a check-in that references this bug. For more information you can visit the repository browser at this address:
https://git.openclonk.org/openclonk.git/commitdiff/4d1a000ed8d5a05f54ad8183481eced718f2afa2

Changeset 4d1a000 by Martin Strohmeier <k-pone@gmx.de>
Fix 0001906: Rule_Relaunch is saved properly in Objects.c by using GetRelaunchRule() instead of CreateObject()

~0005882

K-Pone (developer)

Rule_Relaunch is saved properly now. Instead of CreateObject the Rule_Relaunch object is now properly referenced by using GetRelaunchRule(). The other properties are being applied as usual in Objects.c.
+Notes

-Issue History
Date Modified Username Field Change
2017-04-18 14:02 Armin New Issue
2017-04-18 16:04 Fulgen Note Added: 0005656
2017-04-30 16:24 Maikel Note Added: 0005670
2017-08-05 15:58 Maikel Target Version => 8.0
2017-08-05 16:26 Maikel Note Added: 0005709
2017-10-26 14:54 Clonkonaut Note Added: 0005831
2017-10-27 16:24 K-Pone Note Added: 0005875
2017-10-27 16:27 K-Pone Note Added: 0005876
2017-10-27 16:45 Clonkonaut Note Added: 0005877
2017-10-27 16:57 K-Pone Note Added: 0005878
2017-10-27 17:05 Clonkonaut Note Added: 0005879
2017-10-27 17:14 K-Pone Note Added: 0005880
2017-10-27 17:15 K-Pone Assigned To => K-Pone
2017-10-27 17:15 K-Pone Status new => confirmed
2017-10-27 18:51 occ Note Added: 0005881
2017-10-27 18:54 K-Pone Status confirmed => resolved
2017-10-27 18:54 K-Pone Resolution open => fixed
2017-10-27 18:54 K-Pone Fixed in Version => 8.0
2017-10-27 18:54 K-Pone Note Added: 0005882
+Issue History