Not logged inOpenClonk Forum
Up Topic Development / Scenario & Object Development / Crash Landing: Weird hotfix
- - By Clonkonaut [de] Date 2016-12-28 14:34 Edited 2016-12-28 14:39
I just made a very weird hotfix to Crash Landing because currently it's unplayable. Because you don't get your clonk, it is stuck inside the pilot (Pyrit).

The hotfix is weird because of this:

When players are joined, the clonks are stuffed into the dialogue object:

see here
for(var index = 0; crew = GetCrew(plr, index); ++index)
         {
                 crew->Enter(this.dialogue);
         }


So far, when the plane crashes and clonks are ejected, they were taken from said object:

see here (old version)
while(this.dialogue->Contents())
                 Intro_CreateBoompack(RandomX(x-5,x+5), RandomX(y-5,y+5), 160)->Launch(290 + Random(26), this.dialogue->Contents());


For some reason, this didn't work anymore, because the clonks suddenly were inside the pilot. My hotfix is as follows:

var clonk;
while(clonk = this.pilot->Contents())
{
  clonk->Exit();
  Intro_CreateBoompack(RandomX(x-5,x+5), RandomX(y-5,y+5), 160)->Launch(290 + Random(26), clonk);
}


It works but I don't get why. Maybe someone knows why because he changed something in the sequence object that causes this behaviour. Maybe it's a sympton for another bug.
Reply
Parent - - By Maikel Date 2016-12-28 17:57 Edited 2016-12-28 18:09
Cool bug!

The problem is likely here: https://git.openclonk.org/openclonk.git/blob/HEAD:/planet/Objects.ocd/Helpers.ocd/Dialogue.ocd/Script.c#l720

The dialogue objects moves its contents to the speaker of the dialogue, i.e. the pilot. This change looks like it has been done by Sven2 during editor works.

The proper fix would be to never move the clonks into any dialogue object and maybe add a warning if the dialogue object does collect something (or only collect in editor mode?).
Parent - - By Sven2 Date 2016-12-28 22:15
Yeah, good find. Having inventory that was supposed to go into clonks in the dialogue instead was very annoying; that's why I did the change. I didn't think about sequences using the dialogue object as a storage.

I could change the editor to use a special property to simply ignore certain objects as drop targets and remove that special case form the dialogue object. Of course then Clonkonaut's solution needs to be reverted.
Parent - By Maikel Date 2016-12-28 22:19
I would be happy with that change.
Parent - By Clonkonaut [de] Date 2016-12-29 02:51
Either way sounds ok. Using the pilot for storage or changing the dialogue object.
Reply
- By Clonkonaut [de] Date 2016-12-29 14:48
Dark Castle needs the same fix.
Reply
Up Topic Development / Scenario & Object Development / Crash Landing: Weird hotfix

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill