Permalink
Browse files

Apply rest of the patch that was mistakenly left out of

fcede64
Thanks to cybersphinx for the heads up.
  • Loading branch information...
1 parent 6f5bf39 commit 6bc90e6d2e0343d7d5e6e54be09f97f2c8e1cbd8 @vexed vexed committed Feb 26, 2012
Showing with 21 additions and 19 deletions.
  1. +1 −1 src/drive.cpp
  2. +3 −3 src/move.cpp
  3. +2 −2 src/scriptai.cpp
  4. +7 −5 src/scriptfuncs.cpp
  5. +4 −4 src/selection.cpp
  6. +2 −2 src/structure.cpp
  7. +2 −2 src/transporter.cpp
View
@@ -256,7 +256,7 @@ static void ChangeDriver(void)
{
if (psDroid->sMove.Status == MOVEDRIVE)
{
- ASSERT((psDroid->droidType != DROID_TRANSPORTER || psDroid->droidType != DROID_SUPERTRANSPORTER), "Tried to control a transporter" );
+ ASSERT((psDroid->droidType != DROID_TRANSPORTER && psDroid->droidType != DROID_SUPERTRANSPORTER), "Tried to control a transporter" );
secondarySetState(psDroid, DSO_HALTTYPE, DSS_HALT_GUARD);
psDroid->sMove.Status = MOVEINACTIVE;
}
View
@@ -1359,7 +1359,7 @@ static uint16_t moveGetDirection(DROID *psDroid)
Vector2i dest = target - src;
// Transporters don't need to avoid obstacles, but everyone else should
- if (psDroid->droidType != DROID_TRANSPORTER)
+ if (psDroid->droidType != DROID_TRANSPORTER && psDroid->droidType != DROID_SUPERTRANSPORTER)
{
dest = moveGetObstacleVector(psDroid, dest);
}
@@ -1626,7 +1626,7 @@ static void moveUpdateDroidPos(DROID *psDroid, int32_t dx, int32_t dy)
{
/* transporter going off-world will trigger next map, and is ok */
ASSERT(psDroid->droidType == DROID_TRANSPORTER || psDroid->droidType == DROID_SUPERTRANSPORTER, "droid trying to move off the map!");
- if (psDroid->droidType != DROID_TRANSPORTER)
+ if (psDroid->droidType != DROID_TRANSPORTER && psDroid->droidType != DROID_SUPERTRANSPORTER)
{
/* dreadful last-ditch crash-avoiding hack - sort this! - GJ */
destroyDroid(psDroid, gameTime);
@@ -1913,7 +1913,7 @@ static void moveUpdateVtolModel(DROID *psDroid, SDWORD speed, uint16_t direction
moveGetDroidPosDiffs( psDroid, &dx, &dy );
/* set slide blocking tile for map edge */
- if ( psDroid->droidType != DROID_TRANSPORTER )
+ if ( psDroid->droidType != DROID_TRANSPORTER && psDroid->droidType != DROID_SUPERTRANSPORTER)
{
moveCalcBlockingSlide(psDroid, &dx, &dy, direction, &slideDir);
}
View
@@ -115,7 +115,7 @@ bool scrGroupAddArea(void)
if (((SDWORD)psDroid->pos.x >= x1) && ((SDWORD)psDroid->pos.x <= x2) &&
((SDWORD)psDroid->pos.y >= y1) && ((SDWORD)psDroid->pos.y <= y2) &&
psDroid->droidType != DROID_COMMAND &&
- psDroid->droidType != DROID_TRANSPORTER )
+ (psDroid->droidType != DROID_TRANSPORTER && psDroid->droidType != DROID_SUPERTRANSPORTER))
{
psGroup->add(psDroid);
@@ -153,7 +153,7 @@ bool scrGroupAddAreaNoGroup(void)
if (((SDWORD)psDroid->pos.x >= x1) && ((SDWORD)psDroid->pos.x <= x2) &&
((SDWORD)psDroid->pos.y >= y1) && ((SDWORD)psDroid->pos.y <= y2) &&
psDroid->droidType != DROID_COMMAND &&
- psDroid->droidType != DROID_TRANSPORTER &&
+ (psDroid->droidType != DROID_TRANSPORTER && psDroid->droidType != DROID_SUPERTRANSPORTER) &&
psDroid->psGroup == NULL)
{
psGroup->add(psDroid);
View
@@ -1093,7 +1093,8 @@ bool scrAddDroidToMissionList(void)
#ifdef SCRIPT_CHECK_MAX_UNITS
// Don't build a new droid if player limit reached, unless it's a transporter.
- if( IsPlayerDroidLimitReached(player) && (psTemplate->droidType != DROID_TRANSPORTER) ) {
+ if( IsPlayerDroidLimitReached(player) && (psTemplate->droidType != DROID_TRANSPORTER && psTemplate->droidType != DROID_SUPERTRANSPORTER))
+ {
debug( LOG_NEVER, "scrAddUnit : Max units reached ,player %d\n", player );
psDroid = NULL;
} else
@@ -1134,7 +1135,8 @@ bool scrAddDroid(void)
#ifdef SCRIPT_CHECK_MAX_UNITS
// Don't build a new droid if player limit reached, unless it's a transporter.
- if( IsPlayerDroidLimitReached(player) && (psTemplate->droidType != DROID_TRANSPORTER) ) {
+ if( IsPlayerDroidLimitReached(player) && (psTemplate->droidType != DROID_TRANSPORTER && psTemplate->droidType != DROID_SUPERTRANSPORTER) )
+ {
debug( LOG_NEVER, "scrAddUnit : Max units reached ,player %d\n", player );
psDroid = NULL;
} else
@@ -8632,7 +8634,7 @@ bool scrTransporterCapacity(void)
return false;
}
- if(psDroid->droidType != DROID_TRANSPORTER)
+ if(psDroid->droidType != DROID_TRANSPORTER && psDroid->droidType != DROID_SUPERTRANSPORTER)
{
debug(LOG_ERROR, "scrTransporterCapacity(): passed droid is not a transporter");
return false;
@@ -8665,7 +8667,7 @@ bool scrTransporterFlying(void)
return false;
}
- if(psDroid->droidType != DROID_TRANSPORTER)
+ if(psDroid->droidType != DROID_TRANSPORTER && psDroid->droidType != DROID_SUPERTRANSPORTER)
{
debug(LOG_ERROR,"scrTransporterFlying(): passed droid is not a transporter");
return false;
@@ -8698,7 +8700,7 @@ bool scrUnloadTransporter(void)
return false;
}
- if(psDroid->droidType != DROID_TRANSPORTER)
+ if(psDroid->droidType != DROID_TRANSPORTER && psDroid->droidType != DROID_SUPERTRANSPORTER)
{
debug(LOG_ERROR,"scrUnloadTransporter(): passed droid is not a transporter");
return false;
View
@@ -59,7 +59,7 @@ static unsigned int selSelectAllUnits(unsigned int player, bool bOnScreen)
if (!bOnScreen || droidOnScreen(psDroid, 0))
{
/* can select everything except transporters */
- if (psDroid->droidType != DROID_TRANSPORTER)
+ if (psDroid->droidType != DROID_TRANSPORTER && psDroid->droidType != DROID_SUPERTRANSPORTER)
{
SelectDroid(psDroid);
count++;
@@ -89,7 +89,7 @@ static unsigned int selSelectAllSameProp(unsigned int player, PROPULSION_TYPE pr
PROPULSION_STATS *psPropStats = asPropulsionStats + psDroid->asBits[COMP_PROPULSION].nStat;
ASSERT(psPropStats != NULL, "invalid propulsion stats pointer");
/* Same as that asked for - don't want Transporters*/
- if (psPropStats->propulsionType == propType && psDroid->droidType != DROID_TRANSPORTER)
+ if (psPropStats->propulsionType == propType && (psDroid->droidType != DROID_TRANSPORTER && psDroid->droidType != DROID_SUPERTRANSPORTER))
{
SelectDroid(psDroid);
count++;
@@ -144,7 +144,7 @@ static unsigned int selSelectAllCombat(unsigned int player, bool bOnScreen)
if (!bOnScreen || droidOnScreen(psDroid, 0))
{
// we don't want to get the Transporter
- if (psDroid->droidType != DROID_TRANSPORTER)
+ if (psDroid->droidType != DROID_TRANSPORTER && psDroid->droidType != DROID_SUPERTRANSPORTER)
{
SelectDroid(psDroid);
count++;
@@ -242,7 +242,7 @@ static unsigned int selSelectAllDamaged(unsigned int player, bool bOnScreen)
if (!bOnScreen || droidOnScreen(psDroid, 0))
{
// we don't want to get the Transporter
- if (psDroid->droidType != DROID_TRANSPORTER)
+ if (psDroid->droidType != DROID_TRANSPORTER && psDroid->droidType != DROID_SUPERTRANSPORTER)
{
SelectDroid(psDroid);
count++;
View
@@ -2426,7 +2426,7 @@ static bool structPlaceDroid(STRUCTURE *psStructure, DROID_TEMPLATE *psTempl,
}
//if vtol droid - send it to ReArm Pad if one exists
placed = false;
- if (isVtolDroid(psNewDroid) && psNewDroid->droidType != DROID_TRANSPORTER)
+ if (isVtolDroid(psNewDroid) && (psNewDroid->droidType != DROID_TRANSPORTER && psNewDroid->droidType != DROID_SUPERTRANSPORTER))
{
moveToRearm(psNewDroid);
}
@@ -5829,7 +5829,7 @@ bool electronicDamage(BASE_OBJECT *psTarget, UDWORD damage, UBYTE attackPlayer)
//in multiPlayer cannot attack a Transporter with EW
if (bMultiPlayer)
{
- ASSERT_OR_RETURN(true, psDroid->droidType != DROID_TRANSPORTER, "Cannot attack a Transporter in multiPlayer");
+ ASSERT_OR_RETURN(true, (psDroid->droidType != DROID_TRANSPORTER && psDroid->droidType != DROID_SUPERTRANSPORTER), "Cannot attack a Transporter in multiPlayer");
}
if (psDroid->resistance == ACTION_START_TIME)
View
@@ -1027,8 +1027,8 @@ bool transporterIsEmpty(const DROID* psTransporter)
// Assume dead droids and non-transporter droids to be empty
return (isDead((const BASE_OBJECT*)psTransporter)
- || psTransporter->droidType != DROID_TRANSPORTER
- || psTransporter->droidType != DROID_SUPERTRANSPORTER
+ || (psTransporter->droidType != DROID_TRANSPORTER
+ && psTransporter->droidType != DROID_SUPERTRANSPORTER)
|| psTransporter->psGroup->psList == NULL
|| psTransporter->psGroup->psList == psTransporter);
}

0 comments on commit 6bc90e6

Please sign in to comment.