This commit is contained in:
Joris 2012-09-05 15:40:45 +02:00
parent 2fcae8f279
commit 6e64f99ecc
7 changed files with 21 additions and 21 deletions

View file

@ -697,7 +697,7 @@ void AiHelpMe(const CUnit *attacker, CUnit &defender)
const CUnit *oldGoal = orderAttack.GetGoal();
if (oldGoal == NULL || (ThreatCalculate(defender, *attacker) < ThreatCalculate(defender, *oldGoal)
&& aiunit.MapDistanceTo(defender) <= aiunit.Stats->Variables[ATTACKRANGE_INDEX].Max)) {
&& aiunit.MapDistanceTo(defender) <= aiunit.Stats->Variables[ATTACKRANGE_INDEX].Max)) {
shouldAttack = true;
}
}

View file

@ -306,8 +306,8 @@ VisitResult AiForceRallyPointFinder::Visit(TerrainTraversal &terrainTraversal, c
{
if (AiEnemyUnitsInDistance(*startUnit.Player, NULL, pos, 20) == false
&& Distance(pos, startPos) <= distance) {
*resultPos = pos;
return VisitResult_Finished;
*resultPos = pos;
return VisitResult_Finished;
}
if (CanMoveToMask(pos, movemask)) { // reachable
return VisitResult_Ok;
@ -808,7 +808,7 @@ void AiForce::Update()
// No enemy found, give up
// FIXME: should the force go home or keep trying to attack?
DebugPrint("%d: Attack force #%lu can't find a target, giving up\n"
_C_ AiPlayer->Player->Index _C_(long unsigned int)(this - & (AiPlayer->Force[0])));
_C_ AiPlayer->Player->Index _C_(long unsigned int)(this - & (AiPlayer->Force[0])));
Attacking = false;
State = AiForceAttackingState_Waiting;
return;

View file

@ -101,7 +101,7 @@
Exit(1);
return;
}
const int rop = ParseAnimInt(&unit, this->valueStr.c_str());
int value = 0;
if (!strcmp(next + 1, "Value")) {

View file

@ -1146,8 +1146,8 @@ MissileType::MissileType(const std::string &ident) :
Ident(ident), Transparency(0), DrawLevel(0),
SpriteFrames(0), NumDirections(0), ChangeVariable(-1), ChangeAmount(0), ChangeMax(false),
CorrectSphashDamage(false), Flip(false), CanHitOwner(false), FriendlyFire(false),
AlwaysFire(false), Pierce(false), PierceOnce(false), Class(), NumBounces(0), StartDelay(0),
Sleep(0), Speed(0), TTL(-1), Damage(0), Range(0), SplashFactor(0),
AlwaysFire(false), Pierce(false), PierceOnce(false), Class(), NumBounces(0), StartDelay(0),
Sleep(0), Speed(0), TTL(-1), Damage(0), Range(0), SplashFactor(0),
ImpactParticle(NULL), SmokeParticle(NULL),
G(NULL)
{

View file

@ -49,4 +49,4 @@ void MissileContinious::Action()
}
}
//@}
//@}

View file

@ -120,7 +120,7 @@ void CPlayer::Load(lua_State *l)
LuaError(l, "Unsupported tag: %s" _C_ value);
}
} else if (!strcmp(value, "race")) {
const char* raceName = LuaToString(l, j + 1);
const char *raceName = LuaToString(l, j + 1);
this->Race = PlayerRaces.GetRaceIndexByName(raceName);
if (this->Race == -1) {
LuaError(l, "Unsupported race: %s" _C_ raceName);

View file

@ -2289,19 +2289,19 @@ CUnit *UnitOnScreen(int x, int y)
//
PixelPos unitSpritePos = unit.GetMapPixelPosCenter();
unitSpritePos.x = unitSpritePos.x - type.BoxWidth / 2 -
(type.Width - type.Sprite->Width) / 2 + type.BoxOffsetX;
(type.Width - type.Sprite->Width) / 2 + type.BoxOffsetX;
unitSpritePos.y = unitSpritePos.y - type.BoxHeight / 2 -
(type.Height - type.Sprite->Height) / 2 + type.BoxOffsetY;
(type.Height - type.Sprite->Height) / 2 + type.BoxOffsetY;
if (x >= unitSpritePos.x && x < unitSpritePos.x + type.BoxWidth
&& y >= unitSpritePos.y && y < unitSpritePos.y + type.BoxHeight) {
// Check if there are other units on this place
candidate = &unit;
if ((candidate == Selected[0] && NumSelected == 1)
|| candidate->Type->IsNotSelectable) {
continue;
} else {
break;
}
// Check if there are other units on this place
candidate = &unit;
if ((candidate == Selected[0] && NumSelected == 1)
|| candidate->Type->IsNotSelectable) {
continue;
} else {
break;
}
} else {
continue;
}
@ -2747,8 +2747,8 @@ void HitUnit(CUnit *attacker, CUnit &target, int damage, const Missile *missile)
}
if (CanTarget(target.Type, attacker->Type)
&& (!best || (attacker && goal != attacker
&& (ThreatCalculate(target, *attacker) < ThreatCalculate(target, *best))))) {
best = attacker;
&& (ThreatCalculate(target, *attacker) < ThreatCalculate(target, *best))))) {
best = attacker;
}
if (best && best != oldgoal) {
CommandAttack(target, best->tilePos, best, FlushCommands);