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();
 
