Changeset 8727 for code/trunk/src/orxonox/gametypes
- Timestamp:
- Jul 3, 2011, 5:42:19 PM (13 years ago)
- Location:
- code/trunk/src/orxonox/gametypes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/gametypes/Dynamicmatch.cc
r8706 r8727 151 151 //Give new pig boost 152 152 SpaceShip* spaceship = dynamic_cast<SpaceShip*>(victim); 153 grantPigBoost(spaceship);153 this->grantPigBoost(spaceship); 154 154 } 155 155 … … 245 245 //Give new pig boost 246 246 SpaceShip* spaceship = dynamic_cast<SpaceShip*>(victim); 247 grantPigBoost(spaceship);247 this->grantPigBoost(spaceship); 248 248 } 249 249 // killer vs piggy … … 306 306 } 307 307 308 void Dynamicmatch::grantPigBoost(orxonox::SpaceShip* spaceship) 308 /** 309 @brief 310 Grant the piggy a boost. 311 @param spaceship 312 The SpaceShip to give the boost. 313 */ 314 void Dynamicmatch::grantPigBoost(SpaceShip* spaceship) 309 315 { 310 316 // Give pig boost 311 317 if (spaceship) 312 318 { 313 spaceship-> setSpeedFactor(5);319 spaceship->addSpeedFactor(5); 314 320 WeakPtr<SpaceShip>* ptr = new WeakPtr<SpaceShip>(spaceship); 315 321 ExecutorPtr executor = createExecutor(createFunctor(&Dynamicmatch::resetSpeedFactor, this)); … … 599 605 if (*ptr) 600 606 { 601 (*ptr)-> setSpeedFactor(1.0f);607 (*ptr)->addSpeedFactor(1.0f/5.0f); 602 608 } 603 609 delete ptr; -
code/trunk/src/orxonox/gametypes/Dynamicmatch.h
r8706 r8727 30 30 #define _Dynamicmatch_H__ 31 31 32 #include "OrxonoxPrereqs.h" 33 32 34 #include <map> 33 35 #include <vector> 34 #include "OrxonoxPrereqs.h" 36 37 #include "tools/Timer.h" 38 35 39 #include "Gametype.h" 36 #include "tools/Timer.h"37 40 38 41 namespace orxonox … … 73 76 virtual void furtherInstructions();*/ 74 77 virtual void rewardPig(); 75 void grantPigBoost(SpaceShip* spaceship); // Added this, since it's used twice on different occasions.78 void grantPigBoost(SpaceShip* spaceship); // Grant the piggy a boost. 76 79 void resetSpeedFactor(WeakPtr<SpaceShip>* ptr); 77 80 void tick (float dt);// used to end the game
Note: See TracChangeset
for help on using the changeset viewer.