[Orxonox-commit 4063] r8734 - in code/branches/ai2/src: modules/weapons/projectiles orxonox/infos
dafrick at orxonox.net
dafrick at orxonox.net
Wed Jul 6 22:50:18 CEST 2011
Author: dafrick
Date: 2011-07-06 22:50:18 +0200 (Wed, 06 Jul 2011)
New Revision: 8734
Modified:
code/branches/ai2/src/modules/weapons/projectiles/SimpleRocket.cc
code/branches/ai2/src/modules/weapons/projectiles/SimpleRocket.h
code/branches/ai2/src/orxonox/infos/PlayerInfo.cc
Log:
Fix for AI and rockets.
Modified: code/branches/ai2/src/modules/weapons/projectiles/SimpleRocket.cc
===================================================================
--- code/branches/ai2/src/modules/weapons/projectiles/SimpleRocket.cc 2011-07-05 21:59:37 UTC (rev 8733)
+++ code/branches/ai2/src/modules/weapons/projectiles/SimpleRocket.cc 2011-07-06 20:50:18 UTC (rev 8734)
@@ -99,8 +99,6 @@
SUPER(SimpleRocket, tick, dt);
if ( GameMode::isMaster() )
{
-
-
this->setAngularVelocity(this->getOrientation() * this->localAngularVelocity_);
this->setVelocity( this->getOrientation()*WorldEntity::FRONT*this->getVelocity().length() );
this->localAngularVelocity_ = 0;
Modified: code/branches/ai2/src/modules/weapons/projectiles/SimpleRocket.h
===================================================================
--- code/branches/ai2/src/modules/weapons/projectiles/SimpleRocket.h 2011-07-05 21:59:37 UTC (rev 8733)
+++ code/branches/ai2/src/modules/weapons/projectiles/SimpleRocket.h 2011-07-06 20:50:18 UTC (rev 8734)
@@ -74,47 +74,45 @@
@param value The amount by which the SimpleRocket is to be moved.
*/
inline void moveFrontBack(float value)
- { this->moveFrontBack(Vector2(value, 0)); }
+ { this->moveFrontBack(Vector2(value, 0)); }
/**
@brief Moves the SimpleRocket in the Right/Left-direction by the specifed amount.
@param value The amount by which the SimpleRocket is to be moved.
*/
inline void moveRightLeft(float value)
- { this->moveRightLeft(Vector2(value, 0)); }
+ { this->moveRightLeft(Vector2(value, 0)); }
/**
@brief Moves the SimpleRocket in the Up/Down-direction by the specifed amount.
@param value The amount by which the SimpleRocket is to be moved.
*/
inline void moveUpDown(float value)
- { this->moveUpDown(Vector2(value, 0)); }
+ { this->moveUpDown(Vector2(value, 0)); }
/**
@brief Rotates the SimpleRocket around the y-axis by the specifed amount.
@param value The amount by which the SimpleRocket is to be rotated.
*/
inline void rotateYaw(float value)
- { this->rotateYaw(Vector2(value, 0)); }
+ { this->rotateYaw(Vector2(value, 0)); }
/**
@brief Rotates the SimpleRocket around the x-axis by the specifed amount.
@param value The amount by which the SimpleRocket is to be rotated.
*/
inline void rotatePitch(float value)
- {
- this->rotatePitch(Vector2(value, 0)); }
+ { this->rotatePitch(Vector2(value, 0)); }
/**
@brief Rotates the SimpleRocket around the z-axis by the specifed amount.
@param value The amount by which the SimpleRocket is to be rotated.
*/
inline void rotateRoll(float value)
- {
- this->rotateRoll(Vector2(value, 0)); }
+ { this->rotateRoll(Vector2(value, 0)); }
void setOwner(Pawn* owner);
inline Pawn* getOwner() const
{ return this->owner_; }
inline bool hasFuel() const
- { return this->fuel_; }
+ { return this->fuel_; }
private:
Modified: code/branches/ai2/src/orxonox/infos/PlayerInfo.cc
===================================================================
--- code/branches/ai2/src/orxonox/infos/PlayerInfo.cc 2011-07-05 21:59:37 UTC (rev 8733)
+++ code/branches/ai2/src/orxonox/infos/PlayerInfo.cc 2011-07-06 20:50:18 UTC (rev 8734)
@@ -234,7 +234,8 @@
return;
this->controllableEntity_->setController(0);
- this->controllableEntity_->destroyHud(); // HACK-ish
+ if(this->isHumanPlayer()) // TODO: Multiplayer?
+ this->controllableEntity_->destroyHud(); // HACK-ish
// this->controllableEntity_ = this->previousControllableEntity_.back();
do {
@@ -247,7 +248,7 @@
this->controller_->setControllableEntity(this->controllableEntity_);
// HACK-ish
- if(this->controllableEntity_ != NULL)
+ if(this->controllableEntity_ != NULL && this->isHumanPlayer())
this->controllableEntity_->createHud();
if ( GameMode::isMaster() )
More information about the Orxonox-commit
mailing list