mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
Fixed bug introduced in r9275; not being able to assign mercs to facilities or train militia
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9282 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -333,6 +333,7 @@ typedef struct FACILITYTYPE
|
|||||||
std::vector<PRODUCTION_LINE> ProductionData;
|
std::vector<PRODUCTION_LINE> ProductionData;
|
||||||
|
|
||||||
} FACILITYTYPE;
|
} FACILITYTYPE;
|
||||||
|
#define FACILITYTYPE_SIZEOF_POD offsetof(FACILITYTYPE, ProductionData)
|
||||||
|
|
||||||
// HEADROCK HAM 3.5: Maximum number of different facility types
|
// HEADROCK HAM 3.5: Maximum number of different facility types
|
||||||
#define MAX_NUM_FACILITY_TYPES 255
|
#define MAX_NUM_FACILITY_TYPES 255
|
||||||
|
|||||||
@@ -42,15 +42,10 @@ typedef enum
|
|||||||
|
|
||||||
} FACILITYTYPE_PARSE_STAGE;
|
} FACILITYTYPE_PARSE_STAGE;
|
||||||
|
|
||||||
struct
|
typedef struct
|
||||||
{
|
{
|
||||||
FACILITYTYPE_PARSE_STAGE curElement;
|
FACILITYTYPE_PARSE_STAGE curElement;
|
||||||
|
|
||||||
CHAR8 szCharData[MAX_CHAR_DATA_LENGTH+1];
|
CHAR8 szCharData[MAX_CHAR_DATA_LENGTH+1];
|
||||||
|
|
||||||
FACILITYTYPE curFacilityTypeData;
|
|
||||||
FACILITYASSIGNMENTTYPE curAssignmentData;
|
|
||||||
PRODUCTION_LINE curProductionData;
|
|
||||||
INT16 curAssignmentType;
|
INT16 curAssignmentType;
|
||||||
INT16 curRisk;
|
INT16 curRisk;
|
||||||
INT16 curProduction;
|
INT16 curProduction;
|
||||||
@@ -58,7 +53,11 @@ struct
|
|||||||
UINT32 curIndex;
|
UINT32 curIndex;
|
||||||
UINT32 currentDepth;
|
UINT32 currentDepth;
|
||||||
UINT32 maxReadDepth;
|
UINT32 maxReadDepth;
|
||||||
} typedef facilitytypeParseData;
|
FACILITYTYPE curFacilityTypeData;
|
||||||
|
FACILITYASSIGNMENTTYPE curAssignmentData;
|
||||||
|
PRODUCTION_LINE curProductionData;
|
||||||
|
} facilitytypeParseData;
|
||||||
|
#define FACILITYTYPEPARSEDATA_SIZE_OF_POD offsetof(facilitytypeParseData, curFacilityTypeData)
|
||||||
|
|
||||||
BOOLEAN FacilityTypes_TextOnly;
|
BOOLEAN FacilityTypes_TextOnly;
|
||||||
|
|
||||||
@@ -173,6 +172,7 @@ facilitytypeStartElementHandle(void *userData, const XML_Char *name, const XML_C
|
|||||||
pData->curElement = FACILITYTYPE_TYPE;
|
pData->curElement = FACILITYTYPE_TYPE;
|
||||||
|
|
||||||
// Set all values to default before applying XML data
|
// Set all values to default before applying XML data
|
||||||
|
memset(&pData->curFacilityTypeData, 0, FACILITYTYPE_SIZEOF_POD);
|
||||||
InitFacilityTypeEntry( pData );
|
InitFacilityTypeEntry( pData );
|
||||||
|
|
||||||
//DebugMsg(TOPIC_JA2, DBG_LEVEL_3,"MergeStartElementHandle: setting memory for curMerge");
|
//DebugMsg(TOPIC_JA2, DBG_LEVEL_3,"MergeStartElementHandle: setting memory for curMerge");
|
||||||
@@ -1303,6 +1303,7 @@ BOOLEAN ReadInFacilityTypes(STR fileName, BOOLEAN localizedVersion)
|
|||||||
XML_SetCharacterDataHandler(parser, facilitytypeCharacterDataHandle);
|
XML_SetCharacterDataHandler(parser, facilitytypeCharacterDataHandle);
|
||||||
|
|
||||||
|
|
||||||
|
memset(&pData, 0, FACILITYTYPEPARSEDATA_SIZE_OF_POD);
|
||||||
pData.maxArraySize = MAXITEMS;
|
pData.maxArraySize = MAXITEMS;
|
||||||
pData.curIndex = 0;
|
pData.curIndex = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user