Add the purely cosmetic changes from trac ticket #97 to minimize patch size.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6181 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
cb2ec762e2
commit
ee5f151162
13
src/ai.c
13
src/ai.c
|
@ -555,16 +555,16 @@ static BOOL aiObjIsWall(BASE_OBJECT *psObj)
|
|||
/* See if there is a target in range */
|
||||
BOOL aiChooseTarget(BASE_OBJECT *psObj, BASE_OBJECT **ppsTarget, int weapon_slot, BOOL bUpdateTarget)
|
||||
{
|
||||
UDWORD radSquared;
|
||||
UDWORD radSquared;
|
||||
BASE_OBJECT *psTarget = NULL;
|
||||
SDWORD xdiff,ydiff, distSq, tarDist, minDist;//, longRange;
|
||||
SDWORD xdiff,ydiff, distSq, tarDist, minDist;
|
||||
BOOL bCBTower;
|
||||
STRUCTURE *psCStruct;
|
||||
DROID *psCommander;
|
||||
BOOL bCommanderBlock;
|
||||
UDWORD sensorRange = objSensorRange(psObj);
|
||||
SECONDARY_STATE state;
|
||||
SDWORD curTargetWeight=-1,newTargetWeight;
|
||||
SECONDARY_STATE state;
|
||||
SDWORD curTargetWeight=-1;
|
||||
|
||||
/* Get the sensor range */
|
||||
switch (psObj->type)
|
||||
|
@ -611,7 +611,7 @@ BOOL aiChooseTarget(BASE_OBJECT *psObj, BASE_OBJECT **ppsTarget, int weapon_slot
|
|||
BASE_OBJECT *psCurrTarget = ((DROID *)psObj)->psActionTarget[0];
|
||||
|
||||
/* find a new target */
|
||||
newTargetWeight = aiBestNearestTarget((DROID *)psObj, &psTarget, weapon_slot);
|
||||
int newTargetWeight = aiBestNearestTarget((DROID *)psObj, &psTarget, weapon_slot);
|
||||
|
||||
/* Calculate weight of the current target if updating; but take care not to target
|
||||
* ourselves... */
|
||||
|
@ -741,8 +741,7 @@ BOOL aiChooseTarget(BASE_OBJECT *psObj, BASE_OBJECT **ppsTarget, int weapon_slot
|
|||
}
|
||||
}
|
||||
|
||||
if ((psTarget == NULL) &&
|
||||
!bCommanderBlock)
|
||||
if (psTarget == NULL && !bCommanderBlock)
|
||||
{
|
||||
BASE_OBJECT *psCurr;
|
||||
|
||||
|
|
12
src/combat.c
12
src/combat.c
|
@ -108,13 +108,10 @@ void combFire(WEAPON *psWeap, BASE_OBJECT *psAttacker, BASE_OBJECT *psTarget, in
|
|||
|
||||
CHECK_OBJECT(psAttacker);
|
||||
CHECK_OBJECT(psTarget);
|
||||
|
||||
ASSERT( psWeap != NULL,
|
||||
"combFire: Invalid weapon pointer" );
|
||||
ASSERT(psWeap != NULL, "Invalid weapon pointer");
|
||||
|
||||
/* Watermelon:dont shoot if the weapon_slot of a vtol is empty */
|
||||
if (psAttacker->type == OBJ_DROID &&
|
||||
isVtolDroid(((DROID *)psAttacker)))
|
||||
if (psAttacker->type == OBJ_DROID && isVtolDroid(((DROID *)psAttacker)))
|
||||
{
|
||||
if (((DROID *)psAttacker)->sMove.iAttackRuns[weapon_slot] >= getNumAttackRuns(((DROID *)psAttacker), weapon_slot))
|
||||
{
|
||||
|
@ -152,12 +149,9 @@ void combFire(WEAPON *psWeap, BASE_OBJECT *psAttacker, BASE_OBJECT *psTarget, in
|
|||
case OBJ_DROID:
|
||||
psDroid = (DROID *)psAttacker;
|
||||
damLevel = PERCENT(psDroid->body, psDroid->originalBody);
|
||||
|
||||
break;
|
||||
case OBJ_STRUCTURE:
|
||||
damLevel = PERCENT(((STRUCTURE *)psAttacker)->body,
|
||||
//((STRUCTURE *)psAttacker)->baseBodyPoints);
|
||||
structureBody((STRUCTURE *)psAttacker));
|
||||
damLevel = PERCENT(((STRUCTURE *)psAttacker)->body, structureBody((STRUCTURE *)psAttacker));
|
||||
break;
|
||||
default:
|
||||
damLevel = 100;
|
||||
|
|
Loading…
Reference in New Issue