Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions Strategic/strategicmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6665,18 +6665,16 @@ BOOLEAN CheckAndHandleUnloadingOfCurrentWorld( )

if ( guiCurrentScreen == AUTORESOLVE_SCREEN )
{
if ( gWorldSectorX == sBattleSectorX && gWorldSectorY == sBattleSectorY && gbWorldSectorZ == sBattleSectorZ )
{ //Yes, this is and looks like a hack. The conditions of this if statement doesn't work inside
//TrashWorld() or more specifically, TacticalRemoveSoldier() from within TrashWorld(). Because
//we are in the autoresolve screen, soldiers are internally created different (from pointers instead of
//the MercPtrs[]). It keys on the fact that we are in the autoresolve screen. So, by switching the
//screen, it'll delete the soldiers in the loaded world properly, then later on, once autoresolve is
//complete, it'll delete the autoresolve soldiers properly. As you can now see, the above if conditions
//don't change throughout this whole process which makes it necessary to do it this way.
guiCurrentScreen = MAP_SCREEN;
TrashWorld( );
guiCurrentScreen = AUTORESOLVE_SCREEN;
}
//Yes, this is and looks like a hack. The conditions of this if statement doesn't work inside
//TrashWorld() or more specifically, TacticalRemoveSoldier() from within TrashWorld(). Because
//we are in the autoresolve screen, soldiers are internally created different (from pointers instead of
//the MercPtrs[]). It keys on the fact that we are in the autoresolve screen. So, by switching the
//screen, it'll delete the soldiers in the loaded world properly, then later on, once autoresolve is
//complete, it'll delete the autoresolve soldiers properly. As you can now see, the above if conditions
//don't change throughout this whole process which makes it necessary to do it this way.
guiCurrentScreen = MAP_SCREEN;
TrashWorld( );
guiCurrentScreen = AUTORESOLVE_SCREEN;
}
else
{
Expand Down