[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src/clone unit.c
From: |
Jimmy Salmon |
Subject: |
[Stratagus-CVS] stratagus/src/clone unit.c |
Date: |
Fri, 21 Nov 2003 22:13:45 -0500 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Jimmy Salmon <address@hidden> 03/11/21 22:13:43
Modified files:
src/clone : unit.c
Log message:
Fixed warnings
Patches:
Index: stratagus/src/clone/unit.c
diff -u stratagus/src/clone/unit.c:1.342 stratagus/src/clone/unit.c:1.343
--- stratagus/src/clone/unit.c:1.342 Thu Nov 20 15:35:44 2003
+++ stratagus/src/clone/unit.c Fri Nov 21 22:13:40 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit.c,v 1.342 2003/11/20 20:35:44 n0body Exp $
+// $Id: unit.c,v 1.343 2003/11/22 03:13:40 jsalmon3 Exp $
//@{
@@ -373,7 +373,7 @@
type = unit->Type;
//
- // Build player unit table
+ // Build player unit table
//
if (player && !type->Vanishes && unit->Orders[0].Action != UnitActionDie) {
unit->PlayerSlot = player->Units + player->TotalNumUnits++;
@@ -479,9 +479,9 @@
#endif
#ifdef MAP_REGIONS
- if (type->Building &&
- (type->FieldFlags &
- (MapFieldLandUnit | MapFieldSeaUnit | MapFieldBuilding |
+ if (type->Building &&
+ (type->FieldFlags &
+ (MapFieldLandUnit | MapFieldSeaUnit | MapFieldBuilding |
MapFieldUnpassable | MapFieldWall | MapFieldRocks | MapFieldForest))){
MapSplitterTilesOccuped(x, y, x + type->TileWidth - 1, y +
type->TileHeight - 1);
}
@@ -676,9 +676,9 @@
//
// Update map splitting.
//
- if (type->Building &&
- (type->FieldFlags &
- (MapFieldLandUnit | MapFieldSeaUnit | MapFieldBuilding |
+ if (type->Building &&
+ (type->FieldFlags &
+ (MapFieldLandUnit | MapFieldSeaUnit | MapFieldBuilding |
MapFieldUnpassable | MapFieldWall | MapFieldRocks | MapFieldForest))){
MapSplitterTilesCleared(unit->X, unit->Y,
unit->X + type->TileWidth - 1, unit->Y + type->TileHeight - 1);
@@ -973,7 +973,7 @@
if (unit->Type->PermanentCloak) {
return 0;
}
-
+
// Unit is visible under fog and was already discovered once.
if (unit->Type->VisibleUnderFog && unit->SeenFrame!=UnitNotSeen) {
return 1;
@@ -985,7 +985,7 @@
/**
** This function fills in the Seen fields of an unit from current fields.
** To be called when unit goes out of view, or when the map is revealed.
-**
+**
** @param unit The unit to work on
*/
local void UnitFillSeenValues(Unit* unit)
@@ -1059,7 +1059,7 @@
** @param player The player to mark for.
** @param x x location to check if building is on, and mark as seen
** @param y y location to check if building is on, and mark as seen
-** @param cloak If this is for cloaked units.
+** @param cloak If this is for cloaked units.
*/
global void UnitsMarkSeen(const Player* player, int x, int y, int cloak)
{
@@ -1072,7 +1072,7 @@
DebugLevel3Fn("I can see %d units from here.\n" _C_ n);
while (n) {
unit = units[--n];
- if (cloak != unit->Type->PermanentCloak) {
+ if (cloak != (int)unit->Type->PermanentCloak) {
continue;
}
for (p = 0; p < PlayerMax ; ++p) {
@@ -1105,7 +1105,7 @@
DebugLevel3Fn("I can see %d units from here.\n" _C_ n);
while (n) {
unit = units[--n];
- if (cloak != unit->Type->PermanentCloak) {
+ if (cloak != (int)unit->Type->PermanentCloak) {
continue;
}
for (p = 0; p < PlayerMax ; ++p) {
@@ -1417,15 +1417,15 @@
// FIXME: an unit is moving (the unit stops when between map cells.)
/*for (i = 0; i < MAX_ORDERS; ++i) {
- if (unit->Orders[i].Action == UnitActionAttack ||
- unit->Orders[i].Action == UnitActionAttackGround) {
- //Now see if it's an enemy..
- //FIXME:Just Stops attacking at the moment
- printf("Stopped attack for a/an %s,\n", unit->Type->Name);
- unit->Orders[i].Action = UnitActionStill;
- unit->SubAction = unit->State = 0;
- break;
- }
+ if (unit->Orders[i].Action == UnitActionAttack ||
+ unit->Orders[i].Action == UnitActionAttackGround) {
+ // Now see if it's an enemy..
+ // FIXME:Just Stops attacking at the moment
+ printf("Stopped attack for a/an %s,\n", unit->Type->Name);
+ unit->Orders[i].Action = UnitActionStill;
+ unit->SubAction = unit->State = 0;
+ break;
+ }
}*/
//
@@ -1975,7 +1975,7 @@
return 0;
}
}
-
+
// resource deposit can't be build too near to resource
// FIXME: use unit-cache here.
for (i = 0; i < NumUnits; ++i) {
@@ -2152,7 +2152,7 @@
if (unit && unit->Player->Type == PlayerPerson) {
player = unit->Player;
}
-
+
for (h = type->TileHeight; h--;) {
for (w = type->TileWidth; w--;) {
if (!CanBuildOn(x + w, y + h, mask)) {
@@ -2196,9 +2196,9 @@
/**
** Find the closest piece of terrain with the given flags.
**
-** @param movemask The movement mask to reach that location.
+** @param movemask The movement mask to reach that location.
** @param resmask Result tile mask.
-** @param rvresult Return a tile that doesn't match.
+** @param rvresult Return a tile that doesn't match.
** @param range Maximum distance for the search.
** @param player Only search fields explored by player
** @param x Map X start position for the search.
@@ -2268,7 +2268,7 @@
y = ry + yoffset[i];
// Make sure we don't leave the map.
if (x < 0 || y < 0 || x >= TheMap.Width || y >= TheMap.Height) {
- continue;
+ continue;
}
m = matrix + x + y * w;
// Check if visited or unexplored
@@ -2460,7 +2460,7 @@
}
/**
-** Find deposit. This will find a deposit for a resource
+** Find deposit. This will find a deposit for a resource
**
** @param unit The unit that wants to find a resource.
** @param x Closest to x
@@ -3284,11 +3284,11 @@
int i;
for (i = 0; i < NumberBoolFlag; i++) {
- if (source->CanTargetFlag[i] != CONDITION_TRUE) {
- if ((source->CanTargetFlag[i] == CONDITION_ONLY) ^
(dest->BoolFlag[i])) {
- return 0;
- }
- }
+ if (source->CanTargetFlag[i] != CONDITION_TRUE) {
+ if ((source->CanTargetFlag[i] == CONDITION_ONLY) ^
(dest->BoolFlag[i])) {
+ return 0;
+ }
+ }
}
if (dest->UnitType == UnitTypeLand) {
if (dest->ShoreBuilding) {
@@ -3646,7 +3646,7 @@
++frame;
}
CLprintf(file, "\n 'data-builded '(");
-
+
if (unit->Data.Builded.Worker) {
CLprintf(file, "worker %s ",
ref = UnitReference(unit->Data.Builded.Worker));
@@ -3725,7 +3725,7 @@
int RunStart;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: units $Id: unit.c,v 1.342 2003/11/20 20:35:44
n0body Exp $\n\n");
+ CLprintf(file, ";;; MODULE: units $Id: unit.c,v 1.343 2003/11/22 03:13:40
jsalmon3 Exp $\n\n");
//
// Local variables