Remove dead Pumpkin code related to cleaning up wreckage. There is no wreckage in the game.
parent
1b6359e12c
commit
bb3d7fe92e
|
@ -121,7 +121,7 @@ const char* getDroidActionName(DROID_ACTION action)
|
|||
"DACTION_TRANSPORTIN", // 13 move transporter onworld
|
||||
"DACTION_DROIDREPAIR", // repairing a droid
|
||||
"DACTION_RESTORE", // 15 restore resistance points of a structure
|
||||
"DACTION_CLEARWRECK", // clearing building wreckage
|
||||
"DACTION_UNUSED",
|
||||
"DACTION_MOVEFIRE", // 17
|
||||
"DACTION_MOVETOBUILD", // moving to a new building location
|
||||
"DACTION_MOVETODEMOLISH", // 19 moving to a new demolition location
|
||||
|
@ -136,7 +136,7 @@ const char* getDroidActionName(DROID_ACTION action)
|
|||
"DACTION_WAITDURINGREPAIR", // waiting to be repaired by a facility
|
||||
"DACTION_MOVETODROIDREPAIR", // 29 moving to a new location next to droid to be repaired
|
||||
"DACTION_MOVETORESTORE", // moving to a low resistance structure
|
||||
"DACTION_MOVETOCLEAR", // 31 moving to a building wreck location
|
||||
"DACTION_UNUSED2",
|
||||
"DACTION_MOVETOREARM", // (32)moving to a rearming pad - VTOLS
|
||||
"DACTION_WAITFORREARM", // (33)waiting for rearm - VTOLS
|
||||
"DACTION_MOVETOREARMPOINT", // (34)move to rearm point - VTOLS - this actually moves them onto the pad
|
||||
|
@ -1762,7 +1762,6 @@ void actionUpdateDroid(DROID *psDroid)
|
|||
break;
|
||||
case DACTION_MOVETODEMOLISH:
|
||||
case DACTION_MOVETOREPAIR:
|
||||
case DACTION_MOVETOCLEAR:
|
||||
case DACTION_MOVETORESTORE:
|
||||
if (!psDroid->psTarStats)
|
||||
{
|
||||
|
@ -1784,9 +1783,6 @@ void actionUpdateDroid(DROID *psDroid)
|
|||
case DACTION_MOVETOREPAIR:
|
||||
psDroid->action = droidStartRepair(psDroid) ? DACTION_REPAIR : DACTION_NONE;
|
||||
break;
|
||||
case DACTION_MOVETOCLEAR:
|
||||
psDroid->action = droidStartClearing(psDroid) ? DACTION_CLEARWRECK : DACTION_NONE;
|
||||
break;
|
||||
case DACTION_MOVETORESTORE:
|
||||
psDroid->action = droidStartRestore(psDroid) ? DACTION_RESTORE : DACTION_NONE;
|
||||
break;
|
||||
|
@ -1818,7 +1814,6 @@ void actionUpdateDroid(DROID *psDroid)
|
|||
|
||||
case DACTION_DEMOLISH:
|
||||
case DACTION_REPAIR:
|
||||
case DACTION_CLEARWRECK:
|
||||
case DACTION_RESTORE:
|
||||
if (!psDroid->psTarStats)
|
||||
{
|
||||
|
@ -1836,10 +1831,6 @@ void actionUpdateDroid(DROID *psDroid)
|
|||
// DACTION_MOVETOREPAIR;
|
||||
actionUpdateFunc = droidUpdateRepair;
|
||||
break;
|
||||
case DACTION_CLEARWRECK:
|
||||
// DACTION_MOVETOCLEAR;
|
||||
actionUpdateFunc = droidUpdateClearing;
|
||||
break;
|
||||
case DACTION_RESTORE:
|
||||
// DACTION_MOVETORESTORE;
|
||||
actionUpdateFunc = droidUpdateRestore;
|
||||
|
@ -1875,16 +1866,6 @@ void actionUpdateDroid(DROID *psDroid)
|
|||
//use 0 for non-combat(only 1 'weapon')
|
||||
actionTargetTurret(psDroid, psDroid->psActionTarget[0], &psDroid->asWeaps[0]);
|
||||
}
|
||||
else if (psDroid->action == DACTION_CLEARWRECK)
|
||||
{
|
||||
//see if there is any other wreckage in the area
|
||||
FEATURE* const psNextWreck = checkForWreckage(psDroid);
|
||||
psDroid->action = DACTION_NONE;
|
||||
if (psNextWreck)
|
||||
{
|
||||
orderDroidObj(psDroid, DORDER_CLEARWRECK, psNextWreck, ModeImmediate);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
psDroid->action = DACTION_NONE;
|
||||
|
@ -2643,19 +2624,6 @@ static void actionDroidBase(DROID *psDroid, DROID_ACTION_DATA *psAction)
|
|||
setDroidActionTarget(psDroid, psAction->psObj, 0);
|
||||
moveDroidTo(psDroid, psAction->x, psAction->y);
|
||||
break;
|
||||
case DACTION_CLEARWRECK:
|
||||
ASSERT( psDroid->order == DORDER_CLEARWRECK,
|
||||
"cannot start clear action without a clear order" );
|
||||
psDroid->action = DACTION_MOVETOCLEAR;
|
||||
psDroid->actionPos.x = psAction->x;
|
||||
psDroid->actionPos.y = psAction->y;
|
||||
ASSERT( (psDroid->psTarget != NULL) && (psDroid->psTarget->type == OBJ_FEATURE),
|
||||
"invalid target for demolish order" );
|
||||
psDroid->psTarStats = (BASE_STATS *)((FEATURE *)psDroid->psTarget)->psStats;
|
||||
setDroidActionTarget(psDroid, psDroid->psTarget, 0);
|
||||
moveDroidTo(psDroid, psAction->x, psAction->y);
|
||||
break;
|
||||
|
||||
default:
|
||||
ASSERT(!"unknown action", "actionUnitBase: unknown action");
|
||||
break;
|
||||
|
|
|
@ -46,7 +46,7 @@ enum DROID_ACTION
|
|||
DACTION_TRANSPORTIN, ///< 13 move transporter onworld
|
||||
DACTION_DROIDREPAIR, ///< 14 repairing a droid
|
||||
DACTION_RESTORE, ///< 15 restore resistance points of a structure
|
||||
DACTION_CLEARWRECK, ///< clearing building wreckage
|
||||
DACTION_UNUSED,
|
||||
|
||||
// The states below are used by the action system
|
||||
// but should not be given as an action
|
||||
|
@ -64,7 +64,7 @@ enum DROID_ACTION
|
|||
DACTION_WAITDURINGREPAIR, ///< 28 waiting to be repaired by a facility
|
||||
DACTION_MOVETODROIDREPAIR, ///< 29 moving to a new location next to droid to be repaired
|
||||
DACTION_MOVETORESTORE, ///< 30 moving to a low resistance structure
|
||||
DACTION_MOVETOCLEAR, ///< 31 moving to a building wreck location
|
||||
DACTION_UNUSED2,
|
||||
DACTION_MOVETOREARM, ///< 32 moving to a rearming pad - VTOLS
|
||||
DACTION_WAITFORREARM, ///< 33 waiting for rearm - VTOLS
|
||||
DACTION_MOVETOREARMPOINT, ///< 34 move to rearm point - VTOLS - this actually moves them onto the pad
|
||||
|
|
|
@ -172,7 +172,6 @@ UDWORD scroll_speed_accel;
|
|||
|
||||
static bool buildingDamaged(STRUCTURE *psStructure);
|
||||
static bool repairDroidSelected(UDWORD player);
|
||||
static DROID *constructorDroidSelected(UDWORD player);
|
||||
static bool vtolDroidSelected(UDWORD player);
|
||||
static bool anyDroidSelected(UDWORD player);
|
||||
static bool cyborgDroidSelected(UDWORD player);
|
||||
|
@ -1906,21 +1905,6 @@ static void dealWithLMBStructure(STRUCTURE* psStructure, SELECTION_TYPE selectio
|
|||
}
|
||||
else
|
||||
{
|
||||
//if selected object is an upgradeable structure then don't
|
||||
//inform the interface (if not fully upgraded) and a any droid
|
||||
//is selected
|
||||
/* if (!(((psStructure->pStructureType->type == REF_FACTORY &&
|
||||
((FACTORY *)psStructure->pFunctionality)->capacity <
|
||||
NUM_FACTORY_MODULES) ||
|
||||
(psStructure->pStructureType->type == REF_RESEARCH &&
|
||||
((RESEARCH_FACILITY *)psStructure->pFunctionality)->capacity <
|
||||
NUM_RESEARCH_MODULES) ||
|
||||
(psStructure->pStructureType->type == REF_VTOL_FACTORY &&
|
||||
((FACTORY *)psStructure->pFunctionality)->capacity <
|
||||
NUM_FACTORY_MODULES)) &&
|
||||
//constructorDroidSelected(selectedPlayer)))
|
||||
anyDroidSelected(selectedPlayer)))*/
|
||||
|
||||
// now only display interface if nothing selected
|
||||
if (!anyDroidSelected(selectedPlayer))
|
||||
{
|
||||
|
@ -1987,15 +1971,6 @@ static void dealWithLMBStructure(STRUCTURE* psStructure, SELECTION_TYPE selectio
|
|||
|
||||
static void dealWithLMBFeature(FEATURE* psFeature)
|
||||
{
|
||||
//some features are targetable
|
||||
//check for constructor droid trying to remove wrecked building first
|
||||
if (psFeature->psStats->subType == FEAT_BUILD_WRECK &&
|
||||
(constructorDroidSelected(selectedPlayer) != NULL) )
|
||||
{
|
||||
orderSelectedObjAdd(selectedPlayer, (BASE_OBJECT*)psFeature, ctrlShiftDown());
|
||||
FeedbackOrderGiven();
|
||||
}
|
||||
|
||||
//go on to check for
|
||||
if (psFeature->psStats->damageable)
|
||||
{
|
||||
|
@ -2008,7 +1983,6 @@ static void dealWithLMBFeature(FEATURE* psFeature)
|
|||
FeedbackOrderGiven();
|
||||
}
|
||||
|
||||
|
||||
//clicking an oil field should start a build..
|
||||
if(psFeature->psStats->subType == FEAT_OIL_RESOURCE)
|
||||
{
|
||||
|
@ -2072,7 +2046,6 @@ static void dealWithLMBFeature(FEATURE* psFeature)
|
|||
break;
|
||||
}
|
||||
case FEAT_BOULDER:
|
||||
case FEAT_BUILD_WRECK:
|
||||
case FEAT_HOVER:
|
||||
case FEAT_OIL_RESOURCE:
|
||||
case FEAT_VEHICLE:
|
||||
|
@ -2768,10 +2741,6 @@ STRUCTURE *psStructure;
|
|||
{
|
||||
retVal = MT_RESOURCE;
|
||||
}
|
||||
else if(((FEATURE *)psNotDroid)->psStats->subType == FEAT_BUILD_WRECK)
|
||||
{
|
||||
retVal = MT_WRECKFEATURE;
|
||||
}
|
||||
else
|
||||
{
|
||||
retVal = MT_BLOCKING;
|
||||
|
@ -3038,27 +3007,6 @@ bool repairDroidSelected(UDWORD player)
|
|||
|
||||
}
|
||||
|
||||
/*Looks through the list of selected players droids to see if one is a constructor droid*/
|
||||
static DROID *constructorDroidSelected(UDWORD player)
|
||||
{
|
||||
DROID *psCurr;
|
||||
|
||||
for (psCurr = apsDroidLists[player]; psCurr != NULL; psCurr = psCurr->psNext)
|
||||
{
|
||||
//if (psCurr->selected && psCurr->droidType == DROID_CONSTRUCT)
|
||||
if (psCurr->selected && (
|
||||
psCurr->droidType == DROID_CONSTRUCT ||
|
||||
psCurr->droidType == DROID_CYBORG_CONSTRUCT))
|
||||
{
|
||||
return psCurr;
|
||||
}
|
||||
}
|
||||
|
||||
//didn't find one...
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
/*Looks through the list of selected players droids to see if one is a VTOL droid*/
|
||||
bool vtolDroidSelected(UDWORD player)
|
||||
{
|
||||
|
|
|
@ -157,7 +157,7 @@ MT_COMMAND,
|
|||
MT_ARTIFACT,
|
||||
MT_DAMFEATURE,
|
||||
MT_SENSOR,
|
||||
MT_WRECKFEATURE,
|
||||
MT_UNUSED,
|
||||
MT_CONSTRUCT,
|
||||
MT_SENSORSTRUCT,
|
||||
MT_SENSORSTRUCTDAM,
|
||||
|
|
|
@ -4178,7 +4178,6 @@ static void doConstructionLines( void )
|
|||
|
||||
else if ((psDroid->action == DACTION_DEMOLISH) ||
|
||||
(psDroid->action == DACTION_REPAIR) ||
|
||||
(psDroid->action == DACTION_CLEARWRECK) ||
|
||||
(psDroid->action == DACTION_RESTORE))
|
||||
{
|
||||
if(psDroid->psActionTarget[0])
|
||||
|
@ -4255,14 +4254,13 @@ static void addConstructionLine(DROID *psDroid, STRUCTURE *psStructure)
|
|||
// set the colour
|
||||
colour = pal_SetBrightness(UBYTE_MAX);
|
||||
|
||||
if (psDroid->action == DACTION_DEMOLISH || psDroid->action == DACTION_CLEARWRECK)
|
||||
if (psDroid->action == DACTION_DEMOLISH)
|
||||
{
|
||||
colour.byte.g = 0;
|
||||
colour.byte.b = 0;
|
||||
} else {
|
||||
colour.byte.r = 0;
|
||||
colour.byte.g = 0;
|
||||
}
|
||||
colour.byte.g = 0;
|
||||
|
||||
pie_TransColouredTriangle(pts, colour);
|
||||
}
|
||||
|
|
|
@ -1185,73 +1185,6 @@ bool droidUpdateDemolishing( DROID *psDroid )
|
|||
return true;
|
||||
}
|
||||
|
||||
/* Set up a droid to clear a wrecked building feature - returns true if successful */
|
||||
bool droidStartClearing( DROID *psDroid )
|
||||
{
|
||||
FEATURE *psFeature;
|
||||
|
||||
CHECK_DROID(psDroid);
|
||||
|
||||
ASSERT_OR_RETURN(false, psDroid->order == DORDER_CLEARWRECK, "unit is not clearing wreckage");
|
||||
psFeature = (FEATURE *)psDroid->psTarget;
|
||||
ASSERT_OR_RETURN(false, psFeature->type == OBJ_FEATURE, "target is not a feature");
|
||||
ASSERT_OR_RETURN(false, psFeature->psStats->subType == FEAT_BUILD_WRECK, "feature is not a wrecked building");
|
||||
|
||||
psDroid->actionStarted = gameTime;
|
||||
psDroid->actionPoints = 0;
|
||||
|
||||
CHECK_DROID(psDroid);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Update a construction droid while it is clearing
|
||||
returns true while continues */
|
||||
bool droidUpdateClearing( DROID *psDroid )
|
||||
{
|
||||
FEATURE *psFeature;
|
||||
UDWORD pointsToAdd, constructPoints;
|
||||
|
||||
CHECK_DROID(psDroid);
|
||||
|
||||
ASSERT_OR_RETURN(false, psDroid->action == DACTION_CLEARWRECK, "unit is not clearing wreckage");
|
||||
psFeature = (FEATURE *)psDroid->psTarget;
|
||||
ASSERT_OR_RETURN(false, psFeature->type == OBJ_FEATURE, "target is not a feature");
|
||||
ASSERT_OR_RETURN(false, psFeature->psStats->subType == FEAT_BUILD_WRECK, "feature is not a wrecked building");
|
||||
|
||||
if (psFeature->body > 0)
|
||||
{
|
||||
constructPoints = constructorPoints(asConstructStats + psDroid->
|
||||
asBits[COMP_CONSTRUCT].nStat, psDroid->player);
|
||||
|
||||
pointsToAdd = constructPoints * (gameTime - psDroid->actionStarted) /
|
||||
GAME_TICKS_PER_SEC;
|
||||
|
||||
psFeature->body -= (pointsToAdd - psDroid->actionPoints);
|
||||
|
||||
//store the amount just subtracted
|
||||
psDroid->actionPoints = pointsToAdd;
|
||||
}
|
||||
|
||||
/* check if structure is demolished */
|
||||
if ( psFeature->body <= 0 )
|
||||
{
|
||||
/* remove feature */
|
||||
removeFeature(psFeature);
|
||||
|
||||
/* reset target stats */
|
||||
psDroid->psTarStats = NULL;
|
||||
|
||||
CHECK_DROID(psDroid);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
CHECK_DROID(psDroid);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool droidStartRepair( DROID *psDroid )
|
||||
{
|
||||
STRUCTURE *psStruct;
|
||||
|
|
|
@ -303,12 +303,6 @@ extern bool droidUnderRepair(DROID *psDroid);
|
|||
//count how many Command Droids exist in the world at any one moment
|
||||
extern UBYTE checkCommandExist(UBYTE player);
|
||||
|
||||
/* Set up a droid to clear a wrecked building feature - returns true if successful */
|
||||
extern bool droidStartClearing( DROID *psDroid );
|
||||
/* Update a construction droid while it is clearing
|
||||
returns true while continues */
|
||||
extern bool droidUpdateClearing( DROID *psDroid );
|
||||
|
||||
/*For a given repair droid, check if there are any damaged droids within
|
||||
a defined range*/
|
||||
extern BASE_OBJECT * checkForRepairRange(DROID *psDroid,DROID *psTarget);
|
||||
|
|
112
src/feature.cpp
112
src/feature.cpp
|
@ -80,8 +80,6 @@ static const StringToEnum<FEATURE_TYPE> map_FEATURE_TYPE[] =
|
|||
{ "OIL RESOURCE", FEAT_OIL_RESOURCE },
|
||||
{ "BOULDER", FEAT_BOULDER },
|
||||
{ "VEHICLE", FEAT_VEHICLE },
|
||||
{ "DROID WRECK", FEAT_DROID },
|
||||
{ "BUILDING WRECK", FEAT_BUILD_WRECK },
|
||||
{ "BUILDING", FEAT_BUILDING },
|
||||
{ "OIL DRUM", FEAT_OIL_DRUM },
|
||||
{ "TREE", FEAT_TREE },
|
||||
|
@ -255,8 +253,7 @@ FEATURE * buildFeature(FEATURE_STATS *psStats, UDWORD x, UDWORD y,bool FromSave)
|
|||
psFeature->pos.x = x;
|
||||
psFeature->pos.y = y;
|
||||
|
||||
/* Dump down the building wrecks at random angles - still looks shit though */
|
||||
if(psStats->subType == FEAT_BUILD_WRECK || psStats->subType == FEAT_TREE)
|
||||
if (psStats->subType == FEAT_TREE)
|
||||
{
|
||||
psFeature->rot.direction = gameRand(DEG_360);
|
||||
}
|
||||
|
@ -290,14 +287,7 @@ FEATURE * buildFeature(FEATURE_STATS *psStats, UDWORD x, UDWORD y,bool FromSave)
|
|||
mapY = map_coord(y) - psStats->baseBreadth/2;
|
||||
|
||||
// set up the imd for the feature
|
||||
if(psFeature->psStats->subType==FEAT_BUILD_WRECK)
|
||||
{
|
||||
psFeature->sDisplay.imd = getRandomWreckageImd();
|
||||
}
|
||||
else
|
||||
{
|
||||
psFeature->sDisplay.imd = psStats->psImd;
|
||||
}
|
||||
psFeature->sDisplay.imd = psStats->psImd;
|
||||
|
||||
ASSERT_OR_RETURN(NULL, psFeature->sDisplay.imd, "No IMD for feature"); // make sure we have an imd.
|
||||
|
||||
|
@ -332,7 +322,7 @@ FEATURE * buildFeature(FEATURE_STATS *psStats, UDWORD x, UDWORD y,bool FromSave)
|
|||
auxSetBlocking(mapX + width, mapY + breadth, AIR_BLOCKED);
|
||||
}
|
||||
|
||||
if (psStats->subType != FEAT_GEN_ARTE && psStats->subType != FEAT_OIL_DRUM && psStats->subType != FEAT_BUILD_WRECK)
|
||||
if (psStats->subType != FEAT_GEN_ARTE && psStats->subType != FEAT_OIL_DRUM)
|
||||
{
|
||||
auxSetBlocking(mapX + width, mapY + breadth, FEATURE_BLOCKED);
|
||||
}
|
||||
|
@ -346,16 +336,6 @@ FEATURE * buildFeature(FEATURE_STATS *psStats, UDWORD x, UDWORD y,bool FromSave)
|
|||
}
|
||||
psFeature->pos.z = map_TileHeight(mapX,mapY);//jps 18july97
|
||||
|
||||
// // set up the imd for the feature
|
||||
// if(psFeature->psStats->subType==FEAT_BUILD_WRECK)
|
||||
// {
|
||||
// psFeature->sDisplay.imd = wreckageImds[rand()%MAX_WRECKAGE];
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// psFeature->sDisplay.imd = psStats->psImd;
|
||||
// }
|
||||
|
||||
return psFeature;
|
||||
}
|
||||
|
||||
|
@ -392,20 +372,6 @@ void featureUpdate(FEATURE *psFeat)
|
|||
// update the visibility for the feature
|
||||
processVisibilityLevel((BASE_OBJECT *)psFeat);
|
||||
|
||||
switch (psFeat->psStats->subType)
|
||||
{
|
||||
case FEAT_DROID:
|
||||
case FEAT_BUILD_WRECK:
|
||||
// //kill off wrecked droids and structures after 'so' long
|
||||
// if ((gameTime - psFeat->born) > WRECK_LIFETIME)
|
||||
// {
|
||||
destroyFeature(psFeat); // get rid of the now!!!
|
||||
// }
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
syncDebugFeature(psFeat, '>');
|
||||
}
|
||||
|
||||
|
@ -598,75 +564,3 @@ SDWORD getFeatureStatFromName( const char *pName )
|
|||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/*looks around the given droid to see if there is any building
|
||||
wreckage to clear*/
|
||||
FEATURE * checkForWreckage(DROID *psDroid)
|
||||
{
|
||||
FEATURE *psFeature;
|
||||
UDWORD startX, startY, incX, incY;
|
||||
SDWORD x=0, y=0;
|
||||
|
||||
startX = map_coord(psDroid->pos.x);
|
||||
startY = map_coord(psDroid->pos.y);
|
||||
|
||||
//look around the droid - max 2 tiles distance
|
||||
for (incX = 1, incY = 1; incX < WRECK_SEARCH; incX++, incY++)
|
||||
{
|
||||
/* across the top */
|
||||
y = startY - incY;
|
||||
for(x = startX - incX; x < (SDWORD)(startX + incX); x++)
|
||||
{
|
||||
if(TileHasFeature(mapTile(x,y)))
|
||||
{
|
||||
psFeature = getTileFeature(x, y);
|
||||
if(psFeature && psFeature->psStats->subType == FEAT_BUILD_WRECK)
|
||||
{
|
||||
return psFeature;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* the right */
|
||||
x = startX + incX;
|
||||
for(y = startY - incY; y < (SDWORD)(startY + incY); y++)
|
||||
{
|
||||
if(TileHasFeature(mapTile(x,y)))
|
||||
{
|
||||
psFeature = getTileFeature(x, y);
|
||||
if(psFeature && psFeature->psStats->subType == FEAT_BUILD_WRECK)
|
||||
{
|
||||
return psFeature;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* across the bottom*/
|
||||
y = startY + incY;
|
||||
for(x = startX + incX; x > (SDWORD)(startX - incX); x--)
|
||||
{
|
||||
if(TileHasFeature(mapTile(x,y)))
|
||||
{
|
||||
psFeature = getTileFeature(x, y);
|
||||
if(psFeature && psFeature->psStats->subType == FEAT_BUILD_WRECK)
|
||||
{
|
||||
return psFeature;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* the left */
|
||||
x = startX - incX;
|
||||
for(y = startY + incY; y > (SDWORD)(startY - incY); y--)
|
||||
{
|
||||
if(TileHasFeature(mapTile(x,y)))
|
||||
{
|
||||
psFeature = getTileFeature(x, y);
|
||||
if(psFeature && psFeature->psStats->subType == FEAT_BUILD_WRECK)
|
||||
{
|
||||
return psFeature;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -54,10 +54,6 @@ extern bool destroyFeature(FEATURE *psDel);
|
|||
/* get a feature stat id from its name */
|
||||
extern SDWORD getFeatureStatFromName(const char *pName);
|
||||
|
||||
/*looks around the given droid to see if there is any building
|
||||
wreckage to clear*/
|
||||
extern FEATURE * checkForWreckage(DROID *psDroid);
|
||||
|
||||
int32_t featureDamage(FEATURE *psFeature, UDWORD damage, WEAPON_CLASS weaponClass, WEAPON_SUBCLASS weaponSubClass, HIT_SIDE impactSide);
|
||||
|
||||
extern void featureInitVars(void);
|
||||
|
|
|
@ -29,32 +29,18 @@
|
|||
|
||||
enum FEATURE_TYPE
|
||||
{
|
||||
FEAT_BUILD_WRECK,
|
||||
FEAT_HOVER,
|
||||
FEAT_HOVER = 1, // hack since the one prior to this was removed
|
||||
FEAT_TANK,
|
||||
FEAT_GEN_ARTE,
|
||||
FEAT_OIL_RESOURCE,
|
||||
FEAT_BOULDER,
|
||||
FEAT_VEHICLE,
|
||||
FEAT_BUILDING,
|
||||
FEAT_DROID,
|
||||
FEAT_UNUSED,
|
||||
FEAT_LOS_OBJ,
|
||||
FEAT_OIL_DRUM,
|
||||
FEAT_TREE,
|
||||
FEAT_SKYSCRAPER,
|
||||
//FEAT_MESA, // no longer used
|
||||
//FEAT_MESA2,
|
||||
//FEAT_CLIFF,
|
||||
//FEAT_STACK,
|
||||
//FEAT_BUILD_WRECK1,
|
||||
//FEAT_BUILD_WRECK2,
|
||||
//FEAT_BUILD_WRECK3,
|
||||
//FEAT_BUILD_WRECK4,
|
||||
//FEAT_BOULDER1,
|
||||
//FEAT_BOULDER2,
|
||||
//FEAT_BOULDER3,
|
||||
//FEAT_FUTCAR,
|
||||
//FEAT_FUTVAN,
|
||||
};
|
||||
|
||||
/* Stats for a feature */
|
||||
|
|
|
@ -125,24 +125,6 @@ iIMDShape *getImdFromIndex(UDWORD index)
|
|||
}
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
iIMDShape *getRandomWreckageImd( void )
|
||||
{
|
||||
iIMDShape *WreckageIMD;
|
||||
|
||||
// Get a random wreckage
|
||||
WreckageIMD=(getImdFromIndex(MI_WRECK0 + rand()%((MI_WRECK4-MI_WRECK0)+1)));
|
||||
|
||||
// if it doesn't exsist (cam2) then get the first one
|
||||
if (WreckageIMD==NULL)
|
||||
{
|
||||
WreckageIMD=(getImdFromIndex(MI_WRECK0));
|
||||
}
|
||||
// check to make sure one exists (will fail on renderfeature if null)
|
||||
assert(WreckageIMD);
|
||||
|
||||
return(WreckageIMD);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
iIMDShape *getRandomDebrisImd( void )
|
||||
{
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
extern bool initMiscImds( void );
|
||||
extern iIMDShape *getImdFromIndex(UDWORD index);
|
||||
extern iIMDShape *getRandomWreckageImd( void );
|
||||
extern iIMDShape *getRandomDebrisImd( void );
|
||||
|
||||
#define MAX_DEBRIS 5
|
||||
|
|
|
@ -607,7 +607,7 @@ void recvMultiPlayerFeature(NETQUEUE queue)
|
|||
// must match _feature_type in featuredef.h
|
||||
static const char *feature_names[] =
|
||||
{
|
||||
"FEAT_BUILD_WRECK",
|
||||
"FEAT_UNUSED",
|
||||
"FEAT_HOVER",
|
||||
"FEAT_TANK",
|
||||
"FEAT_GEN_ARTE",
|
||||
|
@ -615,7 +615,7 @@ static const char *feature_names[] =
|
|||
"FEAT_BOULDER",
|
||||
"FEAT_VEHICLE",
|
||||
"FEAT_BUILDING",
|
||||
"FEAT_DROID",
|
||||
"FEAT_UNUSED",
|
||||
"FEAT_LOS_OBJ",
|
||||
"FEAT_OIL_DRUM",
|
||||
"FEAT_TREE",
|
||||
|
|
|
@ -693,7 +693,6 @@ void orderUpdateDroid(DROID *psDroid)
|
|||
case DORDER_REPAIR:
|
||||
case DORDER_DROIDREPAIR:
|
||||
case DORDER_RESTORE:
|
||||
case DORDER_CLEARWRECK:
|
||||
if (psDroid->action == DACTION_NONE ||
|
||||
psDroid->psTarget == NULL)
|
||||
{
|
||||
|
@ -1932,17 +1931,6 @@ void orderDroidBase(DROID *psDroid, DROID_ORDER_DATA *psOrder)
|
|||
setDroidTarget(psDroid, psOrder->psObj);
|
||||
actionDroid(psDroid, DACTION_RESTORE, psOrder->psObj);
|
||||
break;
|
||||
case DORDER_CLEARWRECK:
|
||||
if (!(psDroid->droidType == DROID_CONSTRUCT || psDroid->droidType == DROID_CYBORG_CONSTRUCT))
|
||||
{
|
||||
break;
|
||||
}
|
||||
psDroid->order = DORDER_CLEARWRECK;
|
||||
psDroid->orderX = psOrder->psObj->pos.x;
|
||||
psDroid->orderY = psOrder->psObj->pos.y;
|
||||
setDroidTarget(psDroid, psOrder->psObj);
|
||||
actionDroid(psDroid, DACTION_CLEARWRECK, psOrder->psObj);
|
||||
break;
|
||||
case DORDER_REARM:
|
||||
// didn't get executed before
|
||||
if (!isVtolDroid(psDroid))
|
||||
|
@ -2095,7 +2083,7 @@ bool validOrderForObj(DROID_ORDER order)
|
|||
order == DORDER_OBSERVE || order == DORDER_ATTACKTARGET || order == DORDER_RTR ||
|
||||
order == DORDER_RTR_SPECIFIED || order == DORDER_EMBARK || order == DORDER_GUARD ||
|
||||
order == DORDER_DROIDREPAIR || order == DORDER_RESTORE || order == DORDER_BUILDMODULE ||
|
||||
order == DORDER_REARM || order == DORDER_CLEARWRECK || order == DORDER_RECOVER);
|
||||
order == DORDER_REARM || order == DORDER_RECOVER);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2443,7 +2431,6 @@ bool orderDroidList(DROID *psDroid)
|
|||
case DORDER_OBSERVE:
|
||||
case DORDER_DROIDREPAIR:
|
||||
case DORDER_FIRESUPPORT:
|
||||
case DORDER_CLEARWRECK:
|
||||
case DORDER_DEMOLISH:
|
||||
case DORDER_HELPBUILD:
|
||||
case DORDER_BUILDMODULE:
|
||||
|
@ -2526,7 +2513,6 @@ void orderCheckList(DROID *psDroid)
|
|||
order == DORDER_OBSERVE ||
|
||||
order == DORDER_DROIDREPAIR ||
|
||||
order == DORDER_FIRESUPPORT ||
|
||||
order == DORDER_CLEARWRECK ||
|
||||
order == DORDER_DEMOLISH ||
|
||||
order == DORDER_HELPBUILD ||
|
||||
order == DORDER_BUILDMODULE)
|
||||
|
@ -2576,7 +2562,6 @@ static bool orderDroidObjAdd(DROID *psDroid, DROID_ORDER order, BASE_OBJECT *psO
|
|||
order != DORDER_OBSERVE &&
|
||||
order != DORDER_DROIDREPAIR &&
|
||||
order != DORDER_FIRESUPPORT &&
|
||||
order != DORDER_CLEARWRECK &&
|
||||
order != DORDER_DEMOLISH &&
|
||||
order != DORDER_HELPBUILD &&
|
||||
order != DORDER_BUILDMODULE)
|
||||
|
@ -2696,7 +2681,6 @@ DROID_ORDER chooseOrderObj(DROID *psDroid, BASE_OBJECT *psObj, bool altOrder)
|
|||
{
|
||||
DROID_ORDER order;
|
||||
STRUCTURE *psStruct;
|
||||
FEATURE *psFeature;
|
||||
|
||||
if (psDroid->droidType == DROID_TRANSPORTER)
|
||||
{
|
||||
|
@ -2930,21 +2914,6 @@ DROID_ORDER chooseOrderObj(DROID *psDroid, BASE_OBJECT *psObj, bool altOrder)
|
|||
}
|
||||
}
|
||||
}
|
||||
//check for constructor droid clearing up wrecked buildings
|
||||
else if ((psDroid->droidType == DROID_CONSTRUCT || psDroid->droidType == DROID_CYBORG_CONSTRUCT)
|
||||
&& psObj->type == OBJ_FEATURE)
|
||||
{
|
||||
psFeature = (FEATURE *) psObj;
|
||||
ASSERT(psObj != NULL, "Invalid feature pointer");
|
||||
if (psFeature->psStats->subType == FEAT_BUILD_WRECK)
|
||||
{
|
||||
order = DORDER_CLEARWRECK;
|
||||
}
|
||||
else
|
||||
{
|
||||
order = DORDER_NONE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
order = DORDER_NONE;
|
||||
|
@ -4230,7 +4199,7 @@ const char* getDroidOrderName(DROID_ORDER order)
|
|||
case DORDER_RESTORE: return "DORDER_RESTORE";
|
||||
case DORDER_SCOUT: return "DORDER_SCOUT";
|
||||
case DORDER_RUNBURN: return "DORDER_RUNBURN";
|
||||
case DORDER_CLEARWRECK: return "DORDER_CLEARWRECK";
|
||||
case DORDER_UNUSED: return "DORDER_UNUSED";
|
||||
case DORDER_PATROL: return "DORDER_PATROL";
|
||||
case DORDER_REARM: return "DORDER_REARM";
|
||||
case DORDER_RECOVER: return "DORDER_RECOVER";
|
||||
|
|
|
@ -67,7 +67,7 @@ enum DROID_ORDER
|
|||
DORDER_RESTORE, /**< restore resistance points for a structure. */
|
||||
DORDER_SCOUT, /**< 28 - same as move, but stop if an enemy is seen. */
|
||||
DORDER_RUNBURN, /**< run away on fire. */
|
||||
DORDER_CLEARWRECK, /**< 30 - constructor droid to clear up building wreckage. */
|
||||
DORDER_UNUSED,
|
||||
DORDER_PATROL, /**< move between two way points. */
|
||||
DORDER_REARM, /**< 32 - order a vtol to rearming pad. */
|
||||
DORDER_RECOVER, /**< pick up an artifact. */
|
||||
|
|
|
@ -1888,8 +1888,7 @@ bool scrAddFeature(void)
|
|||
|
||||
psStat = (FEATURE_STATS *)(asFeatureStats + iFeat);
|
||||
|
||||
ASSERT( psStat != NULL,
|
||||
"scrAddFeature: Invalid feature pointer" );
|
||||
ASSERT(psStat != NULL, "Invalid feature pointer");
|
||||
|
||||
if ( psStat != NULL )
|
||||
{
|
||||
|
@ -1902,20 +1901,7 @@ bool scrAddFeature(void)
|
|||
iTestX = map_coord(psFeat->pos.x);
|
||||
iTestY = map_coord(psFeat->pos.y);
|
||||
|
||||
if ( (iTestX == iMapX) && (iTestY == iMapY) )
|
||||
{
|
||||
if ( psFeat->psStats->subType == FEAT_BUILD_WRECK )
|
||||
{
|
||||
/* remove feature */
|
||||
removeFeature( psFeat );
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
ASSERT( false,
|
||||
"scrAddFeature: building feature on tile already occupied\n" );
|
||||
}
|
||||
}
|
||||
ASSERT(iTestX != iMapX || iTestY != iMapY, "Building feature on tile already occupied");
|
||||
}
|
||||
|
||||
psFeat = buildFeature( psStat, iX, iY, false );
|
||||
|
|
Loading…
Reference in New Issue