OpenXcom Forum

OpenXcom => Troubleshooting => Topic started by: pkrcel on October 30, 2014, 11:01:27 pm

Title: Crash at end of UFO recovery: DebriefingState::prepareDebriefing() crashes
Post by: pkrcel on October 30, 2014, 11:01:27 pm
As the Thread title says, I'm experiencing a strange "bug".

I'm ending a crashed UFO recovery (UFO map from "YetMoreUFOs" mod, terrain map from Hobbe's "Terrain Pack" mod), and it crashed during DebriefingState::prepareDebriefing() at line 486 of DebriefingState.cpp

Code: [Select]
for (std::vector<BaseFacility*>::iterator k = base->getFacilities()->begin(); k != base->getFacilities()->end();)
{
https:// this facility was demolished
if (battle->getModuleMap()[(*k)->getX()][(*k)->getY()].second == 0)  https://**** CRASHES HERE operator[] returns invalid
{
base->destroyFacility(k);
}
else
{
++k;
}
}


The funny thing is that it should NOT traverse this code branch since it's a UFO recovery and I have a skyranger in battlescape, and so I think that afterall it's okay that in this situation it crashes.


Attached my savefile, for anyone that woudl like to have a look.
EDIT: firing at the last surviving snakeman shoudl yield a kill and then the crash.

Thanks for any help at what I should do to not scrap the entire UFO recovery.

Cheers.
Pkrcel
Title: Re: Crash at end of UFO recovery: DebriefingState::prepareDebriefing() crashes
Post by: ivandogovich on October 30, 2014, 11:12:44 pm
no other mods?
Title: Re: Crash at end of UFO recovery: DebriefingState::prepareDebriefing() crashes
Post by: pkrcel on October 30, 2014, 11:34:19 pm
Right, I also run Equal Terms.

I should add that this is the second mission I run with yetmoreufos (previously I was running Luke's Extra UFO)

Title: Re: Crash at end of UFO recovery: DebriefingState::prepareDebriefing() crashes
Post by: ivandogovich on October 30, 2014, 11:39:50 pm
Just brainstorming here, (and I didn't look at your code) but sometimes crashes at the end of the mission are due to unrecoverable battlefield items?

Title: Re: Crash at end of UFO recovery: DebriefingState::prepareDebriefing() crashes
Post by: Warboy1982 on October 31, 2014, 06:10:21 am
for some reason there's a base in your save with inBattlescape: true
any idea why this might be?
Title: Re: Crash at end of UFO recovery: DebriefingState::prepareDebriefing() crashes
Post by: pkrcel on October 31, 2014, 07:17:59 am
I had a base defense previously, I'd say "two or three missions ago"....

In other words I'm sure I had other UFO recoveries since the base defense.

I haven't tinkered with the save whatsoever, so I can't tell of any other reason.

EDIT: I might add the base defense was NOT in the Base that's affected in this save, to memory this base hasn't yet been targeted by an alien assault. nevermind, read below.

EDIT2: I *guess* that toggling the property to False should take care of the crash, correct?

EDIT3: sorry I got things mixed up, reading the YAML files is a nightmare due to the wonky serialization order of yaml-cpp (or so I think) "Fire Island" is indeed the last base I had to defend.