Index: code/branches/presentation2/src/modules/weapons/projectiles/CMakeLists.txt
===================================================================
--- code/branches/presentation2/src/modules/weapons/projectiles/CMakeLists.txt	(revision 6106)
+++ code/branches/presentation2/src/modules/weapons/projectiles/CMakeLists.txt	(revision 6107)
@@ -4,3 +4,4 @@
   Projectile.cc
   LightningGunProjectile.cc
+  Rocket.cc
 )
Index: code/branches/presentation2/src/modules/weapons/projectiles/Rocket.cc
===================================================================
--- code/branches/presentation2/src/modules/weapons/projectiles/Rocket.cc	(revision 6107)
+++ code/branches/presentation2/src/modules/weapons/projectiles/Rocket.cc	(revision 6107)
@@ -0,0 +1,256 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Oliver Scheuss
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "Rocket.h"
+
+#include "core/XMLPort.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include "worldentities/pawns/Pawn.h"
+#include "graphics/ParticleSpawner.h"
+#include "graphics/Model.h"
+#include "objects/collisionshapes/ConeCollisionShape.h"
+#include "infos/PlayerInfo.h"
+#include "controllers/Controller.h"
+#include "worldentities/CameraPosition.h"
+
+namespace orxonox
+{
+	CreateFactory(Rocket);    
+    // create the factory for the Rocket
+
+    /**
+    @brief
+        Constructor. Registers the object and initializes some default values.
+    */
+    Rocket::Rocket(BaseObject* creator) : ControllableEntity(creator)
+    {
+        RegisterObject(Rocket);// - register the Rocket class to the core
+
+		this->localAngularVelocity_ = 0;
+        
+        if (GameMode::isMaster())
+        {
+            this->setCollisionType(WorldEntity::Kinematic);
+            this->setVelocity(0,0,-100);
+            this->lifetime_ = 100;
+            this->bDestroy_ = false;
+        
+            this->model_ = new Model(this);
+            this->model_->setMeshSource("rocket.mesh");
+			this->attach(this->model_);
+			ParticleSpawner* fire = new ParticleSpawner(this);
+			this->attach(fire);
+			fire->setOrientation(this->getOrientation());
+            fire->setSource("Orxonox/rocketfire");
+        
+            this->enableCollisionCallback();
+            this->setCollisionResponse(false);
+            this->setCollisionType(Kinematic);
+
+            this->collisionShape_ = new ConeCollisionShape(this);
+            this->collisionShape_->setRadius(3);
+            this->collisionShape_->setHeight(500);
+            this->attachCollisionShape(this->collisionShape_);
+
+            this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&Rocket::destroyObject, this)));
+               
+			
+        }
+        
+        this->camPosition_ = new CameraPosition(this);
+        this->camPosition_->setPosition(0,10,40);
+        this->camPosition_->setSyncMode(0x0);
+        this->attach( this->camPosition_ );
+        this->addCameraPosition( this->camPosition_ );
+    }
+
+    /**
+    @brief
+        Destructor. Destroys controller, if present.
+    */
+    Rocket::~Rocket()
+    {
+        if(this->isInitialized())
+        {
+            
+            if (GameMode::isMaster() && this->player_.get())
+            {
+                this->model_->destroy();
+                this->collisionShape_->destroy();
+                this->player_->stopTemporaryControl();
+            }
+            this->camPosition_->destroy();
+        }
+    }
+
+    /**
+    @brief
+        Method for creating a Rocket through XML.
+    */
+    void Rocket::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        // this calls the XMLPort function of the parent class
+        SUPER(Rocket, XMLPort, xmlelement, mode);
+    }
+    
+    void Rocket::setOwner(Pawn* owner)
+    {
+        this->owner_ = owner;
+        this->originalControllableEntity_ = this->owner_->getPlayer()->getControllableEntity();
+        this->player_ = this->owner_->getPlayer();
+        this->owner_->getPlayer()->startTemporaryControl(this);
+    }
+
+    /**
+    @brief
+        Defines which actions the Rocket has to take in each tick.
+    @param dt
+        The length of the tick.
+    */
+    void Rocket::tick(float dt)
+    {
+        SUPER(Rocket, tick, dt);
+        
+        if( this->hasLocalController() )
+        {
+            this->setAngularVelocity(this->getOrientation() * this->localAngularVelocity_);
+            this->setVelocity( this->getOrientation()*WorldEntity::FRONT*this->getVelocity().length() );
+            this->localAngularVelocity_ = 0;
+            
+            if( this->bDestroy_ )
+                this->destroy();
+        }
+    }
+    
+    bool Rocket::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
+    {
+        if (!this->bDestroy_ && GameMode::isMaster())
+        {
+            if (otherObject == this->owner_)
+                return false;
+            
+            this->bDestroy_ = true;
+
+            if (this->owner_)
+            {
+                {
+                    ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
+                    effect->setPosition(this->getPosition());
+                    effect->setOrientation(this->getOrientation());
+                    effect->setDestroyAfterLife(true);
+                    effect->setSource("Orxonox/explosion4");
+                    effect->setLifetime(2.0f);
+                }
+
+                {
+                    ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
+                    effect->setPosition(this->getPosition());
+                    effect->setOrientation(this->getOrientation());
+                    effect->setDestroyAfterLife(true);
+                    effect->setSource("Orxonox/smoke4");
+                    effect->setLifetime(3.0f);
+                }
+            }
+
+            float dmg = this->damage_;
+            if (this->owner_)
+                dmg = this->owner_->getPickups().processModifiers(ModifierType::Damage, dmg, false);
+
+            Pawn* victim = orxonox_cast<Pawn*>(otherObject);
+            if (victim)
+                victim->damage(dmg, this->owner_);
+//             this->destroy();
+        }
+        return false;
+    }
+    
+    void Rocket::destroyObject()
+    {
+        if (GameMode::isMaster())
+            this->destroy();
+    }
+    
+    void Rocket::fired(unsigned int firemode)
+    {
+        if (this->owner_)
+        {
+            {
+                ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
+                effect->setPosition(this->getPosition());
+                effect->setOrientation(this->getOrientation());
+                effect->setDestroyAfterLife(true);
+                effect->setSource("Orxonox/explosion4");
+                effect->setLifetime(2.0f);
+            }
+
+            {
+                ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
+                effect->setPosition(this->getPosition());
+                effect->setOrientation(this->getOrientation());
+                effect->setDestroyAfterLife(true);
+                effect->setSource("Orxonox/smoke4");
+                effect->setLifetime(3.0f);
+            }
+            this->destroy();
+        }
+    }
+
+    /**
+    @brief
+        Rotates the Rocket around the y-axis by the amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the angular movement.
+    */
+    void Rocket::rotateYaw(const Vector2& value)
+    {
+        this->localAngularVelocity_.y += value.x;
+    }
+
+    /**
+    @brief
+        Rotates the Rocket around the x-axis by the amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the angular movement.
+    */
+    void Rocket::rotatePitch(const Vector2& value)
+    {
+        this->localAngularVelocity_.x += value.x;
+    }
+
+    /**
+    @brief
+        Rotates the Rocket around the z-axis by the amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the angular movement.
+    */
+    void Rocket::rotateRoll(const Vector2& value)
+    {
+        this->localAngularVelocity_.z += value.x;
+    }
+    
+}
Index: code/branches/presentation2/src/modules/weapons/projectiles/Rocket.h
===================================================================
--- code/branches/presentation2/src/modules/weapons/projectiles/Rocket.h	(revision 6107)
+++ code/branches/presentation2/src/modules/weapons/projectiles/Rocket.h	(revision 6107)
@@ -0,0 +1,131 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Oliver Scheuss
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Rocket_H__
+#define _Rocket_H__
+
+#include "weapons/WeaponsPrereqs.h"
+#include "worldentities/ControllableEntity.h"
+
+namespace orxonox
+{
+    class ConeCollisionShape;
+
+    /**
+    @brief
+        Rocket, that is made to move upon a specified pattern.
+        This class was constructed for the PPS tutorial.
+    @author
+        Oli Scheuss
+    */
+    class _WeaponsExport Rocket : public ControllableEntity
+    {
+        public:
+            Rocket(BaseObject* creator);
+            virtual ~Rocket();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a Rocket through XML.
+            virtual void tick(float dt); //!< Defines which actions the Rocket has to take in each tick.
+            
+            virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
+            void destroyObject();
+            
+            virtual void moveFrontBack(const Vector2& value){}
+            virtual void moveRightLeft(const Vector2& value){}
+            virtual void moveUpDown(const Vector2& value){}
+
+            virtual void rotateYaw(const Vector2& value);
+            virtual void rotatePitch(const Vector2& value);
+            virtual void rotateRoll(const Vector2& value);
+            
+            /**
+            @brief Moves the Rocket in the Front/Back-direction by the specifed amount.
+            @param value  The amount by which the Rocket is to be moved.
+            */
+            inline void moveFrontBack(float value)
+            { this->moveFrontBack(Vector2(value, 0)); }
+            /**
+            @brief Moves the Rocket in the Right/Left-direction by the specifed amount.
+            @param value  The amount by which the Rocket is to be moved.
+            */
+            inline void moveRightLeft(float value)
+            { this->moveRightLeft(Vector2(value, 0)); }
+            /**
+            @brief Moves the Rocket in the Up/Down-direction by the specifed amount.
+            @param value  The amount by which the Rocket is to be moved.
+            */
+            inline void moveUpDown(float value)
+            { this->moveUpDown(Vector2(value, 0)); }
+            
+            /**
+            @brief Rotates the Rocket around the y-axis by the specifed amount.
+            @param value  The amount by which the Rocket is to be rotated.
+            */
+            inline void rotateYaw(float value)
+            { this->rotateYaw(Vector2(value, 0)); }
+            /**
+            @brief Rotates the Rocket around the x-axis by the specifed amount.
+            @param value  The amount by which the Rocket is to be rotated.
+            */
+            inline void rotatePitch(float value)
+            { this->rotatePitch(Vector2(value, 0)); }
+            /**
+            @brief Rotates the Rocket around the z-axis by the specifed amount.
+            @param value  The amount by which the Rocket is to be rotated.
+            */
+            inline void rotateRoll(float value)
+            { this->rotateRoll(Vector2(value, 0)); }
+            
+            void setOwner(Pawn* owner);
+            inline Pawn* getOwner() const
+                { return this->owner_; }
+                
+            inline void setDamage(float damage)
+                { this->damage_ = damage; }
+            inline float getDamage() const
+                { return this->damage_; }
+            virtual void fired(unsigned int firemode);
+            
+        private:
+            WeakPtr<Pawn> owner_;
+            Vector3 localAngularVelocity_;
+            float damage_;
+            bool bDestroy_;
+            ControllableEntity* originalControllableEntity_;
+            
+            Model* model_;
+            CameraPosition* camPosition_;
+            ConeCollisionShape* collisionShape_;
+            WeakPtr<PlayerInfo> player_;
+            Timer destroyTimer_;
+            float lifetime_;
+    };
+
+}
+
+#endif /* _Rocket_H__ */
Index: code/branches/presentation2/src/modules/weapons/weaponmodes/CMakeLists.txt
===================================================================
--- code/branches/presentation2/src/modules/weapons/weaponmodes/CMakeLists.txt	(revision 6106)
+++ code/branches/presentation2/src/modules/weapons/weaponmodes/CMakeLists.txt	(revision 6107)
@@ -5,3 +5,4 @@
   HsW01.cc
   LightningGun.cc
+  RocketFire.cc
 )
Index: code/branches/presentation2/src/modules/weapons/weaponmodes/RocketFire.cc
===================================================================
--- code/branches/presentation2/src/modules/weapons/weaponmodes/RocketFire.cc	(revision 6107)
+++ code/branches/presentation2/src/modules/weapons/weaponmodes/RocketFire.cc	(revision 6107)
@@ -0,0 +1,67 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Oliver Scheuss
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "RocketFire.h"
+
+#include "util/Math.h"
+#include "core/CoreIncludes.h"
+#include "weapons/projectiles/Rocket.h"
+
+#include "weaponsystem/Weapon.h"
+#include "weaponsystem/WeaponPack.h"
+#include "weaponsystem/WeaponSystem.h"
+
+namespace orxonox
+{
+    CreateFactory(RocketFire);
+
+    RocketFire::RocketFire(BaseObject* creator) : WeaponMode(creator)
+    {
+        RegisterObject(RocketFire);
+
+        this->reloadTime_ = 0.20;
+        this->bParallelReload_ = false;
+        this->damage_ = 100;
+        this->speed_ = 500;
+
+        this->setMunitionName("RocketMunition");
+    }
+
+    void RocketFire::fire()
+    {
+        Rocket* rocket = new Rocket(this);
+
+        rocket->setOrientation(this->getMuzzleOrientation());
+        rocket->setPosition(this->getMuzzlePosition());
+        rocket->setVelocity(this->getMuzzleDirection() * this->speed_);
+        rocket->scale(2);
+
+        rocket->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
+        rocket->setDamage(this->getDamage());
+    }
+}
Index: code/branches/presentation2/src/modules/weapons/weaponmodes/RocketFire.h
===================================================================
--- code/branches/presentation2/src/modules/weapons/weaponmodes/RocketFire.h	(revision 6107)
+++ code/branches/presentation2/src/modules/weapons/weaponmodes/RocketFire.h	(revision 6107)
@@ -0,0 +1,50 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Oliver Scheuss
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _RocketFire_H__
+#define _RocketFire_H__
+
+#include "weapons/WeaponsPrereqs.h"
+#include "weaponsystem/WeaponMode.h"
+
+namespace orxonox
+{
+    class _WeaponsExport RocketFire : public WeaponMode
+    {
+        public:
+            RocketFire(BaseObject* creator);
+            virtual ~RocketFire() {}
+
+            virtual void fire();
+
+        private:
+            float speed_;
+    };
+}
+
+#endif /* _RocketFire_H__ */
Index: code/branches/presentation2/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/branches/presentation2/src/orxonox/OrxonoxPrereqs.h	(revision 6106)
+++ code/branches/presentation2/src/orxonox/OrxonoxPrereqs.h	(revision 6107)
@@ -176,4 +176,5 @@
     class TeamSpawnPoint;
     class WorldEntity;
+    class Rocket;
     // worldentities, pawns
     class Destroyer;
Index: code/branches/presentation2/src/orxonox/Scene.cc
===================================================================
--- code/branches/presentation2/src/orxonox/Scene.cc	(revision 6106)
+++ code/branches/presentation2/src/orxonox/Scene.cc	(revision 6107)
@@ -334,8 +334,6 @@
     {
         // get the WorldEntity pointers
-        WorldEntity* object0 = static_cast<WorldEntity*>(colObj0->getUserPointer());
-        assert(orxonox_cast<WorldEntity*>(object0));
-        WorldEntity* object1 = static_cast<WorldEntity*>(colObj1->getUserPointer());
-        assert(orxonox_cast<WorldEntity*>(object1));
+        SmartPtr<WorldEntity> object0 = static_cast<WorldEntity*>(colObj0->getUserPointer());
+        SmartPtr<WorldEntity> object1 = static_cast<WorldEntity*>(colObj1->getUserPointer());
 
         // false means that bullet will assume we didn't modify the contact
Index: code/branches/presentation2/src/orxonox/controllers/Controller.h
===================================================================
--- code/branches/presentation2/src/orxonox/controllers/Controller.h	(revision 6106)
+++ code/branches/presentation2/src/orxonox/controllers/Controller.h	(revision 6107)
@@ -37,4 +37,8 @@
     class _OrxonoxExport Controller : public BaseObject
     {
+        // set friend classes to access setControllableEntity
+        friend class PlayerInfo;
+        friend class ControllableEntity;
+        
         public:
             Controller(BaseObject* creator);
@@ -46,4 +50,10 @@
                 { return this->player_; }
 
+            inline ControllableEntity* getControllableEntity() const
+                { return this->controllableEntity_; }
+            virtual void changedControllableEntity() {}
+
+        protected:
+            // don't use this directly, use getPlayer()->startControl(entity) (unless you know exactly what you do)
             inline void setControllableEntity(ControllableEntity* entity)
             {
@@ -54,9 +64,5 @@
                 }
             }
-            inline ControllableEntity* getControllableEntity() const
-                { return this->controllableEntity_; }
-            virtual void changedControllableEntity() {}
 
-        protected:
             PlayerInfo* player_;
             ControllableEntity* controllableEntity_;
Index: code/branches/presentation2/src/orxonox/infos/PlayerInfo.cc
===================================================================
--- code/branches/presentation2/src/orxonox/infos/PlayerInfo.cc	(revision 6106)
+++ code/branches/presentation2/src/orxonox/infos/PlayerInfo.cc	(revision 6107)
@@ -50,5 +50,6 @@
         this->controller_ = 0;
         this->controllableEntity_ = 0;
-        this->controllableEntityID_ = CLIENTID_UNKNOWN;
+        this->controllableEntityID_ = OBJECTID_UNKNOWN;
+        this->oldControllableEntity_ = 0;
 
         this->gtinfo_ = 0;
@@ -80,5 +81,4 @@
         registerVariable(this->name_,                 VariableDirection::ToClient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName));
         registerVariable(this->controllableEntityID_, VariableDirection::ToClient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID));
-        registerVariable(this->bReadyToSpawn_,        VariableDirection::ToServer);
         registerVariable(this->gtinfoID_,             VariableDirection::ToClient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedgtinfoID));
     }
@@ -148,4 +148,6 @@
             return;
 
+        if (this->oldControllableEntity_)
+            this->stopTemporaryControl();
         if (this->controllableEntity_)
             this->stopControl();
@@ -163,7 +165,29 @@
         this->changedControllableEntity();
     }
+    
+    void PlayerInfo::startTemporaryControl(ControllableEntity* entity)
+    {
+        if (!entity)
+            return;
+        
+//         assert( this->temporaryControllableEntity_==0 );
+
+        this->oldControllableEntity_ = this->controllableEntity_;
+        this->controllableEntity_ = entity;
+        this->controllableEntityID_ = entity->getObjectID();
+
+        entity->setPlayer(this);
+
+        if (this->controller_)
+            this->controller_->setControllableEntity(entity);
+
+        this->changedControllableEntity();
+    }
 
     void PlayerInfo::stopControl()
     {
+        if ( this->oldControllableEntity_ )
+            this->stopTemporaryControl();
+        
         ControllableEntity* entity = this->controllableEntity_;
 
@@ -177,9 +201,30 @@
             this->controller_->setControllableEntity(0);
 
-        entity->removePlayer();
-
-        this->changedControllableEntity();
-    }
-
+        if ( GameMode::isMaster() )
+            entity->removePlayer();
+
+        this->changedControllableEntity();
+    }
+    
+    void PlayerInfo::stopTemporaryControl()
+    {
+        ControllableEntity* entity = this->controllableEntity_;
+
+        if (!entity || !this->oldControllableEntity_)
+            return;
+
+        this->controllableEntity_ = this->oldControllableEntity_;
+        this->controllableEntityID_ = this->controllableEntity_->getObjectID();
+        this->oldControllableEntity_ = 0;
+
+        if ( this->controllableEntity_ && this->controller_)
+            this->controller_->setControllableEntity(this->controllableEntity_);
+
+        if ( GameMode::isMaster() )
+            entity->removePlayer();
+        
+        this->changedControllableEntity();
+    }
+    
     void PlayerInfo::networkcallback_changedcontrollableentityID()
     {
@@ -196,4 +241,5 @@
     }
 
+
     void PlayerInfo::networkcallback_changedgtinfoID()
     {
Index: code/branches/presentation2/src/orxonox/infos/PlayerInfo.h
===================================================================
--- code/branches/presentation2/src/orxonox/infos/PlayerInfo.h	(revision 6106)
+++ code/branches/presentation2/src/orxonox/infos/PlayerInfo.h	(revision 6107)
@@ -69,4 +69,6 @@
             void startControl(ControllableEntity* entity);
             void stopControl();
+            void startTemporaryControl(ControllableEntity* entity);
+            void stopTemporaryControl();
 
             inline ControllableEntity* getControllableEntity() const
@@ -96,4 +98,5 @@
             Controller* controller_;
             ControllableEntity* controllableEntity_;
+            ControllableEntity* oldControllableEntity_;
             unsigned int controllableEntityID_;
 
Index: code/branches/presentation2/src/orxonox/weaponsystem/WeaponPack.cc
===================================================================
--- code/branches/presentation2/src/orxonox/weaponsystem/WeaponPack.cc	(revision 6106)
+++ code/branches/presentation2/src/orxonox/weaponsystem/WeaponPack.cc	(revision 6107)
@@ -49,7 +49,8 @@
     WeaponPack::~WeaponPack()
     {
-        if (this->isInitialized() && this->weaponSystem_)
+        if (this->isInitialized())
         {
-            this->weaponSystem_->removeWeaponPack(this);
+            if( this->weaponSystem_ )
+                this->weaponSystem_->removeWeaponPack(this);
 
             while (!this->weapons_.empty())
@@ -71,5 +72,5 @@
     void WeaponPack::fire(unsigned int weaponmode)
     {
-        for (std::set<Weapon *>::iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
+        for (std::vector<Weapon *>::iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
             (*it)->fire(weaponmode);
     }
@@ -77,5 +78,5 @@
     void WeaponPack::reload()
     {
-        for (std::set<Weapon *>::iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
+        for (std::vector<Weapon *>::iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
             (*it)->reload();
     }
@@ -86,5 +87,5 @@
             return;
 
-        this->weapons_.insert(weapon);
+        this->weapons_.push_back(weapon);
         weapon->setWeaponPack(this);
     }
@@ -95,5 +96,7 @@
             return;
 
-        this->weapons_.erase(weapon);
+        std::vector<Weapon*>::iterator it = std::find(this->weapons_.begin(), this->weapons_.end(), weapon);
+        assert(it != this->weapons_.end());
+        this->weapons_.erase(it);
         weapon->setWeaponPack(0);
     }
@@ -103,5 +106,5 @@
         unsigned int i = 0;
 
-        for (std::set<Weapon *>::const_iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
+        for (std::vector<Weapon *>::const_iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
         {
             if (i == index)
@@ -142,5 +145,5 @@
     void WeaponPack::notifyWeapons()
     {
-        for (std::set<Weapon *>::const_iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
+        for (std::vector<Weapon *>::const_iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
             (*it)->setWeaponPack(this);
     }
Index: code/branches/presentation2/src/orxonox/weaponsystem/WeaponPack.h
===================================================================
--- code/branches/presentation2/src/orxonox/weaponsystem/WeaponPack.h	(revision 6106)
+++ code/branches/presentation2/src/orxonox/weaponsystem/WeaponPack.h	(revision 6107)
@@ -69,5 +69,5 @@
             void notifyWeapons();
 
-            std::set<Weapon *> weapons_;
+            std::vector<Weapon *> weapons_;
             std::set<DefaultWeaponmodeLink *> links_;
             WeaponSystem * weaponSystem_;
Index: code/branches/presentation2/src/orxonox/weaponsystem/WeaponSystem.cc
===================================================================
--- code/branches/presentation2/src/orxonox/weaponsystem/WeaponSystem.cc	(revision 6106)
+++ code/branches/presentation2/src/orxonox/weaponsystem/WeaponSystem.cc	(revision 6107)
@@ -202,5 +202,5 @@
         }
 
-        this->weaponPacks_.insert(wPack);
+        this->weaponPacks_.push_back(wPack);
         wPack->setWeaponSystem(this);
 
@@ -221,5 +221,7 @@
 
         // Remove the WeaponPack from the WeaponSystem
-        this->weaponPacks_.erase(wPack);
+        std::vector<WeaponPack*>::iterator it = std::find(this->weaponPacks_.begin(),this->weaponPacks_.end(), wPack);
+        assert(it !=this->weaponPacks_.end());
+        this->weaponPacks_.erase(it);
     }
 
@@ -227,5 +229,5 @@
     {
         unsigned int i = 0;
-        for (std::set<WeaponPack*>::const_iterator it = this->weaponPacks_.begin(); it != this->weaponPacks_.end(); ++it)
+        for (std::vector<WeaponPack*>::const_iterator it = this->weaponPacks_.begin(); it != this->weaponPacks_.end(); ++it)
         {
             ++i;
@@ -258,5 +260,5 @@
 
         // Check if the WeaponPack belongs to this WeaponSystem
-        std::set<WeaponPack *>::iterator it1 = this->weaponPacks_.find(wPack);
+        std::vector<WeaponPack *>::iterator it1 = std::find( this->weaponPacks_.begin(), this->weaponPacks_.end(), wPack );
         if (it1 == this->weaponPacks_.end())
             return;
Index: code/branches/presentation2/src/orxonox/weaponsystem/WeaponSystem.h
===================================================================
--- code/branches/presentation2/src/orxonox/weaponsystem/WeaponSystem.h	(revision 6106)
+++ code/branches/presentation2/src/orxonox/weaponsystem/WeaponSystem.h	(revision 6107)
@@ -92,5 +92,5 @@
             std::map<unsigned int, WeaponSet *> weaponSets_;
             std::vector<WeaponSlot *> weaponSlots_;
-            std::set<WeaponPack *> weaponPacks_;
+            std::vector<WeaponPack *> weaponPacks_;
             std::map<Identifier *, Munition *> munitions_;
             Pawn * pawn_;
Index: code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.cc	(revision 6106)
+++ code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.cc	(revision 6107)
@@ -36,4 +36,5 @@
 #include "core/GameMode.h"
 #include "core/XMLPort.h"
+#include "network/NetworkFunction.h"
 
 #include "Scene.h"
@@ -47,4 +48,6 @@
 {
     CreateFactory(ControllableEntity);
+
+    registerMemberNetworkFunction( ControllableEntity, fire );
 
     ControllableEntity::ControllableEntity(BaseObject* creator) : MobileEntity(creator)
@@ -217,4 +220,16 @@
             this->cameraPositionRootNode_->roll(Radian(value.y * this->mouseLookSpeed_), Ogre::Node::TS_LOCAL);
     }
+    
+    void ControllableEntity::fire(unsigned int firemode)
+    {
+        if(GameMode::isMaster())
+        {
+            this->fired(firemode);
+        }
+        else
+        {
+            callMemberNetworkFunction(ControllableEntity, fire, this->getObjectID(), 0, firemode);
+        }
+    }
 
     void ControllableEntity::setPlayer(PlayerInfo* player)
Index: code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.h
===================================================================
--- code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.h	(revision 6106)
+++ code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.h	(revision 6107)
@@ -84,5 +84,6 @@
                 { this->rotateRoll(Vector2(value, 0)); }
 
-            virtual void fire(unsigned int firemode) {}
+            void fire(unsigned int firemode);
+            virtual void fired(unsigned int firemode) {}
             virtual void reload() {}
 
Index: code/branches/presentation2/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/presentation2/src/orxonox/worldentities/pawns/Pawn.cc	(revision 6106)
+++ code/branches/presentation2/src/orxonox/worldentities/pawns/Pawn.cc	(revision 6107)
@@ -52,6 +52,4 @@
     CreateFactory(Pawn);
 
-    registerMemberNetworkFunction( Pawn, doFire );
-
     Pawn::Pawn(BaseObject* creator) : ControllableEntity(creator)
     {
@@ -110,5 +108,5 @@
         XMLPortObject(Pawn, WeaponSlot, "weaponslots", addWeaponSlot, getWeaponSlot, xmlelement, mode);
         XMLPortObject(Pawn, WeaponSet, "weaponsets", addWeaponSet, getWeaponSet, xmlelement, mode);
-        XMLPortObject(Pawn, WeaponPack, "weapons", addWeaponPack, getWeaponPack, xmlelement, mode);
+        XMLPortObject(Pawn, WeaponPack, "weapons", addWeaponPackXML, getWeaponPack, xmlelement, mode);
     }
 
@@ -263,22 +261,8 @@
     }
 
-    void Pawn::fire(unsigned int firemode)
-    {
-        this->doFire(firemode);
-    }
-
-    void Pawn::doFire(uint8_t firemode)
-    {
-        if(GameMode::isMaster())
-        {
-            if (this->weaponSystem_)
-                this->weaponSystem_->fire(firemode);
-        }
-        else
-        {
-            callMemberNetworkFunction(Pawn, doFire, this->getObjectID(), 0, firemode);
-            if (this->weaponSystem_)
-                this->weaponSystem_->fire(firemode);
-        }
+    void Pawn::fired(unsigned int firemode)
+    {
+        if (this->weaponSystem_)
+            this->weaponSystem_->fire(firemode);
     }
 
@@ -341,4 +325,11 @@
     }
 
+    void Pawn::addWeaponPackXML(WeaponPack * wPack)
+    {
+        if (this->weaponSystem_)
+            if (!this->weaponSystem_->addWeaponPack(wPack))
+                wPack->destroy();
+    }
+
     WeaponPack * Pawn::getWeaponPack(unsigned int index) const
     {
Index: code/branches/presentation2/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/branches/presentation2/src/orxonox/worldentities/pawns/Pawn.h	(revision 6106)
+++ code/branches/presentation2/src/orxonox/worldentities/pawns/Pawn.h	(revision 6107)
@@ -79,7 +79,6 @@
             virtual void kill();
 
-            virtual void fire(unsigned int firemode);
+            virtual void fired(unsigned int firemode);
             virtual void reload();
-            virtual void doFire(uint8_t firemode);
             virtual void postSpawn();
 
@@ -89,4 +88,5 @@
             WeaponSet * getWeaponSet(unsigned int index) const;
             void addWeaponPack(WeaponPack * wPack);
+            void addWeaponPackXML(WeaponPack * wPack);
             WeaponPack * getWeaponPack(unsigned int index) const;
 
Index: code/branches/presentation2/src/orxonox/worldentities/pawns/Spectator.cc
===================================================================
--- code/branches/presentation2/src/orxonox/worldentities/pawns/Spectator.cc	(revision 6106)
+++ code/branches/presentation2/src/orxonox/worldentities/pawns/Spectator.cc	(revision 6107)
@@ -189,5 +189,5 @@
     }
 
-    void Spectator::fire(unsigned int firemode)
+    void Spectator::fired(unsigned int firemode)
     {
         if (this->getPlayer())
Index: code/branches/presentation2/src/orxonox/worldentities/pawns/Spectator.h
===================================================================
--- code/branches/presentation2/src/orxonox/worldentities/pawns/Spectator.h	(revision 6106)
+++ code/branches/presentation2/src/orxonox/worldentities/pawns/Spectator.h	(revision 6107)
@@ -55,5 +55,5 @@
             virtual void rotateRoll(const Vector2& value);
 
-            virtual void fire(unsigned int firemode);
+            virtual void fired(unsigned int firemode);
             virtual void greet();
 
