From b2b33bbed4e5625e77de5aed6622781c9b89f02e Mon Sep 17 00:00:00 2001 From: Giel van Schijndel Date: Thu, 14 Jun 2007 21:50:18 +0000 Subject: [PATCH] * Use decent assertion expressions for some asserts (e.g. !"string", so that debuggers actually display something more interesting than 'FALSE') * modify createDroid, createFeature and createStruct to use a NULL pointer as failure notification rather than FALSE * get rid of createStructFunc and removeStructFunc which where nothing more than fancy malloc and free wrappers git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1864 4a71c877-e1ca-e34f-864e-861f7616d084 --- src/droid.c | 13 +-- src/feature.c | 6 +- src/objmem.c | 258 ++++++++++++++++++++++-------------------------- src/objmem.h | 11 +-- src/structure.c | 153 ++++++++++++++-------------- 5 files changed, 210 insertions(+), 231 deletions(-) diff --git a/src/droid.c b/src/droid.c index 1ad154b61..6ad9891b4 100644 --- a/src/droid.c +++ b/src/droid.c @@ -3215,10 +3215,11 @@ DROID* buildDroid(DROID_TEMPLATE *pTemplate, UDWORD x, UDWORD y, UDWORD player, ASSERT(!bMultiPlayer || worldOnMap(x,y), "the build locations are not on the map"); //allocate memory - if (!createDroid(player, &psDroid)) + psDroid = createDroid(player); + if (psDroid == NULL) { - debug( LOG_NEVER, "unit build: unable to create\n" ); - ASSERT( FALSE,"Cannot get the memory for the unit" ); + debug(LOG_NEVER, "unit build: unable to create\n"); + ASSERT(!"out of memory", "Cannot get the memory for the unit"); return NULL; } @@ -3249,8 +3250,8 @@ DROID* buildDroid(DROID_TEMPLATE *pTemplate, UDWORD x, UDWORD y, UDWORD player, { if (!grpCreate(&psGrp)) { - debug( LOG_NEVER, "unit build: unable to create group\n" ); - ASSERT( FALSE,"Can't create unit because can't create group" ); + debug(LOG_NEVER, "unit build: unable to create group\n"); + ASSERT(!"unable to create group", "Can't create unit because can't create group"); free(psDroid); return NULL; } @@ -5629,7 +5630,7 @@ DROID * giftSingleDroid(DROID *psD, UDWORD to) } else { - ASSERT( FALSE, "giftSingleUnit: unable to build a unit" ); + ASSERT(!"failed building a droid", "giftSingleUnit: unable to build a unit" ); } return psNewDroid; } diff --git a/src/feature.c b/src/feature.c index 6c6371769..6a6e254f6 100644 --- a/src/feature.c +++ b/src/feature.c @@ -155,7 +155,7 @@ static void featureType(FEATURE_STATS* psFeature, char *pType) psFeature->subType = FEAT_SKYSCRAPER; return; } - ASSERT( FALSE, "Unknown Feature Type" ); + ASSERT(!"unknown feature type", "Unknown Feature Type"); } /* Load the feature stats */ @@ -329,7 +329,6 @@ void setFeatTileDraw(FEATURE *psFeat) /* Create a feature on the map */ FEATURE * buildFeature(FEATURE_STATS *psStats, UDWORD x, UDWORD y,BOOL FromSave) { - FEATURE *psFeature; UDWORD mapX, mapY; UDWORD width,breadth, foundationMin,foundationMax, height; UDWORD startX,startY,max,min; @@ -337,7 +336,8 @@ FEATURE * buildFeature(FEATURE_STATS *psStats, UDWORD x, UDWORD y,BOOL FromSave) UBYTE vis; //try and create the Feature - if (!createFeature(&psFeature)) + FEATURE* psFeature = createFeature(); + if (psFeature == NULL) { return NULL; } diff --git a/src/objmem.c b/src/objmem.c index e0ca9388f..53b29338e 100644 --- a/src/objmem.c +++ b/src/objmem.c @@ -365,14 +365,9 @@ static inline void releaseAllObjectsInList(BASE_OBJECT *list[], OBJECT_DESTRUCTO /*************************** DROID *********************************/ /* Create a new droid */ -BOOL createDroid(UDWORD player, DROID **ppsNew) +DROID* createDroid(UDWORD player) { - *ppsNew = (DROID*)createObject(player, OBJ_DROID); - - if (*ppsNew == NULL) - return FALSE; - - return TRUE; + return (DROID*)createObject(player, OBJ_DROID); } /* add the droid to the Droid Lists */ @@ -449,14 +444,9 @@ void freeAllLimboDroids(void) /************************** STRUCTURE *******************************/ /* Create a new structure */ -BOOL createStruct(UDWORD player, STRUCTURE **ppsNew) +STRUCTURE* createStruct(UDWORD player) { - *ppsNew = (STRUCTURE*)createObject(player, OBJ_STRUCTURE); - - if (*ppsNew == NULL) - return FALSE; - - return TRUE; + return (STRUCTURE*)createObject(player, OBJ_STRUCTURE); } /* add the structure to the Structure Lists */ @@ -494,14 +484,9 @@ void removeStructureFromList(STRUCTURE *psStructToRemove, STRUCTURE *pList[MAX_P /************************** FEATURE *********************************/ /* Create a new Feature */ -BOOL createFeature(FEATURE **ppsNew) +FEATURE* createFeature() { - *ppsNew = (FEATURE*)createObject(0, OBJ_FEATURE); - - if (*ppsNew == NULL) - return FALSE; - - return TRUE; + return (FEATURE*)createObject(0, OBJ_FEATURE); } /* add the feature to the Feature Lists */ @@ -653,18 +638,6 @@ void checkFactoryFlags(void) /************************** STRUC FUNCTIONALITY ********************************/ -/* Create a new Structure Functionality*/ -BOOL createStructFunc(FUNCTIONALITY **ppsNew) -{ - *ppsNew = malloc(sizeof(FUNCTIONALITY)); - if (*ppsNew == NULL) - { - debug(LOG_ERROR, "createStructFunc: Out of memory"); - return FALSE; - } - return TRUE; -} - /*remove a structure Functionality from the heap*/ void removeStructFunc(FUNCTIONALITY *psDel) { @@ -677,63 +650,64 @@ void removeStructFunc(FUNCTIONALITY *psDel) //this function is similar to BOOL scrvGetBaseObj(UDWORD id, BASE_OBJECT **ppsObj) BASE_OBJECT *getBaseObjFromId(UDWORD id) { - UDWORD i; + unsigned int i; UDWORD player; BASE_OBJECT *psObj; DROID *psTrans; - for(i=0; i<7; i++) + for(i = 0; i < 7; ++i) { - for(player=0; playerid == id) @@ -755,14 +729,14 @@ BASE_OBJECT *getBaseObjFromId(UDWORD id) } } } - ASSERT( FALSE,"getBaseObjFromId() failed for id %d", id ); + ASSERT(!"couldn't find a BASE_OBJ with ID", "getBaseObjFromId() failed for id %d", id); return NULL; } UDWORD getRepairIdFromFlag(FLAG_POSITION *psFlag) { - UDWORD i; + unsigned int i; UDWORD player; STRUCTURE *psObj; REPAIR_FACILITY *psRepair; @@ -771,20 +745,21 @@ UDWORD getRepairIdFromFlag(FLAG_POSITION *psFlag) player = psFlag->player; //probably dont need to check mission list - for(i=0; i<2; i++) + for(i = 0; i < 2; ++i) { switch (i) { - case 0: - psObj=(STRUCTURE *)apsStructLists[player]; - break; - case 1: - psObj=(STRUCTURE *)mission.apsStructLists[player]; - break; - default: - psObj = NULL; - break; + case 0: + psObj=(STRUCTURE *)apsStructLists[player]; + break; + case 1: + psObj=(STRUCTURE *)mission.apsStructLists[player]; + break; + default: + psObj = NULL; + break; } + while (psObj) { if (psObj->pFunctionality) @@ -802,7 +777,7 @@ UDWORD getRepairIdFromFlag(FLAG_POSITION *psFlag) psObj = psObj->psNext; } } - ASSERT( FALSE,"getRepairIdFromFlag() failed" ); + ASSERT(!"unable to find repair id for FLAG_POSITION", "getRepairIdFromFlag() failed"); return UDWORD_MAX; } @@ -811,63 +786,64 @@ UDWORD getRepairIdFromFlag(FLAG_POSITION *psFlag) // check a base object exists for an ID BOOL checkValidId(UDWORD id) { - UDWORD i; + unsigned int i; UDWORD player; BASE_OBJECT *psObj; DROID *psTrans; - for(i=0; i<7; i++) + for(i = 0; i < 7; ++i) { - for(player=0; playerid == id) @@ -889,7 +865,7 @@ BOOL checkValidId(UDWORD id) } } } - ASSERT( FALSE,"checkValidId() failed for id %d", id ); + ASSERT(!"invalid ID for BASE_OBJ", "checkValidId() failed for id %d", id); return FALSE; } diff --git a/src/objmem.h b/src/objmem.h index a1a2728a3..ee9c38e57 100644 --- a/src/objmem.h +++ b/src/objmem.h @@ -50,7 +50,7 @@ extern void objmemShutdown(void); extern void objmemUpdate(void); /* Create a new droid */ -extern BOOL createDroid(UDWORD player, DROID **ppsNew); +extern DROID* createDroid(UDWORD player); /* add the droid to the Droid Lists */ extern void addDroid(DROID *psDroidToAdd, DROID *pList[MAX_PLAYERS]); @@ -71,7 +71,7 @@ extern void freeAllMissionDroids(void); extern void freeAllLimboDroids(void); /* Create a new structure */ -extern BOOL createStruct(UDWORD player, STRUCTURE **ppsNew); +extern STRUCTURE* createStruct(UDWORD player); /* add the structure to the Structure Lists */ extern void addStructure(STRUCTURE *psStructToAdd); @@ -87,7 +87,7 @@ extern void removeStructureFromList(STRUCTURE *psStructToRemove, STRUCTURE *pList[MAX_PLAYERS]); /* Create a new Feature */ -extern BOOL createFeature(FEATURE **ppsNew); +extern FEATURE* createFeature(void); /* add the feature to the Feature Lists */ extern void addFeature(FEATURE *psFeatureToAdd); @@ -108,11 +108,6 @@ extern void removeFlagPosition(FLAG_POSITION *psDel); extern void freeAllFlagPositions(void); extern void freeAllAssemblyPoints(void); -/* Create a new Structure Functionality*/ -extern BOOL createStructFunc(FUNCTIONALITY **ppsNew); -/*remove a structure Functionality from the heap*/ -extern void removeStructFunc(FUNCTIONALITY *psDel); - // Find a base object from it's id extern BASE_OBJECT *getBaseObjFromId(UDWORD id); extern BOOL checkValidId(UDWORD id); diff --git a/src/structure.c b/src/structure.c index 10e0e6ff4..9820553b5 100644 --- a/src/structure.c +++ b/src/structure.c @@ -462,7 +462,7 @@ static void structureType(STRUCTURE_STATS *pStructure, char *pType) pStructure->type = REF_SAT_UPLINK; return; } - ASSERT( FALSE, "Unknown Structure Type" ); + ASSERT(!"unknown structure type", "structureType: Unknown Structure Type"); } @@ -1680,7 +1680,7 @@ STRUCTURE* buildStructure(STRUCTURE_STATS* pStructureType, UDWORD x, UDWORD y, U max = pStructureType - asStructureStats; if (max > numStructureStats) { - ASSERT( FALSE, "buildStructure: Invalid structure type" ); + ASSERT(!"invalid structure type", "buildStructure: Invalid structure type"); return NULL; } @@ -1694,7 +1694,7 @@ STRUCTURE* buildStructure(STRUCTURE_STATS* pStructureType, UDWORD x, UDWORD y, U //NEVER EVER EVER WANT MORE THAN 5 FACTORIES if (asStructLimits[selectedPlayer][max].currentQuantity > MAX_FACTORY) { - ASSERT(FALSE, "buildStructure: trying to build too many factories (%d max)", MAX_FACTORY); + ASSERT(!"attempting to construct too many factories", "buildStructure: trying to build too many factories (%d max)", MAX_FACTORY); return NULL; } } @@ -1703,14 +1703,14 @@ STRUCTURE* buildStructure(STRUCTURE_STATS* pStructureType, UDWORD x, UDWORD y, U //can only cope with MAX_OBJECTS research facilities if (asStructLimits[selectedPlayer][max].currentQuantity > MAX_OBJECTS) { - ASSERT(FALSE, "buildStructure: trying to build too many research facilities (%d max)", MAX_OBJECTS); + ASSERT(!"attempting to construct too many research facilities", "buildStructure: trying to build too many research facilities (%d max)", MAX_OBJECTS); return NULL; } } //HARD_CODE don't ever want more than one Las Sat structure if (isLasSat(pStructureType) && getLasSatExists(selectedPlayer)) { - ASSERT(FALSE, "buildStructure: trying to build too many Las Sat (1 max)"); + ASSERT(!"attempting to build more than 1 Las Sat center", "buildStructure: trying to build too many Las Sat (1 max)"); return NULL; } //HARD_CODE don't ever want more than one Sat Uplink structure @@ -1718,7 +1718,7 @@ STRUCTURE* buildStructure(STRUCTURE_STATS* pStructureType, UDWORD x, UDWORD y, U { if (asStructLimits[selectedPlayer][max].currentQuantity > 0) { - ASSERT(FALSE, "buildStructure: trying to build too many Sat Uplinks (1 max)"); + ASSERT(!"attempting to build more than 1 Sat Uplink", "buildStructure: trying to build too many Sat Uplinks (1 max)"); return NULL; } } @@ -1732,13 +1732,13 @@ STRUCTURE* buildStructure(STRUCTURE_STATS* pStructureType, UDWORD x, UDWORD y, U if(((x >> TILE_SHIFT) < TOO_NEAR_EDGE) || ((x >> TILE_SHIFT) > ( mapWidth - TOO_NEAR_EDGE))) { - ASSERT(FALSE, "buildStructure: x coord (%u) too near edge (req. distance is %u)", x, TOO_NEAR_EDGE); + ASSERT(!"attempting to build too closely to map-edge", "buildStructure: x coord (%u) too near edge (req. distance is %u)", x, TOO_NEAR_EDGE); return NULL; } if(((y >> TILE_SHIFT) < TOO_NEAR_EDGE) || ((y >> TILE_SHIFT) > ( mapHeight - TOO_NEAR_EDGE))) { - ASSERT(FALSE, "buildStructure: y coord (%u) too near edge (req. distance is %u)", y, TOO_NEAR_EDGE); + ASSERT(!"attempting to build too closely to map-edge", "buildStructure: y coord (%u) too near edge (req. distance is %u)", y, TOO_NEAR_EDGE); return NULL; } @@ -1755,7 +1755,8 @@ STRUCTURE* buildStructure(STRUCTURE_STATS* pStructureType, UDWORD x, UDWORD y, U } // allocate memory for and initialize a structure object - if (!createStruct(player, &psBuilding)) + psBuilding = createStruct(player); + if (psBuilding == NULL) { return NULL; } @@ -2039,7 +2040,7 @@ STRUCTURE* buildStructure(STRUCTURE_STATS* pStructureType, UDWORD x, UDWORD y, U if (psBuilding == NULL) { - ASSERT(FALSE, "No owning structure for this module - %s", getStructName(pStructureType)); + ASSERT(!"module has no owning structure", "No owning structure for this module - %s", getStructName(pStructureType)); return FALSE; } if (pStructureType->type == REF_FACTORY_MODULE) @@ -2256,9 +2257,10 @@ BOOL setFunctionality(STRUCTURE *psBuilding, UDWORD functionType) } //allocate the necessary space - if (!createStructFunc(&psBuilding->pFunctionality)) + psBuilding->pFunctionality = malloc(sizeof(FUNCTIONALITY)); + if (psBuilding->pFunctionality == NULL) { - debug( LOG_ERROR, "Out of memory" ); + debug(LOG_ERROR, "setFunctionality: Out of memory"); abort(); return FALSE; } @@ -2292,17 +2294,17 @@ BOOL setFunctionality(STRUCTURE *psBuilding, UDWORD functionType) addFlagPosition(psFactory->psAssemblyPoint); switch(functionType) { - case REF_FACTORY: - setFlagPositionInc(psFactory, psBuilding->player, FACTORY_FLAG); - break; - case REF_CYBORG_FACTORY: - setFlagPositionInc(psFactory, psBuilding->player, CYBORG_FLAG); - break; - case REF_VTOL_FACTORY: - setFlagPositionInc(psFactory, psBuilding->player, VTOL_FLAG); - break; - default: - ASSERT( FALSE, "setFunctionality: Invalid factory type" ); + case REF_FACTORY: + setFlagPositionInc(psFactory, psBuilding->player, FACTORY_FLAG); + break; + case REF_CYBORG_FACTORY: + setFlagPositionInc(psFactory, psBuilding->player, CYBORG_FLAG); + break; + case REF_VTOL_FACTORY: + setFlagPositionInc(psFactory, psBuilding->player, VTOL_FLAG); + break; + default: + ASSERT(!"invalid factory type", "setFunctionality: Invalid factory type"); } psFactory->psFormation = NULL; @@ -2319,9 +2321,10 @@ BOOL setFunctionality(STRUCTURE *psBuilding, UDWORD functionType) return FALSE; } //try and create the Structure - if (!createStructFunc(&psBuilding->pFunctionality)) + psBuilding->pFunctionality = malloc(sizeof(FUNCTIONALITY)); + if (psBuilding->pFunctionality == NULL) { - debug( LOG_ERROR, "Out of memory" ); + debug(LOG_ERROR, "setFunctionality: Out of memory"); abort(); return FALSE; } @@ -2346,9 +2349,10 @@ BOOL setFunctionality(STRUCTURE *psBuilding, UDWORD functionType) } //try and create the Structure - if (!createStructFunc(&psBuilding->pFunctionality)) + psBuilding->pFunctionality = malloc(sizeof(FUNCTIONALITY)); + if (psBuilding->pFunctionality == NULL) { - debug( LOG_ERROR, "Out of memory" ); + debug(LOG_ERROR, "setFunctionality: Out of memory"); abort(); return FALSE; } @@ -2377,9 +2381,10 @@ BOOL setFunctionality(STRUCTURE *psBuilding, UDWORD functionType) } //try and create the Structure - if (!createStructFunc(&psBuilding->pFunctionality)) + psBuilding->pFunctionality = malloc(sizeof(FUNCTIONALITY)); + if (psBuilding->pFunctionality == NULL) { - debug( LOG_ERROR, "Out of memory" ); + debug(LOG_ERROR, "setFunctionality: Out of memory"); abort(); return FALSE; } @@ -2432,9 +2437,10 @@ BOOL setFunctionality(STRUCTURE *psBuilding, UDWORD functionType) } //try and create the Structure - if (!createStructFunc(&psBuilding->pFunctionality)) + psBuilding->pFunctionality = malloc(sizeof(FUNCTIONALITY)); + if (psBuilding->pFunctionality == NULL) { - debug( LOG_ERROR, "Out of memory" ); + debug(LOG_ERROR, "setFunctionality: Out of memory"); abort(); return FALSE; } @@ -2485,9 +2491,10 @@ BOOL setFunctionality(STRUCTURE *psBuilding, UDWORD functionType) return FALSE; } //try and create the Structure - if (!createStructFunc(&psBuilding->pFunctionality)) + psBuilding->pFunctionality = malloc(sizeof(FUNCTIONALITY)); + if (psBuilding->pFunctionality == NULL) { - debug( LOG_ERROR, "Out of memory" ); + debug(LOG_ERROR, "setFunctionality: Out of memory"); abort(); return FALSE; } @@ -2519,19 +2526,19 @@ void assignFactoryCommandDroid(STRUCTURE *psStruct, DROID *psCommander) switch(psStruct->pStructureType->type) { - case REF_FACTORY: - typeFlag = FACTORY_FLAG; - break; - case REF_VTOL_FACTORY: - typeFlag = VTOL_FLAG; - break; - case REF_CYBORG_FACTORY: - typeFlag = CYBORG_FLAG; - break; - default: - ASSERT( FALSE,"assignfactorycommandUnit: unknown factory type" ); - typeFlag = FACTORY_FLAG; - break; + case REF_FACTORY: + typeFlag = FACTORY_FLAG; + break; + case REF_VTOL_FACTORY: + typeFlag = VTOL_FLAG; + break; + case REF_CYBORG_FACTORY: + typeFlag = CYBORG_FLAG; + break; + default: + ASSERT(!"unknown factory type", "assignfactorycommandUnit: unknown factory type"); + typeFlag = FACTORY_FLAG; + break; } // removing a commander from a factory @@ -4083,7 +4090,7 @@ void structureRelease(STRUCTURE *psBuilding) } //free up the space used by the functionality array - removeStructFunc(psBuilding->pFunctionality); + free(psBuilding->pFunctionality); } // remove the object from the grid @@ -4438,7 +4445,7 @@ BOOL validLocation(BASE_STATS *psStats, UDWORD x, UDWORD y, UDWORD player, break; case NUM_DIFF_BUILDINGS: case REF_BRIDGE: - ASSERT(FALSE, "validLocation: Bad structure type %u", psBuilding->type); + ASSERT(!"invalid structure type", "validLocation: Bad structure type %u", psBuilding->type); break; case REF_HQ: case REF_FACTORY: @@ -5551,7 +5558,7 @@ void findAssemblyPointPosition(UDWORD *pX, UDWORD *pY, UDWORD player) return; } /* If we got this far, then we failed - passed in values will be unchanged */ - ASSERT( FALSE, "findAssemblyPointPosition: unable to find a valid location!" ); + ASSERT(!"unable to find a valid location", "findAssemblyPointPosition: unable to find a valid location!"); } @@ -5610,23 +5617,23 @@ void setFlagPositionInc(void *pFunctionality, UDWORD player, UBYTE factoryType) #ifdef DEBUG switch (factoryType) { - case FACTORY_FLAG: - pType = "Factory"; - break; - case CYBORG_FLAG: - pType = "Cyborg Factory"; - break; - case VTOL_FLAG: - pType = "VTOL Factory"; - break; - case REPAIR_FLAG: - pType = "Repair Facility"; - break; - default: - pType = ""; - break; + case FACTORY_FLAG: + pType = "Factory"; + break; + case CYBORG_FLAG: + pType = "Cyborg Factory"; + break; + case VTOL_FLAG: + pType = "VTOL Factory"; + break; + case REPAIR_FLAG: + pType = "Repair Facility"; + break; + default: + pType = ""; + break; } - ASSERT( FALSE, "Building more than %d %s for player %d", MAX_FACTORY, pType, player ); + ASSERT(!"building more factories than allowed", "Building more than %d %s for player %d", MAX_FACTORY, pType, player); #endif inc = 1; } @@ -5877,7 +5884,7 @@ void checkForResExtractors(STRUCTURE *psBuilding) if (psBuilding->pStructureType->type != REF_POWER_GEN) { - ASSERT( FALSE, "checkForResExtractors: invalid structure type" ); + ASSERT(!"invalid structure type", "checkForResExtractors: invalid structure type"); return; } psPowerGen = (POWER_GEN *)psBuilding->pFunctionality; @@ -5956,7 +5963,7 @@ void checkForPowerGen(STRUCTURE *psBuilding) if (psBuilding->pStructureType->type != REF_RESOURCE_EXTRACTOR) { - ASSERT( FALSE, "checkForPowerGen: invalid structure type" ); + ASSERT(!"invalid structure type", "checkForPowerGen: invalid structure type"); return; } psRE = (RES_EXTRACTOR *)psBuilding->pFunctionality; @@ -6011,7 +6018,7 @@ void informPowerGen(STRUCTURE *psStruct) if (psStruct->pStructureType->type != REF_RESOURCE_EXTRACTOR) { - ASSERT( FALSE, "informPowerGen: invalid structure type" ); + ASSERT(!"invalid structure type", "informPowerGen: invalid structure type"); return; } @@ -6042,7 +6049,7 @@ void releaseResExtractor(STRUCTURE *psRelease) if (psRelease->pStructureType->type != REF_RESOURCE_EXTRACTOR) { - ASSERT( FALSE, "releaseResExtractor:Invalid structure type" ); + ASSERT(!"invalid structure type", "releaseResExtractor:Invalid structure type"); return; } @@ -6081,7 +6088,7 @@ void releasePowerGen(STRUCTURE *psRelease) if (psRelease->pStructureType->type != REF_POWER_GEN) { - ASSERT( FALSE, "releasePowerGen:Invalid structure type" ); + ASSERT(!"invalid structure type", "releasePowerGen: Invalid structure type"); return; } @@ -6367,14 +6374,14 @@ BOOL electronicDamage(BASE_OBJECT *psTarget, UDWORD damage, UBYTE attackPlayer) psDroid = (DROID *)psTarget; bCompleted = FALSE; - ASSERT( psDroid != NULL, "electronicDamage: Invalid Droid pointer" ); + ASSERT(psDroid != NULL, "electronicDamage: Invalid Droid pointer"); //in multiPlayer cannot attack a Transporter with EW if (bMultiPlayer) { if (psDroid->droidType == DROID_TRANSPORTER) { - ASSERT( FALSE, "electronicDamage: Cannot attack a Transporter in multiPlayer" ); + ASSERT(!"can't attack a Transporter while in multiplayer", "electronicDamage: Cannot attack a Transporter in multiPlayer"); return TRUE; } } @@ -7355,7 +7362,7 @@ void checkDeliveryPoints(UDWORD version) // add an assembly point if (!createFlagPosition(&psRepair->psDeliveryPoint, psStruct->player)) { - ASSERT( FALSE,"checkDeliveryPoints: unable to create new delivery point for repair facility" ); + ASSERT(!"can't create new deilivery point for repair facility", "checkDeliveryPoints: unable to create new delivery point for repair facility"); return; } addFlagPosition(psRepair->psDeliveryPoint);