[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src/ai new_ai.c
From: |
ludovic pollet |
Subject: |
[Stratagus-CVS] stratagus/src/ai new_ai.c |
Date: |
Thu, 20 Nov 2003 06:12:45 -0500 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: ludovic pollet <address@hidden> 03/11/20 06:12:45
Modified files:
src/ai : new_ai.c
Log message:
correct fix for Transporter Zone Crash [bug #6677]
Patches:
Index: stratagus/src/ai/new_ai.c
diff -u stratagus/src/ai/new_ai.c:1.92 stratagus/src/ai/new_ai.c:1.93
--- stratagus/src/ai/new_ai.c:1.92 Thu Nov 20 04:53:50 2003
+++ stratagus/src/ai/new_ai.c Thu Nov 20 06:12:44 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: new_ai.c,v 1.92 2003/11/20 09:53:50 pludov Exp $
+// $Id: new_ai.c,v 1.93 2003/11/20 11:12:44 pludov Exp $
//@{
@@ -784,7 +784,7 @@
{
CLprintf(file, "\n;;; -----------------------------------------\n");
CLprintf(file,
- ";;; MODULE: AI $Id: new_ai.c,v 1.92 2003/11/20 09:53:50 pludov Exp
$\n\n");
+ ";;; MODULE: AI $Id: new_ai.c,v 1.93 2003/11/20 11:12:44 pludov Exp
$\n\n");
SaveAiTypesWcName(file);
SaveAiHelper(file);
@@ -1522,7 +1522,6 @@
unit->OrderCount + (unit->OrderFlush?1:0) >= 2 &&
unit->OrderCount < MAX_ORDERS - 1 &&
unit->Orders[unit->OrderFlush ? 1 : 0].Action == UnitActionFollow &&
- unit->Orders[unit->OrderFlush ? 1 : 0].Goal &&
unit->Orders[unit->OrderCount - 1].Action == UnitActionUnload &&
unit->InsideCount + unit->OrderCount - (unit->OrderFlush ? 1 : 0)
<= unit->Type->MaxOnBoard) {
@@ -1534,8 +1533,13 @@
unitok = ZoneSetHasIntersect(&TransporterZones, destzones);
if (unitok) {
- unitX = unit->Orders[unit->OrderFlush ? 1 : 0].Goal->X;
- unitY = unit->Orders[unit->OrderFlush ? 1 : 0].Goal->Y;
+ if (unit->Orders[unit->OrderFlush ? 1 : 0].Goal) {
+ unitX = unit->Orders[unit->OrderFlush ? 1 : 0].Goal->X;
+ unitY = unit->Orders[unit->OrderFlush ? 1 : 0].Goal->Y;
+ } else {
+ unitX = unit->Orders[unit->OrderFlush ? 1 : 0].X;
+ unitY = unit->Orders[unit->OrderFlush ? 1 : 0].Y;
+ }
}
}