[Orxonox-commit 6534] r11175 - in code/branches/sagerjFS16: data/defaultConfig src/modules/invader src/modules/jump src/modules/objects/controllers src/modules/towerdefense src/modules/weapons/projectiles src/modules/weapons/weaponmodes src/orxonox/controllers src/orxonox/weaponsystem src/orxonox/worldentities src/orxonox/worldentities/pawns

sagerj at orxonox.net sagerj at orxonox.net
Thu Apr 28 15:09:27 CEST 2016


Author: sagerj
Date: 2016-04-28 15:09:26 +0200 (Thu, 28 Apr 2016)
New Revision: 11175

Modified:
   code/branches/sagerjFS16/data/defaultConfig/keybindings.ini
   code/branches/sagerjFS16/src/modules/invader/InvaderEnemyShooter.cc
   code/branches/sagerjFS16/src/modules/invader/InvaderShip.cc
   code/branches/sagerjFS16/src/modules/jump/JumpFigure.cc
   code/branches/sagerjFS16/src/modules/jump/JumpFigure.h
   code/branches/sagerjFS16/src/modules/objects/controllers/TurretController.cc
   code/branches/sagerjFS16/src/modules/towerdefense/TowerDefenseSelecter.cc
   code/branches/sagerjFS16/src/modules/towerdefense/TowerDefenseSelecter.h
   code/branches/sagerjFS16/src/modules/weapons/projectiles/Rocket.cc
   code/branches/sagerjFS16/src/modules/weapons/projectiles/Rocket.h
   code/branches/sagerjFS16/src/modules/weapons/projectiles/RocketOld.cc
   code/branches/sagerjFS16/src/modules/weapons/projectiles/RocketOld.h
   code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.cc
   code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.h
   code/branches/sagerjFS16/src/orxonox/controllers/AIController.cc
   code/branches/sagerjFS16/src/orxonox/controllers/ArtificialController.cc
   code/branches/sagerjFS16/src/orxonox/controllers/ArtificialController.h
   code/branches/sagerjFS16/src/orxonox/controllers/DroneController.cc
   code/branches/sagerjFS16/src/orxonox/controllers/FightingController.cc
   code/branches/sagerjFS16/src/orxonox/controllers/WaypointPatrolController.cc
   code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.cc
   code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.h
   code/branches/sagerjFS16/src/orxonox/worldentities/ControllableEntity.cc
   code/branches/sagerjFS16/src/orxonox/worldentities/pawns/Spectator.cc
   code/branches/sagerjFS16/src/orxonox/worldentities/pawns/Spectator.h
Log:
overwritten many fire functions now only need to implement timer/charges

Modified: code/branches/sagerjFS16/data/defaultConfig/keybindings.ini
===================================================================
--- code/branches/sagerjFS16/data/defaultConfig/keybindings.ini	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/data/defaultConfig/keybindings.ini	2016-04-28 13:09:26 UTC (rev 11175)
@@ -121,7 +121,7 @@
 KeySpace="boost"
 KeyStop=
 KeySystemRequest="printScreen"
-KeyT= onpress fire 3 | onrelease release 3
+KeyT= onpress push 3 | onrelease release 3
 KeyTab="NewHumanController changeMode"
 KeyU=""
 KeyUP="scale 1 moveFrontBack"
@@ -141,7 +141,7 @@
 KeyWebSearch=
 KeyWebStop=
 KeyX="selectClosest"
-KeyY= onpress fire 4 | onrelease release 4
+KeyY= onpress push 4 | onrelease release 4
 KeyYen=
 KeyZ="selectNext"
 
@@ -151,9 +151,9 @@
 Button5=
 Button6=
 Button7=
-Left= fire 0 | release 0
-Middle= fire 2 | release 2
-Right= fire 1 | release 1
+Left= push 0 | release 0
+Middle= push 2 | release 2
+Right= push 1 | release 1
 Wheel1Down="NewHumanController decelerate"
 Wheel1Up="NewHumanController accelerate"
 Wheel2Down=

Modified: code/branches/sagerjFS16/src/modules/invader/InvaderEnemyShooter.cc
===================================================================
--- code/branches/sagerjFS16/src/modules/invader/InvaderEnemyShooter.cc	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/modules/invader/InvaderEnemyShooter.cc	2016-04-28 13:09:26 UTC (rev 11175)
@@ -70,7 +70,7 @@
 
     void InvaderEnemyShooter::shoot()
     {
-        ControllableEntity::fire(0);
+        ControllableEntity::push(0);
     }
 
     void InvaderEnemyShooter::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs)

Modified: code/branches/sagerjFS16/src/modules/invader/InvaderShip.cc
===================================================================
--- code/branches/sagerjFS16/src/modules/invader/InvaderShip.cc	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/modules/invader/InvaderShip.cc	2016-04-28 13:09:26 UTC (rev 11175)
@@ -90,7 +90,7 @@
 
         // shoot!
         if (isFireing)
-            ControllableEntity::fire(0);
+            ControllableEntity::push(0);
 
         // Camera
         Camera* camera = this->getCamera();

Modified: code/branches/sagerjFS16/src/modules/jump/JumpFigure.cc
===================================================================
--- code/branches/sagerjFS16/src/modules/jump/JumpFigure.cc	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/modules/jump/JumpFigure.cc	2016-04-28 13:09:26 UTC (rev 11175)
@@ -397,12 +397,12 @@
 
     }
 
-    void JumpFigure::fire(unsigned int firemode)
+    void JumpFigure::push(unsigned int firemode)
     {
 
     }
 
-    void JumpFigure::fired(unsigned int firemode)
+    void JumpFigure::pushed(unsigned int firemode)
     {
         firePressed_ = true;
     }

Modified: code/branches/sagerjFS16/src/modules/jump/JumpFigure.h
===================================================================
--- code/branches/sagerjFS16/src/modules/jump/JumpFigure.h	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/modules/jump/JumpFigure.h	2016-04-28 13:09:26 UTC (rev 11175)
@@ -46,8 +46,8 @@
             virtual void rotateYaw(const Vector2& value) override;
             virtual void rotatePitch(const Vector2& value) override;
             virtual void rotateRoll(const Vector2& value) override;
-            void fire(unsigned int firemode);
-            virtual void fired(unsigned int firemode) override;
+            void push(unsigned int firemode);
+            virtual void pushed(unsigned int firemode) override;
             virtual void JumpFromPlatform(JumpPlatform* platform);
             virtual void JumpFromSpring(JumpSpring* spring);
             virtual void CollisionWithEnemy(JumpEnemy* enemy);

Modified: code/branches/sagerjFS16/src/modules/objects/controllers/TurretController.cc
===================================================================
--- code/branches/sagerjFS16/src/modules/objects/controllers/TurretController.cc	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/modules/objects/controllers/TurretController.cc	2016-04-28 13:09:26 UTC (rev 11175)
@@ -197,7 +197,7 @@
             if(this->isLookingAtTargetNew(Degree(5).valueRadians()))
             {
 
-                this->getControllableEntity()->fire(0);
+                this->getControllableEntity()->push(0);
             }
         }
     }

Modified: code/branches/sagerjFS16/src/modules/towerdefense/TowerDefenseSelecter.cc
===================================================================
--- code/branches/sagerjFS16/src/modules/towerdefense/TowerDefenseSelecter.cc	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/modules/towerdefense/TowerDefenseSelecter.cc	2016-04-28 13:09:26 UTC (rev 11175)
@@ -145,11 +145,11 @@
     {
     }
 
-    void TowerDefenseSelecter::fire(unsigned int firemode)
+    void TowerDefenseSelecter::push(unsigned int firemode)
     {
     }
 
-    void TowerDefenseSelecter::fired(unsigned int firemode)
+    void TowerDefenseSelecter::pushed(unsigned int firemode)
     {
         
     }

Modified: code/branches/sagerjFS16/src/modules/towerdefense/TowerDefenseSelecter.h
===================================================================
--- code/branches/sagerjFS16/src/modules/towerdefense/TowerDefenseSelecter.h	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/modules/towerdefense/TowerDefenseSelecter.h	2016-04-28 13:09:26 UTC (rev 11175)
@@ -46,8 +46,8 @@
             virtual void rotateYaw(const Vector2& value) override;
             virtual void rotatePitch(const Vector2& value) override;
             virtual void rotateRoll(const Vector2& value) override;
-            void fire(unsigned int firemode);
-            virtual void fired(unsigned int firemode) override;
+            void push(unsigned int firemode);
+            virtual void pushed(unsigned int firemode) override;
             virtual void boost(bool bBoost) override;
             virtual void setSelectedPosition(TDCoordinate* newPos);
             virtual void setSelectedPosition(int x, int y);

Modified: code/branches/sagerjFS16/src/modules/weapons/projectiles/Rocket.cc
===================================================================
--- code/branches/sagerjFS16/src/modules/weapons/projectiles/Rocket.cc	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/modules/weapons/projectiles/Rocket.cc	2016-04-28 13:09:26 UTC (rev 11175)
@@ -217,7 +217,7 @@
     @brief
         Destroys the Rocket upon pressing "fire".
     */
-    void Rocket::fired(unsigned int firemode)
+    void Rocket::pushed(unsigned int firemode)
     {
         this->destroyObject();
     }

Modified: code/branches/sagerjFS16/src/modules/weapons/projectiles/Rocket.h
===================================================================
--- code/branches/sagerjFS16/src/modules/weapons/projectiles/Rocket.h	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/modules/weapons/projectiles/Rocket.h	2016-04-28 13:09:26 UTC (rev 11175)
@@ -115,7 +115,7 @@
 
             virtual void setShooter(Pawn* shooter) override;
 
-            virtual void fired(unsigned int firemode) override;
+            virtual void pushed(unsigned int firemode) override;
 
             /**
             @brief Set the maximum lifetime of the rocket.

Modified: code/branches/sagerjFS16/src/modules/weapons/projectiles/RocketOld.cc
===================================================================
--- code/branches/sagerjFS16/src/modules/weapons/projectiles/RocketOld.cc	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/modules/weapons/projectiles/RocketOld.cc	2016-04-28 13:09:26 UTC (rev 11175)
@@ -217,7 +217,7 @@
     @brief
         Destroys the RocketOld upon pressing "fire".
     */
-    void RocketOld::fired(unsigned int firemode)
+    void RocketOld::pushed(unsigned int firemode)
     {
         this->destroyObject();
     }

Modified: code/branches/sagerjFS16/src/modules/weapons/projectiles/RocketOld.h
===================================================================
--- code/branches/sagerjFS16/src/modules/weapons/projectiles/RocketOld.h	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/modules/weapons/projectiles/RocketOld.h	2016-04-28 13:09:26 UTC (rev 11175)
@@ -115,7 +115,7 @@
 
             virtual void setShooter(Pawn* shooter) override;
 
-            virtual void fired(unsigned int firemode) override;
+            virtual void pushed(unsigned int firemode) override;
 
         private:
             Vector3 localAngularVelocity_; //!< Variable to temporarily store accumulated steering command input.

Modified: code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.cc
===================================================================
--- code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.cc	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.cc	2016-04-28 13:09:26 UTC (rev 11175)
@@ -53,7 +53,7 @@
         this->reloadTime_ = 0.23f;
         this->damage_ = 90.01f;
         this->speed_ = 90.01f;
-        this->chargeable_ = 0;
+        this->chargeable_ = true;
 
         this->setMunitionName("LaserMunition");
         this->setFireSound("sounds/Weapon_LaserFire.ogg");
@@ -64,18 +64,18 @@
 
     void Discharger::fire()
     {
-        orxout() << "release" << cTime_ << endl;
+        // orxout() << "release" << cTime_ << endl;
         BillboardProjectile* projectile = new BillboardProjectile(this->getContext());
 
         this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
         projectile->setOrientation(this->getMuzzleOrientation());
         projectile->setPosition(this->getMuzzlePosition());
-        projectile->setVelocity(this->getMuzzleDirection() * this->speed_ * charges_);
+        projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
 
         projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
         projectile->setDamage(this->getDamage() * charges_);
-        projectile->setShieldDamage(this->getShieldDamage() * charges_);
-        projectile->setHealthDamage(this->getHealthDamage() * charges_);
-        this->charges_ = 0;
+        projectile->setShieldDamage(this->getShieldDamage());
+        projectile->setHealthDamage(this->getHealthDamage());
+        //  this->charges_ = 0;
     }
 }
\ No newline at end of file

Modified: code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.h
===================================================================
--- code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.h	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.h	2016-04-28 13:09:26 UTC (rev 11175)
@@ -57,10 +57,11 @@
             virtual void fire() override;
 
         private:
-            bool chargeable_;       // An indicator that this weapon type is chargeable.
-            float speed_;           // The speed of the fired projectile.
-            float ctime_;           // time the weapon has charged.
-    };
+            //bool chargeable_;     // An indicator that this weapon type is chargeable.
+            int charges_;
+            float speed_;                  // The speed of the fired projectile.
+            float ctime_;                  // time the weapon has charged.
+    }; 
 }
 
 #endif /* _Discharger_H__ */

Modified: code/branches/sagerjFS16/src/orxonox/controllers/AIController.cc
===================================================================
--- code/branches/sagerjFS16/src/orxonox/controllers/AIController.cc	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/orxonox/controllers/AIController.cc	2016-04-28 13:09:26 UTC (rev 11175)
@@ -196,7 +196,7 @@
 
                     if (this->bHasTargetPosition_)
                         this->moveToTargetPosition();
-                    this->doFire();
+                    this->doPush();
                 }
 
                 if (this->specificMasterAction_  == TURN180)
@@ -226,7 +226,7 @@
                 if (this->bHasTargetPosition_)
                     this->moveToTargetPosition();
 
-                    this->doFire();
+                    this->doPush();
             }
         }
         else if (this->mode_ == ROCKET)//Rockets do not belong to a group of bots -> bot states are not relevant.
@@ -240,7 +240,7 @@
                     this->timeout_ -= dt;
                     if((timeout_< 0)||(!target_))//Check if the timeout is over or target died.
                     {
-                       controllable->fire(0);//kill the rocket
+                       controllable->push(0);//kill the rocket
                        this->setPreviousMode();//get out of rocket mode
                     }
                 }

Modified: code/branches/sagerjFS16/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/branches/sagerjFS16/src/orxonox/controllers/ArtificialController.cc	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/orxonox/controllers/ArtificialController.cc	2016-04-28 13:09:26 UTC (rev 11175)
@@ -131,7 +131,7 @@
     /**
         @brief DoFire is called when a bot should shoot and decides which weapon is used and whether the bot shoots at all.
     */
-    void ArtificialController::doFire()
+    void ArtificialController::doPush()
     {
         if(!this->bSetupWorked)//setup: find out which weapons are active ! hard coded: laser is "0", lens flare is "1", ...
         {
@@ -143,12 +143,12 @@
             float random = rnd(1);//
             if (this->isCloseAtTarget(130) && (firemode = getFiremode("LightningGun")) > -1 )
             {//LENSFLARE: short range weapon
-                this->getControllableEntity()->fire(firemode); //ai uses lens flare if they're close enough to the target
+                this->getControllableEntity()->push(firemode); //ai uses lens flare if they're close enough to the target
             }
             else if( this->isCloseAtTarget(400) && (random < this->botlevel_) && (firemode = getFiremode("RocketFire")) > -1 )
             {//ROCKET: mid range weapon
                 this->mode_ = ROCKET; //Vector-implementation: mode_.push_back(ROCKET);
-                this->getControllableEntity()->fire(firemode); //launch rocket
+                this->getControllableEntity()->push(firemode); //launch rocket
                 if(this->getControllableEntity() && this->target_) //after fire(3) is called, getControllableEntity() refers to the rocket!
                 {
                     float speed = this->getControllableEntity()->getVelocity().length() - target_->getVelocity().length();
@@ -160,7 +160,7 @@
                     this->timeout_ = 4.0f; //TODO: find better default value
             }
             else if ((firemode = getFiremode("HsW01")) > -1 ) //LASER: default weapon
-                this->getControllableEntity()->fire(firemode);
+                this->getControllableEntity()->push(firemode);
         }
     }
 

Modified: code/branches/sagerjFS16/src/orxonox/controllers/ArtificialController.h
===================================================================
--- code/branches/sagerjFS16/src/orxonox/controllers/ArtificialController.h	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/orxonox/controllers/ArtificialController.h	2016-04-28 13:09:26 UTC (rev 11175)
@@ -47,7 +47,7 @@
 
             virtual void changedControllableEntity() override;
 
-            virtual void doFire();
+            virtual void doPush();
             void setBotLevel(float level=1.0f);
             inline float getBotLevel() const
                 { return this->botlevel_; }

Modified: code/branches/sagerjFS16/src/orxonox/controllers/DroneController.cc
===================================================================
--- code/branches/sagerjFS16/src/orxonox/controllers/DroneController.cc	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/orxonox/controllers/DroneController.cc	2016-04-28 13:09:26 UTC (rev 11175)
@@ -129,7 +129,7 @@
                        this->isShooting_ = true;
                        this->aimAtTarget();
                        if(!this->friendlyFire())
-                           this->getDrone()->fire(0);
+                           this->getDrone()->push(0);
                     }
                }
 

Modified: code/branches/sagerjFS16/src/orxonox/controllers/FightingController.cc
===================================================================
--- code/branches/sagerjFS16/src/orxonox/controllers/FightingController.cc	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/orxonox/controllers/FightingController.cc	2016-04-28 13:09:26 UTC (rev 11175)
@@ -317,7 +317,7 @@
             this->rocketsLeft_--;
         }
               
-        this->getControllableEntity()->fire(firemode);
+        this->getControllableEntity()->push(firemode);
         
     }
     void FightingController::setupWeapons() //TODO: Make this function generic!! (at the moment is is based on conventions)

Modified: code/branches/sagerjFS16/src/orxonox/controllers/WaypointPatrolController.cc
===================================================================
--- code/branches/sagerjFS16/src/orxonox/controllers/WaypointPatrolController.cc	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/orxonox/controllers/WaypointPatrolController.cc	2016-04-28 13:09:26 UTC (rev 11175)
@@ -68,7 +68,7 @@
                 this->moveToTargetPosition();
 
             if (this->getControllableEntity() && this->isCloseAtTarget(this->attackradius_) && this->isLookingAtTarget(math::pi / 20.0f))
-                this->getControllableEntity()->fire(0);
+                this->getControllableEntity()->push(0);
         }
         else
         {

Modified: code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.cc
===================================================================
--- code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.cc	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.cc	2016-04-28 13:09:26 UTC (rev 11175)
@@ -62,6 +62,7 @@
         this->bReloading_ = false;
         this->bAutoReload_ = true;
         this->bParallelReload_ = true;
+        this->chargeable_ = false;
 
         this->reloadTimer_.setTimer(0.0f, false, createExecutor(createFunctor(&WeaponMode::reloaded, this)));
         this->reloadTimer_.stopTimer();
@@ -119,6 +120,7 @@
 
     bool WeaponMode::fire(float* reloadTime)
     {
+        orxout() << "--- " << endl;
         (*reloadTime) = this->reloadTime_;
         // Fireing is only possible if this weapon mode is not reloading and there is enough munition
         if (!this->bReloading_ && this->munition_ && this->munition_->takeMunition(this->munitionPerShot_, this))
@@ -169,21 +171,29 @@
 
     bool WeaponMode::push(float* reloadTime)
     {
+        orxout() << "push " << chargeable_ << endl;
         if( this->chargeable_)
         {
             // setting up a timer for knowing how long the weapon was charged 
             // and passes the value to this->cTime_
+            orxout() << "if " << endl;
+            return false;
         } else {
+            orxout() << "else " << endl;
             return fire(reloadTime);
         }
-        
     }
 
     bool WeaponMode::release(float* reloadTime)
     {
+        orxout() << "release " << endl;
         if( this->chargeable_)
-        {
+        { 
+            orxout() << "if " << endl;
             return fire(reloadTime);
+        }else{
+            orxout() << "else " << endl;
+            return false;
         }
     }
 

Modified: code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.h
===================================================================
--- code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.h	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.h	2016-04-28 13:09:26 UTC (rev 11175)
@@ -173,6 +173,7 @@
             float reloadTime_;
             bool bAutoReload_; // If true, the weapon reloads the magazine automatically.
             bool bParallelReload_; // If true, the weapon reloads in parallel to the magazine reloading.
+            bool chargeable_; // If true, the weapon fires at release instead at push(where he charges up)
 
             float damage_;
             float healthdamage_;

Modified: code/branches/sagerjFS16/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/branches/sagerjFS16/src/orxonox/worldentities/ControllableEntity.cc	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/orxonox/worldentities/ControllableEntity.cc	2016-04-28 13:09:26 UTC (rev 11175)
@@ -48,7 +48,7 @@
 {
     RegisterClass(ControllableEntity);
 
-    registerMemberNetworkFunction( ControllableEntity, fire );
+    registerMemberNetworkFunction( ControllableEntity, push );
     registerMemberNetworkFunction( ControllableEntity, setTargetInternal );
 
     ControllableEntity::ControllableEntity(Context* context) : MobileEntity(context)
@@ -306,7 +306,7 @@
         }
         else
         {
-            callMemberNetworkFunction(&ControllableEntity::fire, this->getObjectID(), 0, firemode);
+            callMemberNetworkFunction(&ControllableEntity::push, this->getObjectID(), 0, firemode);
         }
     }
 
@@ -318,7 +318,7 @@
         }
         else
         {
-            callMemberNetworkFunction(&ControllableEntity::fire, this->getObjectID(), 0, firemode);
+            callMemberNetworkFunction(&ControllableEntity::release, this->getObjectID(), 0, firemode);
         }
     }
 

Modified: code/branches/sagerjFS16/src/orxonox/worldentities/pawns/Spectator.cc
===================================================================
--- code/branches/sagerjFS16/src/orxonox/worldentities/pawns/Spectator.cc	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/orxonox/worldentities/pawns/Spectator.cc	2016-04-28 13:09:26 UTC (rev 11175)
@@ -41,7 +41,7 @@
 
 namespace orxonox
 {
-    extern const std::string __CC_fire_name;
+    extern const std::string __CC_push_name;
     extern const std::string __CC_suicide_name;
 
     RegisterClass(Spectator);
@@ -161,7 +161,7 @@
         ControllableEntity::startLocalHumanControl();
 
         // change keybind mode of fire command to OnPress to avoid firing after respawn
-        ModifyConsoleCommand(__CC_fire_name).keybindMode(KeybindMode::OnPress);
+        ModifyConsoleCommand(__CC_push_name).keybindMode(KeybindMode::OnPress);
 
         // disable suicide
         ModifyConsoleCommand(__CC_suicide_name).pushFunction(&prototype::void__void);
@@ -176,7 +176,7 @@
 
         // change fire command to a helper function and change keybind mode to OnPress
         // as soon as the player releases and presses the button again, the helper function will be called which changes the keybind mode back to OnHold
-        ModifyConsoleCommand(__CC_fire_name).pushFunction(&Spectator::resetFireCommand).keybindMode(KeybindMode::OnPress);
+        ModifyConsoleCommand(__CC_push_name).pushFunction(&Spectator::resetFireCommand).keybindMode(KeybindMode::OnPress);
 
         // enable suicide
         ModifyConsoleCommand(__CC_suicide_name).popFunction();
@@ -187,9 +187,9 @@
     */
     void Spectator::resetFireCommand(unsigned int firemode)
     {
-        ModifyConsoleCommand(__CC_fire_name).popFunction().keybindMode(KeybindMode::OnHold); // pop this helper function and change keybind mode
+        ModifyConsoleCommand(__CC_push_name).popFunction().keybindMode(KeybindMode::OnHold); // pop this helper function and change keybind mode
 
-        CommandExecutor::execute(__CC_fire_name + " " + multi_cast<std::string>(firemode)); // call the fire command again, this time with the real function
+        CommandExecutor::execute(__CC_push_name + " " + multi_cast<std::string>(firemode)); // call the fire command again, this time with the real function
     }
 
     void Spectator::moveFrontBack(const Vector2& value)
@@ -228,7 +228,7 @@
         ControllableEntity::rotateRoll(value);
     }
 
-    void Spectator::fired(unsigned int firemode)
+    void Spectator::pushed(unsigned int firemode)
     {
         if (this->getPlayer())
             this->getPlayer()->setReadyToSpawn(true);

Modified: code/branches/sagerjFS16/src/orxonox/worldentities/pawns/Spectator.h
===================================================================
--- code/branches/sagerjFS16/src/orxonox/worldentities/pawns/Spectator.h	2016-04-21 14:47:39 UTC (rev 11174)
+++ code/branches/sagerjFS16/src/orxonox/worldentities/pawns/Spectator.h	2016-04-28 13:09:26 UTC (rev 11175)
@@ -53,7 +53,7 @@
             virtual void rotatePitch(const Vector2& value);
             virtual void rotateRoll(const Vector2& value);
 
-            virtual void fired(unsigned int firemode);
+            virtual void pushed(unsigned int firemode);
             virtual void greet();
             virtual void mouseLook() {}
 




More information about the Orxonox-commit mailing list