OpenXcom Forum
Modding => OXCE Bugs => OpenXcom Extended => OXCE Bugs FIXED => Topic started by: robin on April 02, 2017, 02:24:59 pm
-
I get a "Segmentation fault" (+crash) error when I abort to get to the 2nd stage of a 2-stages mission.
I'm using OXCE+ (but it does not mean the issue is related to OXCE+ stuff).
The crash happens specifically when aborting the 1st stage with soldiers on the target exit zone (to get to the 2nd stage with those soldiers).
Both missions by themselves are playable in Quick Battle mode, so the maps, terrain, itemSets, and deployment data, should be ok.
Any idea?
- type: STR_ALIEN_GATE_LANDING # 1st stage
data:
[...]
width: 40
length: 40
height: 5
terrains:
- U_PLANET
shade: 8
markerName: STR_ALIEN_GATE
markerIcon: 7
genMission:
STR_ALIEN_RETALIATION: 15
STR_ALIEN_RAID_SMALL: 20
STR_ALIEN_RAID_MEDIUM: 15
STR_ALIEN_RAID_LARGE: 15
STR_ALIEN_SUBVERSION: 15
STR_ALIEN_SUPPLY: 20
genMissionFreq: 3
alienBase: true # this is only to tell new battle mode what to do with this deployment
nextStage: STR_ALIEN_GATE_ASSAULT
briefing:
textOffset: -16
title: STR_ALIEN_GATE_MISSION
desc: STR_ALIEN_GATE_LANDING_BRIEFING
background: BACK01.SCR
showTarget: false
points: 5
- type: STR_ALIEN_GATE_ASSAULT # 2nd stage
data:
[...]
width: 50
length: 50
height: 5
terrains:
- U_BUILDING
shade: 15
script: U_BUILDING
briefing:
textOffset: -16
title: STR_ALIEN_GATE_MISSION
desc: STR_ALIEN_GATE_ASSAULT_BRIEFING
background: BACK01.SCR
showTarget: false
objectiveType: 40 # I have a item and a tile with specialType: 40
alienBase: true # this is only to tell new battle mode what to do with this deployment
objectiveComplete: [STR_ALIEN_GATE_CONTROL_DESTROYED, 1000]
objectivePopup: STR_CONTROL_CENTER_DESTROYED
-
It might very well be OXCE+.
I have not tested 2-stage missions well, you could say almost not at all.
Could you share the current snapshot of your mod; and screenshot of quick battle settings (or better a save)?
-
mod: -deleted- tell me if you need it again
savegame attached (it's from a Quick Battle; you can just hit Abort->Ok to get the crash)
thanks
-
It's most likely a code issue.
It works in vanilla.
It doesn't work in OXCE and OXCE+.
I'll ask Yankes for help.
-
I will look on this too.
-
Thank you both.
-
I find bug and solution, over all problem was because game try break connection of unit to old tiles that was destroyed by new map generation.
Fix is break this connection before old map is destroyed.
This will be fix in my next release.
in `BattlescapeGenerator::nextStage`:
+ // cleanup before map old map is destroyed
+ for (auto unit : *_save->getUnits())
+ {
+ unit->clearVisibleTiles();
+ unit->clearVisibleUnits();
+ }
+
generateMap(script);
-
is that relevant to the master branch? is this something i also need to fix?
-
No, https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/BattlescapeGenerator.cpp#L403 is fix for this situation too.
Difference was that OXCE used `clearVisibleTiles` that do more things that cause bug.
-
news on this fix?
-
At least from my side I will release fix it week or two with new version. When Meridian will do it in his branch, I do not know. He could even faster because fix was posted in this thread.
-
news on this fix?
I will release a fix today evening.
Sorry for the delay... I was occupied by the Android version... but it's really time to make a break and switch back to PC version :)
EDIT: new version is up...