Remove all traces of the utterly useless apsOilList.
This deletion spree was inspired by the fact that the condition psStruct->type == REF_RESOURCE_EXTRACTOR can never be true for structures, since OBJ_STRUCTURE ≠ REF_RESOURCE_EXTRACTOR.master
parent
6f1584d262
commit
71d5f82078
|
@ -2401,7 +2401,6 @@ BOOL loadGame(const char *pGameToLoad, BOOL keepObjects, BOOL freeMem, BOOL User
|
|||
//clear all the messages?
|
||||
apsProxDisp[player] = NULL;
|
||||
apsSensorList[0] = NULL;
|
||||
apsOilList[0] = NULL;
|
||||
}
|
||||
initFactoryNumFlag();
|
||||
}
|
||||
|
@ -2417,7 +2416,6 @@ BOOL loadGame(const char *pGameToLoad, BOOL keepObjects, BOOL freeMem, BOOL User
|
|||
mission.apsFeatureLists[player] = NULL;
|
||||
mission.apsFlagPosLists[player] = NULL;
|
||||
}
|
||||
mission.apsOilList[0] = NULL;
|
||||
mission.apsSensorList[0] = NULL;
|
||||
|
||||
//JPS 25 feb
|
||||
|
|
|
@ -254,7 +254,6 @@ void initMission(void)
|
|||
apsLimboDroids[inc] = NULL;
|
||||
}
|
||||
mission.apsSensorList[0] = NULL;
|
||||
mission.apsOilList[0] = NULL;
|
||||
offWorldKeepLists = false;
|
||||
mission.time = -1;
|
||||
setMissionCountDown();
|
||||
|
@ -326,9 +325,7 @@ BOOL missionShutDown(void)
|
|||
mission.apsFlagPosLists[inc] = NULL;
|
||||
}
|
||||
apsSensorList[0] = mission.apsSensorList[0];
|
||||
apsOilList[0] = mission.apsOilList[0];
|
||||
mission.apsSensorList[0] = NULL;
|
||||
mission.apsOilList[0] = NULL;
|
||||
|
||||
psMapTiles = mission.psMapTiles;
|
||||
mapWidth = mission.mapWidth;
|
||||
|
@ -805,7 +802,6 @@ static void saveMissionData(void)
|
|||
mission.apsFlagPosLists[inc] = apsFlagPosLists[inc];
|
||||
}
|
||||
mission.apsSensorList[0] = apsSensorList[0];
|
||||
mission.apsOilList[0] = apsOilList[0];
|
||||
|
||||
mission.playerX = player.p.x;
|
||||
mission.playerY = player.p.z;
|
||||
|
@ -873,7 +869,6 @@ void restoreMissionData(void)
|
|||
mission.apsFlagPosLists[inc] = NULL;
|
||||
}
|
||||
apsSensorList[0] = mission.apsSensorList[0];
|
||||
apsOilList[0] = mission.apsOilList[0];
|
||||
mission.apsSensorList[0] = NULL;
|
||||
//swap mission data over
|
||||
|
||||
|
@ -1464,9 +1459,6 @@ void swapMissionPointers(void)
|
|||
pVoid = (void*)apsSensorList[0];
|
||||
apsSensorList[0] = mission.apsSensorList[0];
|
||||
mission.apsSensorList[0] = (BASE_OBJECT *)pVoid;
|
||||
pVoid = (void*)apsOilList[0];
|
||||
apsOilList[0] = mission.apsOilList[0];
|
||||
mission.apsOilList[0] = (BASE_OBJECT *)pVoid;
|
||||
}
|
||||
|
||||
void endMission(void)
|
||||
|
|
|
@ -67,7 +67,6 @@ typedef struct _mission
|
|||
DROID *apsDroidLists[MAX_PLAYERS];
|
||||
FEATURE *apsFeatureLists[MAX_PLAYERS];
|
||||
BASE_OBJECT *apsSensorList[1];
|
||||
BASE_OBJECT *apsOilList[1];
|
||||
//struct _proximity_display *apsProxDisp[MAX_PLAYERS];
|
||||
FLAG_POSITION *apsFlagPosLists[MAX_PLAYERS];
|
||||
int32_t asCurrentPower[MAX_PLAYERS];
|
||||
|
|
22
src/objmem.c
22
src/objmem.c
|
@ -64,7 +64,6 @@ DROID *apsDroidLists[MAX_PLAYERS];
|
|||
STRUCTURE *apsStructLists[MAX_PLAYERS];
|
||||
FEATURE *apsFeatureLists[MAX_PLAYERS]; ///< Only player zero is valid for features. TODO: Reduce to single list.
|
||||
BASE_OBJECT *apsSensorList[1]; ///< List of sensors in the game.
|
||||
BASE_OBJECT *apsOilList[1];
|
||||
|
||||
/*The list of Flag Positions allocated */
|
||||
FLAG_POSITION *apsFlagPosLists[MAX_PLAYERS];
|
||||
|
@ -589,10 +588,6 @@ void addStructure(STRUCTURE *psStructToAdd)
|
|||
{
|
||||
addObjectToFuncList(apsSensorList, (BASE_OBJECT*)psStructToAdd, 0);
|
||||
}
|
||||
else if (psStructToAdd->type == REF_RESOURCE_EXTRACTOR)
|
||||
{
|
||||
addObjectToFuncList(apsOilList, (BASE_OBJECT*)psStructToAdd, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Destroy a structure */
|
||||
|
@ -610,10 +605,6 @@ void killStruct(STRUCTURE *psBuilding)
|
|||
{
|
||||
removeObjectFromFuncList(apsSensorList, (BASE_OBJECT*)psBuilding, 0);
|
||||
}
|
||||
else if (psBuilding->type == REF_RESOURCE_EXTRACTOR)
|
||||
{
|
||||
removeObjectFromFuncList(apsOilList, (BASE_OBJECT*)psBuilding, 0);
|
||||
}
|
||||
|
||||
for (i = 0; i < STRUCT_MAXWEAPS; i++)
|
||||
{
|
||||
|
@ -674,10 +665,6 @@ void removeStructureFromList(STRUCTURE *psStructToRemove, STRUCTURE *pList[MAX_P
|
|||
{
|
||||
removeObjectFromFuncList(apsSensorList, (BASE_OBJECT*)psStructToRemove, 0);
|
||||
}
|
||||
else if (psStructToRemove->type == REF_RESOURCE_EXTRACTOR)
|
||||
{
|
||||
removeObjectFromFuncList(apsOilList, (BASE_OBJECT*)psStructToRemove, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/************************** FEATURE *********************************/
|
||||
|
@ -692,10 +679,6 @@ FEATURE* createFeature()
|
|||
void addFeature(FEATURE *psFeatureToAdd)
|
||||
{
|
||||
addObjectToList((BASE_OBJECT**)apsFeatureLists, (BASE_OBJECT*)psFeatureToAdd, 0);
|
||||
if (psFeatureToAdd->psStats->subType == FEAT_OIL_RESOURCE)
|
||||
{
|
||||
addObjectToFuncList(apsOilList, (BASE_OBJECT*)psFeatureToAdd, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Destroy a feature */
|
||||
|
@ -707,11 +690,6 @@ void killFeature(FEATURE *psDel)
|
|||
"killFeature: pointer is not a feature" );
|
||||
psDel->player = 0;
|
||||
destroyObject((BASE_OBJECT**)apsFeatureLists, (BASE_OBJECT*)psDel);
|
||||
|
||||
if (psDel->psStats->subType == FEAT_OIL_RESOURCE)
|
||||
{
|
||||
removeObjectFromFuncList(apsOilList, (BASE_OBJECT*)psDel, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove all features */
|
||||
|
|
|
@ -37,7 +37,6 @@ extern STRUCTURE *apsStructLists[MAX_PLAYERS];
|
|||
extern FEATURE *apsFeatureLists[MAX_PLAYERS];
|
||||
extern FLAG_POSITION *apsFlagPosLists[MAX_PLAYERS];
|
||||
extern BASE_OBJECT *apsSensorList[1];
|
||||
extern BASE_OBJECT *apsOilList[1];
|
||||
|
||||
/* The list of destroyed objects */
|
||||
extern BASE_OBJECT *psDestroyedObj;
|
||||
|
|
Loading…
Reference in New Issue