[Orxonox-commit 5286] r9949 - in code/trunk/src/orxonox/worldentities: . pawns
landauf at orxonox.net
landauf at orxonox.net
Fri Jan 3 15:14:20 CET 2014
Author: landauf
Date: 2014-01-03 15:14:19 +0100 (Fri, 03 Jan 2014)
New Revision: 9949
Modified:
code/trunk/src/orxonox/worldentities/BigExplosion.cc
code/trunk/src/orxonox/worldentities/BigExplosion.h
code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
Log:
removed duplicate code. there is no need for a second constructor. if at all, use a factory method.
Modified: code/trunk/src/orxonox/worldentities/BigExplosion.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/BigExplosion.cc 2014-01-03 14:09:55 UTC (rev 9948)
+++ code/trunk/src/orxonox/worldentities/BigExplosion.cc 2014-01-03 14:14:19 UTC (rev 9949)
@@ -77,42 +77,6 @@
this->registerVariables();
}
- BigExplosion::BigExplosion(Context* context, Vector3 initVelocity) : MobileEntity(context)
- {
- RegisterObject(BigExplosion);
- this->setVelocity(initVelocity);
-
- if ( GameMode::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) )
- ThrowException(AbortLoading, "Can't create BigExplosion, no scene or no scene manager given.");
-
- this->bStop_ = false;
- this->LOD_ = LODParticle::Normal;
-
- if ( GameMode::showsGraphics() )
- {
- try
- {
- this->init();
- }
- catch (const std::exception& ex)
- {
- orxout(internal_error) << "Couldn't load particle effect in BigExplosion: " << ex.what() << endl;
- this->initZero();
- }
- }
- else
- {
- this->initZero();
- }
-
- if (GameMode::isMaster())
- {
- this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&BigExplosion::stop, this)));
- }
-
- this->registerVariables();
- }
-
void BigExplosion::init()
{
this->debrisEntity1_ = new MovableEntity(this->getContext());
Modified: code/trunk/src/orxonox/worldentities/BigExplosion.h
===================================================================
--- code/trunk/src/orxonox/worldentities/BigExplosion.h 2014-01-03 14:09:55 UTC (rev 9948)
+++ code/trunk/src/orxonox/worldentities/BigExplosion.h 2014-01-03 14:14:19 UTC (rev 9949)
@@ -40,7 +40,6 @@
{
public:
BigExplosion(Context* context);
- BigExplosion(Context* context, Vector3 initVelocity);
virtual ~BigExplosion();
inline void setLOD(LODParticle::Value level)
Modified: code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.cc 2014-01-03 14:09:55 UTC (rev 9948)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.cc 2014-01-03 14:14:19 UTC (rev 9949)
@@ -119,7 +119,6 @@
if (this->weaponSystem_)
this->weaponSystem_->destroy();
}
-
}
void Pawn::XMLPort(Element& xmlelement, XMLPort::Mode mode)
@@ -151,7 +150,6 @@
XMLPortParam ( RadarViewable, "radarname", setRadarName, getRadarName, xmlelement, mode );
}
-
void Pawn::registerVariables()
{
registerVariable(this->bAlive_, VariableDirection::ToClient);
@@ -379,9 +377,9 @@
this->bAlive_ = false;
this->setDestroyWhenPlayerLeft(false);
- BigExplosion* chunk = new BigExplosion(this->getContext(), this->getVelocity());
+ BigExplosion* chunk = new BigExplosion(this->getContext());
chunk->setPosition(this->getPosition());
- // chunk->setVelocity(this->getVelocity());
+ chunk->setVelocity(this->getVelocity());
this->explosionSound_->setPosition(this->getPosition());
this->explosionSound_->play();
More information about the Orxonox-commit
mailing list