Fixed another MSVC related issue overlooked in last commit and some spelling mistakes

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@856 4a71c877-e1ca-e34f-864e-861f7616d084
master
Roman C 2006-11-25 16:53:00 +00:00
parent 9b7ab89441
commit 0d84e0609b
3 changed files with 7 additions and 7 deletions

View File

@ -215,10 +215,10 @@ BOOL aiBestNearestTarget(DROID *psDroid, BASE_OBJECT **ppsObj)
break;
}
/* Now calculate the overal weight */
/* Now calculate the overall weight */
newMod = asWeaponModifier[weaponEffect][(asPropulsionStats + targetDroid->asBits[COMP_PROPULSION].nStat)->propulsionType] //Weapon effect
- (WEIGHT_DIST_TILE_DROID * (dirtySqrt(psDroid->x, psDroid->y,targetDroid->x,targetDroid->y) >> TILE_SHIFT) ) //substract WEIGHT_DIST_TILE_DROID per tile, 128 world units in a tile
+ (damage * 10 / targetDroid->originalBody ) * WEIGHT_HEALTH_DROID //we prefere damaged droids
+ (damage * 10 / targetDroid->originalBody ) * WEIGHT_HEALTH_DROID //we prefer damaged droids
+ targetTypeBonus; //some droid types have higher priority
}
else if (psTarget->type == OBJ_STRUCTURE)
@ -242,10 +242,10 @@ BOOL aiBestNearestTarget(DROID *psDroid, BASE_OBJECT **ppsObj)
break;
}
/* Now calculate the overal weight */
/* Now calculate the overall weight */
newMod = asStructStrengthModifier[weaponEffect][targetStructure->pStructureType->strength] //Weapon effect
- (WEIGHT_DIST_TILE_STRUCT * (dirtySqrt(psDroid->x, psDroid->y,targetStructure->x,targetStructure->y) >> TILE_SHIFT) ) //substract WEIGHT_DIST_TILE_STRUCT per tile, 128 world units in a tile
+ (damage * 10 / structureBody(targetStructure) ) * WEIGHT_HEALTH_STRUCT //we prefere damaged structures
+ (damage * 10 / structureBody(targetStructure) ) * WEIGHT_HEALTH_STRUCT //we prefer damaged structures
+ targetTypeBonus; //some structure types have higher priority
/* Go for unfinished structures only if nothing else found (same for non-visible structures) */
@ -258,7 +258,7 @@ BOOL aiBestNearestTarget(DROID *psDroid, BASE_OBJECT **ppsObj)
continue;
}
/* We prefere objects we can see and can attack immediately */
/* We prefer objects we can see and can attack immediately */
if(!visibleObjWallBlock((BASE_OBJECT *)psDroid, psTarget))
{
newMod /= WEIGHT_NOT_VISIBLE_F;

View File

@ -31,7 +31,7 @@
#define WEIGHT_NOT_VISIBLE_F 10 //We really don't like objects we can't see
#define WEIGHT_SERVICE_DROIDS (WEIGHT_DIST_TILE_DROID * 5) //We don't want them to be repairing droids or structures while we are after them
#define WEIGHT_WEAPON_DROIDS (WEIGHT_DIST_TILE_DROID * 3) //We prefere to go after anything that has a gun and can hurt us
#define WEIGHT_WEAPON_DROIDS (WEIGHT_DIST_TILE_DROID * 3) //We prefer to go after anything that has a gun and can hurt us
#define WEIGHT_MILITARY_STRUCT WEIGHT_DIST_TILE_STRUCT //Droid/cyborg factories, repair facility; shouldn't have too much weight
#define WEIGHT_WEAPON_STRUCT WEIGHT_WEAPON_DROIDS //Same as weapon droids (?)

View File

@ -3441,7 +3441,7 @@ SDWORD getCompFromName(UDWORD compType, char *pName)
return count;
}
// psStats += statSize; doesn't work, structure alignment?
psStats = (BASE_STATS*)((void*)psStats + statSize);
psStats = (BASE_STATS*)((char*)psStats + statSize);
}
// DBPRINTF(("not found\n"));
//return -1 if record not found or an invalid component type is passed in