mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
Removed an inconsistency between quickload and regular load
Turned on heap checking for debug builds. *Could cause memory to run low if game runs for extended periods Fixed assertion message for case where soldier groups try to cross impassible terrain Fixed inventory memory leak git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1110 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -430,11 +430,16 @@ void SetSaveLoadExitScreen( UINT32 uiScreen )
|
|||||||
|
|
||||||
SetPendingNewScreen( uiScreen );
|
SetPendingNewScreen( uiScreen );
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
// 0verhaul: This is a repeat of the previous line, but with a different variable set.
|
||||||
|
// None of it really makes sense. Why would a quicksave be different from a regular one?
|
||||||
|
// Why should ctrl+L act differently than alt+L?
|
||||||
if( gfDoingQuickLoad )
|
if( gfDoingQuickLoad )
|
||||||
{
|
{
|
||||||
fFirstTimeInGameScreen = TRUE;
|
fFirstTimeInGameScreen = TRUE;
|
||||||
SetPendingNewScreen( uiScreen );
|
SetPendingNewScreen( uiScreen );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
ExitSaveLoadScreen();
|
ExitSaveLoadScreen();
|
||||||
|
|
||||||
|
|||||||
@@ -791,6 +791,9 @@ int PASCAL HandledWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR p
|
|||||||
//EmergencyExitButtonInit();
|
//EmergencyExitButtonInit();
|
||||||
//end rain
|
//end rain
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
_CrtSetDbgFlag( _CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_DELAY_FREE_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
||||||
|
#endif
|
||||||
|
|
||||||
ghInstance = hInstance;
|
ghInstance = hInstance;
|
||||||
|
|
||||||
|
|||||||
@@ -2444,7 +2444,7 @@ void InitiateGroupMovementToNextSector( GROUP *pGroup )
|
|||||||
{
|
{
|
||||||
AssertMsg( 0, String("Group %d (%s) attempting illegal move from %c%d to %c%d (%s).",
|
AssertMsg( 0, String("Group %d (%s) attempting illegal move from %c%d to %c%d (%s).",
|
||||||
pGroup->ubGroupID, ( pGroup->fPlayer ) ? "Player" : "AI",
|
pGroup->ubGroupID, ( pGroup->fPlayer ) ? "Player" : "AI",
|
||||||
pGroup->ubSectorY+'A', pGroup->ubSectorX, pGroup->ubNextY+'A', pGroup->ubNextX,
|
pGroup->ubSectorY+'A'-1, pGroup->ubSectorX, pGroup->ubNextY+'A'-1, pGroup->ubNextX,
|
||||||
gszTerrain[SectorInfo[ubSector].ubTraversability[ubDirection]] ) );
|
gszTerrain[SectorInfo[ubSector].ubTraversability[ubDirection]] ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -232,15 +232,14 @@ BATTLESNDS_STRUCT gBattleSndsData[] =
|
|||||||
// ----------------------------------------
|
// ----------------------------------------
|
||||||
|
|
||||||
Inventory::Inventory() {
|
Inventory::Inventory() {
|
||||||
|
OBJECTTYPE filler;
|
||||||
|
memset( &filler, 0, sizeof( OBJECTTYPE ) );
|
||||||
slotCnt = NUM_INV_SLOTS;
|
slotCnt = NUM_INV_SLOTS;
|
||||||
inv.reserve(slotCnt);
|
inv.reserve(slotCnt);
|
||||||
for (int idx=0; idx < slotCnt; ++idx) {
|
for (int idx=0; idx < slotCnt; ++idx) {
|
||||||
//OBJECTTYPE *filler = new OBJECTTYPE; // Use MEMALLOC?
|
//OBJECTTYPE *filler = new OBJECTTYPE; // Use MEMALLOC?
|
||||||
OBJECTTYPE *filler = NULL;
|
|
||||||
filler = (OBJECTTYPE*)MemAlloc( sizeof( OBJECTTYPE ) );
|
|
||||||
memset( filler, 0, sizeof( OBJECTTYPE ) );
|
|
||||||
|
|
||||||
inv.push_back(*filler);
|
inv.push_back(filler);
|
||||||
}
|
}
|
||||||
clear();
|
clear();
|
||||||
Assert (inv.size() == slotCnt);
|
Assert (inv.size() == slotCnt);
|
||||||
|
|||||||
Reference in New Issue
Block a user