mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
Bugfix: Game crashes at startup when Release version is compiled, ONLY with Visual Studio 2008 (by birdflu)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2799 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -45,7 +45,7 @@ struct
|
|||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
CHAR16 szDescription[MAX_DELIVERYMETHOD_DESC_LENGTH+1];
|
CHAR16 szDescription[MAX_DELIVERYMETHOD_DESC_LENGTH+1];
|
||||||
DestinationDeliveryInfoReadInTable DestinationDeliveryInfos;
|
DestinationDeliveryInfoReadInTable* DestinationDeliveryInfos;
|
||||||
}CurDeliveryMethod;
|
}CurDeliveryMethod;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
@@ -145,16 +145,16 @@ deliveryMethodEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
pData->curElement = DELIVERYMETHOD_ELEMENT_TABLE;
|
pData->curElement = DELIVERYMETHOD_ELEMENT_TABLE;
|
||||||
UINT8 ubCurrentDM = gPostalService.AddDeliveryMethod(pData->CurDeliveryMethod.szDescription);
|
UINT8 ubCurrentDM = gPostalService.AddDeliveryMethod(pData->CurDeliveryMethod.szDescription);
|
||||||
|
|
||||||
RefToDestinationDeliveryInfoReadInTableIterator dfriti = pData->CurDeliveryMethod.DestinationDeliveryInfos.begin();
|
RefToDestinationDeliveryInfoReadInTableIterator dfriti = pData->CurDeliveryMethod.DestinationDeliveryInfos->begin();
|
||||||
|
|
||||||
while(dfriti != pData->CurDeliveryMethod.DestinationDeliveryInfos.end())
|
while(dfriti != pData->CurDeliveryMethod.DestinationDeliveryInfos->end())
|
||||||
{
|
{
|
||||||
gPostalService.SetDestinationDeliveryInfo(ubCurrentDM, ((RefToDestinationDeliveryInfoReadInStruct)*dfriti).uiDestinationIndex, ((RefToDestinationDeliveryInfoReadInStruct)*dfriti).usDestinationFee, ((RefToDestinationDeliveryInfoReadInStruct)*dfriti).bDaysAhead);
|
gPostalService.SetDestinationDeliveryInfo(ubCurrentDM, ((RefToDestinationDeliveryInfoReadInStruct)*dfriti).uiDestinationIndex, ((RefToDestinationDeliveryInfoReadInStruct)*dfriti).usDestinationFee, ((RefToDestinationDeliveryInfoReadInStruct)*dfriti).bDaysAhead);
|
||||||
dfriti++;
|
dfriti++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up
|
// Clean up
|
||||||
pData->CurDeliveryMethod.DestinationDeliveryInfos.clear();
|
pData->CurDeliveryMethod.DestinationDeliveryInfos->clear();
|
||||||
memset(pData->CurDeliveryMethod.szDescription, 0, sizeof(pData->CurDeliveryMethod.szDescription));
|
memset(pData->CurDeliveryMethod.szDescription, 0, sizeof(pData->CurDeliveryMethod.szDescription));
|
||||||
pData->CurDestinationDeliveryInfo.uiDestinationIndex = 0;
|
pData->CurDestinationDeliveryInfo.uiDestinationIndex = 0;
|
||||||
pData->CurDestinationDeliveryInfo.uiDestinationIndex = 0;
|
pData->CurDestinationDeliveryInfo.uiDestinationIndex = 0;
|
||||||
@@ -179,7 +179,7 @@ deliveryMethodEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
|
|
||||||
memset(&pData->CurDestinationDeliveryInfo, 0, sizeof(pData->CurDestinationDeliveryInfo));
|
memset(&pData->CurDestinationDeliveryInfo, 0, sizeof(pData->CurDestinationDeliveryInfo));
|
||||||
|
|
||||||
pData->CurDeliveryMethod.DestinationDeliveryInfos.push_back(dfris);
|
pData->CurDeliveryMethod.DestinationDeliveryInfos->push_back(dfris);
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "uiDestinationIndex") == 0)
|
else if(strcmp(name, "uiDestinationIndex") == 0)
|
||||||
{
|
{
|
||||||
@@ -238,6 +238,7 @@ BOOLEAN ReadInDeliveryMethods(STR fileName)
|
|||||||
|
|
||||||
|
|
||||||
memset(&pData,0,sizeof(pData));
|
memset(&pData,0,sizeof(pData));
|
||||||
|
pData.CurDeliveryMethod.DestinationDeliveryInfos = new DestinationDeliveryInfoReadInTable();
|
||||||
pData.maxArraySize = sizeof(UINT16);
|
pData.maxArraySize = sizeof(UINT16);
|
||||||
|
|
||||||
XML_SetUserData(parser, &pData);
|
XML_SetUserData(parser, &pData);
|
||||||
@@ -254,6 +255,10 @@ BOOLEAN ReadInDeliveryMethods(STR fileName)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(pData.CurDeliveryMethod.DestinationDeliveryInfos)
|
||||||
|
{
|
||||||
|
delete pData.CurDeliveryMethod.DestinationDeliveryInfos;
|
||||||
|
}
|
||||||
MemFree(lpcBuffer);
|
MemFree(lpcBuffer);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user