[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src action/action_build.c action/acti...
From: |
ludovic pollet |
Subject: |
[Stratagus-CVS] stratagus/src action/action_build.c action/acti... |
Date: |
Tue, 18 Nov 2003 12:56:24 -0500 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: ludovic pollet <address@hidden> 03/11/18 12:56:24
Modified files:
src/action : action_build.c action_repair.c
action_research.c action_spellcast.c
action_train.c action_upgradeto.c command.c
src/clone : player.c spells.c unit.c unit_draw.c
Log message:
Fixed Ai me on & off crash.
Fixed building of shore buildings
Patches:
Index: stratagus/src/action/action_build.c
diff -u stratagus/src/action/action_build.c:1.103
stratagus/src/action/action_build.c:1.104
--- stratagus/src/action/action_build.c:1.103 Sun Nov 16 01:49:23 2003
+++ stratagus/src/action/action_build.c Tue Nov 18 12:56:17 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: action_build.c,v 1.103 2003/11/16 06:49:23 mr-russ Exp $
+// $Id: action_build.c,v 1.104 2003/11/18 17:56:17 pludov Exp $
//@{
@@ -115,7 +115,7 @@
NotifyPlayer(unit->Player, NotifyYellow, unit->X, unit->Y,
"You cannot reach building place");
- if (unit->Player->Ai) {
+ if (unit->Player->AiEnabled) {
AiCanNotReach(unit,type);
}
@@ -153,7 +153,7 @@
NotifyPlayer(unit->Player, NotifyYellow, unit->X, unit->Y,
"You cannot build %s here",type->Name);
- if (unit->Player->Ai) {
+ if (unit->Player->AiEnabled) {
AiCanNotBuild(unit, type);
}
@@ -182,7 +182,7 @@
// FIXME: Better tell what is missing?
NotifyPlayer(unit->Player, NotifyYellow, unit->X, unit->Y,
"Not enough resources to build %s", type->Name);
- if (unit->Player->Ai) {
+ if (unit->Player->AiEnabled) {
AiCanNotBuild(unit, type);
}
@@ -200,7 +200,7 @@
if (PlayerCheckLimits(unit->Player, type) < 0) {
NotifyPlayer(unit->Player, NotifyYellow, unit->X, unit->Y,
"Can't build more units %s", type->Name);
- if (unit->Player->Ai) {
+ if (unit->Player->AiEnabled) {
AiCanNotBuild(unit, type);
}
@@ -392,7 +392,7 @@
PlayUnitSound(unit, VoiceBuilding);
}
}
- if (unit->Player->Ai) {
+ if (unit->Player->AiEnabled) {
AiWorkComplete(worker, unit);
}
Index: stratagus/src/action/action_repair.c
diff -u stratagus/src/action/action_repair.c:1.59
stratagus/src/action/action_repair.c:1.60
--- stratagus/src/action/action_repair.c:1.59 Sun Nov 9 17:13:56 2003
+++ stratagus/src/action/action_repair.c Tue Nov 18 12:56:18 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: action_repair.c,v 1.59 2003/11/09 22:13:56 n0body Exp $
+// $Id: action_repair.c,v 1.60 2003/11/18 17:56:18 pludov Exp $
//@{
@@ -103,7 +103,7 @@
snprintf(buf, 100, "We need more %s for repair!",
DefaultResourceNames[i]);
NotifyPlayer(player, NotifyYellow, unit->X, unit->Y, buf);
- if (player->Ai) {
+ if (player->AiEnabled) {
// FIXME: call back to AI?
RefsDecrease(goal);
unit->Orders[0].Goal = NULL;
Index: stratagus/src/action/action_research.c
diff -u stratagus/src/action/action_research.c:1.33
stratagus/src/action/action_research.c:1.34
--- stratagus/src/action/action_research.c:1.33 Fri Oct 3 18:16:26 2003
+++ stratagus/src/action/action_research.c Tue Nov 18 12:56:18 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: action_research.c,v 1.33 2003/10/03 22:16:26 jsalmon3 Exp $
+// $Id: action_research.c,v 1.34 2003/11/18 17:56:18 pludov Exp $
//@{
@@ -96,7 +96,7 @@
NotifyPlayer(unit->Player, NotifyGreen, unit->X, unit->Y,
"%s: complete", unit->Type->Name);
- if (unit->Player->Ai) {
+ if (unit->Player->AiEnabled) {
AiResearchComplete(unit, upgrade);
}
UpgradeAcquire(unit->Player, upgrade);
Index: stratagus/src/action/action_spellcast.c
diff -u stratagus/src/action/action_spellcast.c:1.37
stratagus/src/action/action_spellcast.c:1.38
--- stratagus/src/action/action_spellcast.c:1.37 Sun Nov 9 17:13:56 2003
+++ stratagus/src/action/action_spellcast.c Tue Nov 18 12:56:18 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: action_spellcast.c,v 1.37 2003/11/09 22:13:56 n0body Exp $
+// $Id: action_spellcast.c,v 1.38 2003/11/18 17:56:18 pludov Exp $
/*
** This is inherited from action_attack.c, actually spell casting will
@@ -200,7 +200,7 @@
unit->Type->Name, spell->Name);
}
- if (unit->Player->Ai) {
+ if (unit->Player->AiEnabled) {
DebugLevel0Fn("FIXME: need we an AI callback?\n");
}
unit->Orders[0].Action = UnitActionStill;
Index: stratagus/src/action/action_train.c
diff -u stratagus/src/action/action_train.c:1.62
stratagus/src/action/action_train.c:1.63
--- stratagus/src/action/action_train.c:1.62 Sun Nov 16 01:49:24 2003
+++ stratagus/src/action/action_train.c Tue Nov 18 12:56:19 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: action_train.c,v 1.62 2003/11/16 06:49:24 mr-russ Exp $
+// $Id: action_train.c,v 1.63 2003/11/18 17:56:19 pludov Exp $
//@{
@@ -96,7 +96,7 @@
//
food = PlayerCheckLimits(player, unit->Data.Train.What[0]);
if (food < 0) {
- if (food == -3 && unit->Player->Ai) {
+ if (food == -3 && unit->Player->AiEnabled) {
AiNeedMoreFarms(unit, unit->Orders[0].Type);
}
@@ -130,7 +130,7 @@
if (player == ThisPlayer) {
PlayUnitSound(nunit, VoiceReady);
}
- if (unit->Player->Ai) {
+ if (unit->Player->AiEnabled) {
AiTrainingComplete(unit, nunit);
}
Index: stratagus/src/action/action_upgradeto.c
diff -u stratagus/src/action/action_upgradeto.c:1.40
stratagus/src/action/action_upgradeto.c:1.41
--- stratagus/src/action/action_upgradeto.c:1.40 Mon Nov 10 22:06:53 2003
+++ stratagus/src/action/action_upgradeto.c Tue Nov 18 12:56:19 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: action_upgradeto.c,v 1.40 2003/11/11 03:06:53 n0body Exp $
+// $Id: action_upgradeto.c,v 1.41 2003/11/18 17:56:19 pludov Exp $
//@{
@@ -85,7 +85,7 @@
NotifyPlayer(player, NotifyGreen, unit->X, unit->Y,
"Upgrade to %s complete", unit->Type->Name);
- if (unit->Player->Ai) {
+ if (unit->Player->AiEnabled) {
AiUpgradeToComplete(unit, type);
}
unit->Reset = unit->Wait = 1;
Index: stratagus/src/action/command.c
diff -u stratagus/src/action/command.c:1.119
stratagus/src/action/command.c:1.120
--- stratagus/src/action/command.c:1.119 Sun Nov 16 01:49:24 2003
+++ stratagus/src/action/command.c Tue Nov 18 12:56:19 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: command.c,v 1.119 2003/11/16 06:49:24 mr-russ Exp $
+// $Id: command.c,v 1.120 2003/11/18 17:56:19 pludov Exp $
//@{
@@ -667,7 +667,12 @@
order->Range = unit->Type->RepairRange;
} else {
// If building inside, but be next to stop
- order->Range = 0;
+ if (what->ShoreBuilding && unit->Type->UnitType == UnitTypeLand) {
+ // Peon won't dive :-)
+ order->Range = 1;
+ } else {
+ order->Range = 0;
+ }
}
order->Type = what;
if (what->BuilderOutside) {
Index: stratagus/src/clone/player.c
diff -u stratagus/src/clone/player.c:1.100 stratagus/src/clone/player.c:1.101
--- stratagus/src/clone/player.c:1.100 Mon Nov 17 20:14:52 2003
+++ stratagus/src/clone/player.c Tue Nov 18 12:56:21 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: player.c,v 1.100 2003/11/18 01:14:52 nehalmistry Exp $
+// $Id: player.c,v 1.101 2003/11/18 17:56:21 pludov Exp $
//@{
@@ -220,7 +220,7 @@
int j;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: players $Id: player.c,v 1.100 2003/11/18
01:14:52 nehalmistry Exp $\n\n");
+ CLprintf(file, ";;; MODULE: players $Id: player.c,v 1.101 2003/11/18
17:56:21 pludov Exp $\n\n");
//
// Dump table wc2 race numbers -> internal symbol.
@@ -643,7 +643,7 @@
return 1;
} else {
NotifyPlayer(player, NotifyYellow, 0, 0, "Cannot create more units.");
- if (player->Ai) {
+ if (player->AiEnabled) {
// AiNoMoreUnits(player, type);
}
return -5;
@@ -670,7 +670,7 @@
NotifyPlayer(player, NotifyYellow, 0, 0, "Not enough %s...%s more
%s.",
DefaultResourceNames[i], DefaultActions[i],
DefaultResourceNames[i]);
- if (player->Ai) {
+ if (player->AiEnabled) {
DebugLevel3("Ai: Not enough %s...%s more %s." _C_
DefaultResourceNames[i] _C_ DefaultActions[i] _C_
DefaultResourceNames[i]);
}
Index: stratagus/src/clone/spells.c
diff -u stratagus/src/clone/spells.c:1.128 stratagus/src/clone/spells.c:1.129
--- stratagus/src/clone/spells.c:1.128 Fri Nov 14 23:38:51 2003
+++ stratagus/src/clone/spells.c Tue Nov 18 12:56:22 2003
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: spells.c,v 1.128 2003/11/15 04:38:51 mr-russ Exp $
+// $Id: spells.c,v 1.129 2003/11/18 17:56:22 pludov Exp $
/*
** And when we cast our final spell
@@ -878,7 +878,7 @@
//
// Ai cast should be a lot better. Use autocast if not found.
//
- if (caster->Player->Ai && spell->AICast) {
+ if (caster->Player->AiEnabled && spell->AICast) {
DebugLevel3Fn("The borg uses AI autocast XP.\n");
autocast = spell->AICast;
} else {
Index: stratagus/src/clone/unit.c
diff -u stratagus/src/clone/unit.c:1.338 stratagus/src/clone/unit.c:1.339
--- stratagus/src/clone/unit.c:1.338 Sun Nov 16 01:49:26 2003
+++ stratagus/src/clone/unit.c Tue Nov 18 12:56:22 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit.c,v 1.338 2003/11/16 06:49:26 mr-russ Exp $
+// $Id: unit.c,v 1.339 2003/11/18 17:56:22 pludov Exp $
//@{
@@ -740,7 +740,7 @@
//
// Call back to AI, for killed or lost units.
//
- if (player && player->Ai) {
+ if (player && player->AiEnabled) {
AiUnitKilled(unit);
}
@@ -3851,7 +3851,7 @@
int RunStart;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: units $Id: unit.c,v 1.338 2003/11/16 06:49:26
mr-russ Exp $\n\n");
+ CLprintf(file, ";;; MODULE: units $Id: unit.c,v 1.339 2003/11/18 17:56:22
pludov Exp $\n\n");
//
// Local variables
Index: stratagus/src/clone/unit_draw.c
diff -u stratagus/src/clone/unit_draw.c:1.184
stratagus/src/clone/unit_draw.c:1.185
--- stratagus/src/clone/unit_draw.c:1.184 Mon Nov 17 20:14:53 2003
+++ stratagus/src/clone/unit_draw.c Tue Nov 18 12:56:23 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit_draw.c,v 1.184 2003/11/18 01:14:53 nehalmistry Exp $
+// $Id: unit_draw.c,v 1.185 2003/11/18 17:56:23 pludov Exp $
//@{
@@ -947,7 +947,7 @@
global void SaveDecorations(CLFile* file)
{
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: decorations $Id: unit_draw.c,v 1.184
2003/11/18 01:14:53 nehalmistry Exp $\n\n");
+ CLprintf(file, ";;; MODULE: decorations $Id: unit_draw.c,v 1.185
2003/11/18 17:56:23 pludov Exp $\n\n");
CLprintf(file, "(mana-sprite \"%s\" %d %d %d %d)\n",
ManaSprite.File, ManaSprite.HotX, ManaSprite.HotY,
@@ -2172,8 +2172,10 @@
//
// This should be obviousely false.
//
- DebugCheck(unit->VisCount[ThisPlayer->Player] >
+/* DebugCheck(unit->VisCount[ThisPlayer->Player] >
unit->Type->TileWidth * unit->Type->TileHeight);
+*/
+
//
// If we are in replay reveal map or the unit is visible(not under fog).
//