stratagus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Stratagus-CVS] stratagus/src/action actions.c


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src/action actions.c
Date: 31 Jan 2004 04:03:22 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       04/01/31 04:03:22

Modified files:
        src/action     : actions.c 

Log message:
        Fixed bug if destroyed unit is at the end of the table

Patches:
Index: stratagus/src/action/actions.c
diff -u stratagus/src/action/actions.c:1.120 
stratagus/src/action/actions.c:1.121
--- stratagus/src/action/actions.c:1.120        Sat Jan 31 01:02:46 2004
+++ stratagus/src/action/actions.c      Sat Jan 31 04:03:21 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: actions.c,v 1.120 2004/01/30 14:02:46 nobody_ Exp $
+//      $Id: actions.c,v 1.121 2004/01/30 17:03:21 jsalmon3 Exp $
 
 //@{
 
@@ -509,8 +509,9 @@
        // 1) Blink flag.
        if (blinkthiscycle) {
                for (i = 0; i < tabsize; ++i) {
-                       while(table[i]->Destroyed) {
-                               table[i] = table[--tabsize];
+                       if (table[i]->Destroyed) {
+                               table[i--] = table[--tabsize];
+                               continue;
                        }
                        if (table[i]->Blink) {
                                --table[i]->Blink;
@@ -521,8 +522,9 @@
        // 2) Buffs...
        if (buffsthiscycle) {
                for (i = 0; i < tabsize; ++i) {
-                       while(table[i]->Destroyed) {
-                               table[i] = table[--tabsize];
+                       if (table[i]->Destroyed) {
+                               table[i--] = table[--tabsize];
+                               continue;
                        }
                        HandleBuffs(table[i], CYCLES_PER_SECOND);
                }
@@ -531,8 +533,9 @@
        // 3) Increase health mana, burn and stuff
        if (regenthiscycle) {
                for (i = 0; i < tabsize; ++i) {
-                       while(table[i]->Destroyed) {
-                               table[i] = table[--tabsize];
+                       if (table[i]->Destroyed) {
+                               table[i--] = table[--tabsize];
+                               continue;
                        }
                        HandleRegenerations(table[i]);
                }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]