src/Player.hh
changeset 236 0048ba274152
parent 235 0a0c729365ee
child 237 3d5465bcb67d
--- a/src/Player.hh	Sat Dec 06 23:29:06 2008 +0000
+++ b/src/Player.hh	Sat Dec 06 23:47:13 2008 +0000
@@ -21,7 +21,7 @@
 
     protected:
         bool visible;
-        std::vector<Weapon> weapons;
+        std::vector<Weapon*> weapons;
         unsigned int selectedWeapon; //unsigned for x%sW not to fail
         bool changing;
 
@@ -31,15 +31,15 @@
         // default constructor for use with virtual inheritance... it's not defined
         Player (void);
         Player (GameState &state, Vector position, bool visible); 
-        
+
         // used by the network code to execute actions for players
         virtual void handleDig (Vector position, float radius);
-        virtual void handleCreateProjectile (Weapon &weapon, Vector position, Vector velocity);
+        virtual void handleCreateProjectile (Weapon *weapon, Vector position, Vector velocity);
         
         /*
          * The currently selected weapon
          */
-        Weapon& getWeapon();
+        Weapon* getCurrentWeapon();
 
     public:
         /*
@@ -62,7 +62,10 @@
 
 class LocalPlayer : public virtual Player {
     private:
-        void fireWeapon (Weapon &weapon);
+        /*
+         * Calculates projectil position/velocity and calls handleCreateProjectile
+         */
+        void fireWeapon (Weapon *weapon);
 
     public:
         /*