pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src pingu.cxx,1.16,1.17 pingu.hxx,1.8,1.9


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src pingu.cxx,1.16,1.17 pingu.hxx,1.8,1.9 pingu_action.hxx,1.7,1.8
Date: 28 Jun 2002 18:11:12 -0000

Update of /usr/local/cvsroot/Games/Pingus/src
In directory dark:/tmp/cvs-serv13003

Modified Files:
        pingu.cxx pingu.hxx pingu_action.hxx 
Log Message:
fixed a few newly introduced action bugs and some cleanup

Index: pingu.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu.cxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- pingu.cxx   28 Jun 2002 15:12:22 -0000      1.16
+++ pingu.cxx   28 Jun 2002 18:11:10 -0000      1.17
@@ -129,27 +129,33 @@
         {
           pout(PINGUS_DEBUG_ACTIONS) << "Pingu: Already have action" << 
std::endl;
           return false;
-        }
-                    
-        if (action->change_allowed(act->get_type()))
-          {
-            act->set_pingu(this);
-            set_action(act);
-            return true;
-          }
-                    
-      return false;
+        } 
+      else if (action->change_allowed(act->get_type()))
+       {
+         pout(PINGUS_DEBUG_ACTIONS) << "setting instant action" << std::endl;
+         act->set_pingu(this);
+         set_action(act);
+         return true;
+       }
+      else
+       {
+         pout(PINGUS_DEBUG_ACTIONS) << "change from action " << 
action->get_name () << " not allowed" << std::endl;
+         return false;
+       }
                   
     case WALL_TRIGGERED:
-    
+      
       if (wall_action && wall_action->get_type() == act->get_type())
         {
           pout(PINGUS_DEBUG_ACTIONS) << "Not using wall action, we have 
already" << std::endl;
           return false;
         }
-
-      wall_action = act;
-      return true;
+      else
+       {
+         pout(PINGUS_DEBUG_ACTIONS) << "Setting wall action" << std::endl;
+         wall_action = act;
+         return true;
+       }
       
     case FALL_TRIGGERED:
     
@@ -158,9 +164,12 @@
           pout(PINGUS_DEBUG_ACTIONS) << "Not using fall action, we have 
already" << std::endl;
           return false;
         }
-      
-      fall_action = act;
-      return true;
+      else
+       {
+         pout(PINGUS_DEBUG_ACTIONS) << "Setting fall action" << std::endl;
+         fall_action = act;
+         return true;
+       }
 
     case COUNTDOWN_TRIGGERED:
     
@@ -170,13 +179,14 @@
           return false;
         }
         
+      pout(PINGUS_DEBUG_ACTIONS) << "Setting countdown action" << std::endl;
       // We set the action and start the countdown
       action_time = act->activation_time();
       countdown_action = act;
       return true;
       
    default:
-     
+      pout(PINGUS_DEBUG_ACTIONS) << "unknown action activation_mode" << 
std::endl;     
      assert(0);
      return false;
   }
@@ -204,7 +214,7 @@
 }
 
 bool
-Pingu::set_fall_action ()
+Pingu::request_fall_action ()
 {
   if (fall_action)
     {
@@ -216,7 +226,7 @@
 }
 
 bool
-Pingu::set_wall_action ()
+Pingu::request_wall_action ()
 {
   if (wall_action)
     {

Index: pingu.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu.hxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- pingu.hxx   28 Jun 2002 15:12:22 -0000      1.8
+++ pingu.hxx   28 Jun 2002 18:11:10 -0000      1.9
@@ -150,10 +150,10 @@
   void set_action (ActionName action_name);
   
   /// set the wall action if we have one
-  bool set_wall_action ();
+  bool request_wall_action ();
   
   /// set the fall action if we have one
-  bool set_fall_action ();
+  bool request_fall_action ();
 
   PinguAction* get_wall_action() { return wall_action; }
   

Index: pingu_action.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu_action.hxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- pingu_action.hxx    28 Jun 2002 17:48:42 -0000      1.7
+++ pingu_action.hxx    28 Jun 2002 18:11:10 -0000      1.8
@@ -30,10 +30,10 @@
 
 enum ActionType
 {
-  INSTANT             = 1<<1,
-  WALL_TRIGGERED      = 1<<2,
-  FALL_TRIGGERED      = 1<<3,
-  COUNTDOWN_TRIGGERED = 1<<4
+  INSTANT,
+  WALL_TRIGGERED,
+  FALL_TRIGGERED,
+  COUNTDOWN_TRIGGERED
 };
 
 // This class provides an abstract interface for pingu actions. It is 




reply via email to

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