[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src ai/ccl_ai.c ui/mouse.c
From: |
ludovic pollet |
Subject: |
[Stratagus-CVS] stratagus/src ai/ccl_ai.c ui/mouse.c |
Date: |
Tue, 25 Nov 2003 06:46:03 -0500 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: ludovic pollet <address@hidden> 03/11/25 06:46:03
Modified files:
src/ai : ccl_ai.c
src/ui : mouse.c
Log message:
fixes for AI attacks with transporter
Patches:
Index: stratagus/src/ai/ccl_ai.c
diff -u stratagus/src/ai/ccl_ai.c:1.84 stratagus/src/ai/ccl_ai.c:1.85
--- stratagus/src/ai/ccl_ai.c:1.84 Thu Nov 20 15:00:23 2003
+++ stratagus/src/ai/ccl_ai.c Tue Nov 25 06:46:02 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_ai.c,v 1.84 2003/11/20 20:00:23 jsalmon3 Exp $
+// $Id: ccl_ai.c,v 1.85 2003/11/25 11:46:02 pludov Exp $
//@{
@@ -1215,17 +1215,21 @@
local SCM CclAiForceActive(SCM list)
{
int force;
+ AiUnit* unit;
force = gh_scm2int(list);
if (force < 0 || force >= AI_MAX_FORCES) {
errl("Force out of range", list);
}
- if (AiPlayer->Force[force].Attacking) {
- return SCM_BOOL_T;
- } else {
- return SCM_BOOL_F;
+ unit = AiPlayer->Force[force].Units;
+ while (unit) {
+ if (!UnitIdle(unit->Unit)) {
+ return SCM_BOOL_T;
+ }
+ unit = unit->Next;
}
+ return SCM_BOOL_F;
}
/**
@@ -1757,16 +1761,9 @@
*/
local SCM CclAiScript(SCM value)
{
- int i;
CclGcProtectedAssign(&AiPlayer->Scripts[0].Script, value);
AiPlayer->Scripts[0].SleepCycles = 0;
snprintf(AiPlayer->Scripts[0].ident, 10, "MainScript");
- for (i = 1; i < AI_MAX_RUNNING_SCRIPTS; i++) {
- CclGcProtectedAssign(&AiPlayer->Scripts[i].Script, NIL);
- AiPlayer->Scripts[i].SleepCycles = 0;
- AiEraseForce(AiPlayer->Scripts[i].ownForce);
- snprintf(AiPlayer->Scripts[i].ident, 10, "Empty");
- }
return SCM_BOOL_T;
}
Index: stratagus/src/ui/mouse.c
diff -u stratagus/src/ui/mouse.c:1.164 stratagus/src/ui/mouse.c:1.165
--- stratagus/src/ui/mouse.c:1.164 Thu Nov 20 15:35:47 2003
+++ stratagus/src/ui/mouse.c Tue Nov 25 06:46:03 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: mouse.c,v 1.164 2003/11/20 20:35:47 n0body Exp $
+// $Id: mouse.c,v 1.165 2003/11/25 11:46:03 pludov Exp $
//@{
@@ -138,7 +138,8 @@
dest = UnitUnderCursor;
- if (dest && dest->Type->Transporter) {
+ // don't allow stopping enemy transporters!
+ if (dest && dest->Type->Transporter && dest->Player == ThisPlayer) {
// n0b0dy: So we are clicking on a transporter. We have to:
// 1) Flush the transporters orders.
// 2) Tell the transporter to follow the units. We have to queue all
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus/src ai/ccl_ai.c ui/mouse.c,
ludovic pollet <=