Skip to content

Commit

Permalink
Clean up super sensor handling. The WSS is not a counter-battery sensor
Browse files Browse the repository at this point in the history
since a while ago, so remove superfluous and bad checks.
  • Loading branch information
perim committed Mar 15, 2013
1 parent d80cad9 commit 983d77d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
3 changes: 1 addition & 2 deletions src/action.cpp
Expand Up @@ -1661,8 +1661,7 @@ void actionUpdateDroid(DROID *psDroid)
// align the turret // align the turret
actionTargetTurret(psDroid, psDroid->psActionTarget[0], &psDroid->asWeaps[0]); actionTargetTurret(psDroid, psDroid->psActionTarget[0], &psDroid->asWeaps[0]);


// WSS shouldn't get a free pass to hit anything on map if (order->type != DORDER_HOLD && !cbSensorDroid(psDroid))
if (order->type != DORDER_HOLD && !cbSensorDroid(psDroid) && !asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type != SUPER_SENSOR)
{ {
// make sure the target is within sensor range // make sure the target is within sensor range
const int xdiff = (SDWORD)psDroid->pos.x - (SDWORD)psDroid->psActionTarget[0]->pos.x; const int xdiff = (SDWORD)psDroid->pos.x - (SDWORD)psDroid->psActionTarget[0]->pos.x;
Expand Down
21 changes: 6 additions & 15 deletions src/droid.cpp
Expand Up @@ -3282,12 +3282,8 @@ bool cbSensorDroid(DROID *psDroid)
{ {
return false; return false;
} }

if (asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type == VTOL_CB_SENSOR
/*Super Sensor works as any type*/ || asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type == INDIRECT_CB_SENSOR)
if (asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type ==
VTOL_CB_SENSOR ||
asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type ==
INDIRECT_CB_SENSOR)
{ {
return true; return true;
} }
Expand All @@ -3302,18 +3298,13 @@ bool standardSensorDroid(DROID *psDroid)
{ {
return false; return false;
} }

if (asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type == VTOL_INTERCEPT_SENSOR
/*Super Sensor works as any type*/ || asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type == STANDARD_SENSOR
if (asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type == || asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type == SUPER_SENSOR)
VTOL_INTERCEPT_SENSOR ||
asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type ==
STANDARD_SENSOR ||
asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type ==
SUPER_SENSOR)
{ {
return true; return true;
} }

return false; return false;
} }


Expand Down
3 changes: 1 addition & 2 deletions src/visibility.cpp
Expand Up @@ -526,8 +526,7 @@ static void processVisibilitySelf(BASE_OBJECT *psObj)
setSeenByInstantly(psStruct->psTarget[0], psObj->player, UBYTE_MAX); setSeenByInstantly(psStruct->psTarget[0], psObj->player, UBYTE_MAX);
} }
DROID *psDroid = castDroid(psObj); DROID *psDroid = castDroid(psObj);
// WSS shouldn't get a free pass to hit anything on map if (psDroid != NULL && psDroid->action == DACTION_OBSERVE && cbSensorDroid(psDroid))
if (psDroid != NULL && psDroid->action == DACTION_OBSERVE && cbSensorDroid(psDroid) && asSensorStats[psDroid->asBits[COMP_SENSOR].nStat].type != SUPER_SENSOR)
{ {
// Anyone commenting this out will get a knee capping from John. // Anyone commenting this out will get a knee capping from John.
// You have been warned!! // You have been warned!!
Expand Down

0 comments on commit 983d77d

Please sign in to comment.