Index: code/branches/presentation3/data/gui/scripts/KeyBindMenu.lua
===================================================================
--- code/branches/presentation3/data/gui/scripts/KeyBindMenu.lua	(revision 6994)
+++ code/branches/presentation3/data/gui/scripts/KeyBindMenu.lua	(revision 6996)
@@ -28,4 +28,8 @@
     table.insert(commandList, "OverlayGroup toggleVisibility Debug")
     table.insert(commandList, "OverlayGroup toggleVisibility Stats")
+    table.insert(commandList, "OrxonoxOverlay toggleVisibility QuestGUI")
+    table.insert(commandList, "OrxonoxOverlay toggleVisibility PickupInventory")
+    table.insert(commandList, "startchat")
+    table.insert(commandList, "startchat_small")
     table.insert(commandList, "mouseLook")
     table.insert(commandList, "pause")
@@ -53,4 +57,8 @@
     table.insert(nameList, "Show Debug")
     table.insert(nameList, "Show Stats")
+    table.insert(nameList, "Show Quests")
+    table.insert(nameList, "Show Pickups")
+    table.insert(nameList, "Show Chat")
+    table.insert(nameList, "Show small Chat")
     table.insert(nameList, "Look Around")
     table.insert(nameList, "Pause")
Index: code/branches/presentation3/data/gui/scripts/PickupInventory.lua
===================================================================
--- code/branches/presentation3/data/gui/scripts/PickupInventory.lua	(revision 6994)
+++ code/branches/presentation3/data/gui/scripts/PickupInventory.lua	(revision 6996)
@@ -3,7 +3,7 @@
 local P = createMenuSheet("PickupInventory")
 
-P.carrierList = {}
 P.wrapper = nil
 P.detailsWindows = {}
+P.detailPickups = {}
 P.pickupsList = {}
 
@@ -17,5 +17,8 @@
 
 function P.onLoad()
-    carrierList = {}
+    P.wrapper = nil
+    P.detailsWindows = {}
+    P.detailPickups = {}
+    P.pickupsList = {}
 end
 
@@ -27,5 +30,5 @@
 function P.onHide()
     P.showing = false
-    P.cleanup()
+    P.cleanup(true)
 end
 
@@ -34,8 +37,41 @@
         return
     end
-    
-    P.cleanup()
-    
+
+    -- Update opened detail windows.
+    for k,v in pairs(P.detailsWindows) do
+        if v ~= nil then
+            local pickup = P.detailPickups[k]
+            if pickup ~= nil and pickup ~= 0 then
+                local useButton = winMgr:getWindow("orxonox/PickupInventory/Details" .. k .. "/UseButton")
+                local dropButton = winMgr:getWindow("orxonox/PickupInventory/Details" .. k .. "/DropButton")
+                if orxonox.PickupManager:getInstance():isValidPickup(pickup) == false then
+                    useButton:setEnabled(false)
+                    dropButton:setEnabled(false)
+                    P.detailPickups[k] = nil
+                else
+                    useButton:setEnabled(true)
+                    if pickup:isUsed() == true then
+                        useButton:setText("unuse")
+                        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseDetailButton_clicked")
+                    else
+                        useButton:setText("use")
+                        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUnuseDetailButton_clicked")
+                    end
+
+                    if pickup:isPickedUp() == false then
+                        useButton:setEnabled(false)
+                        dropButton:setEnabled(false)
+                        P.detailPickups[k] = nil
+                    end
+                end
+            end
+        end
+    end
+
+    -- Update main inventory.
+    P.cleanup(false)
     P.createInventory()
+    -- TODO: Recover scrolling position
+    
 end
 
@@ -83,5 +119,5 @@
     local title = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Title")
     title:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.imageHeight+5), CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2)))
-    title:setSize(CEGUI.UVector2(CEGUI.UDim(0.4, 0), CEGUI.UDim(0, P.textHeight)))
+    title:setSize(CEGUI.UVector2(CEGUI.UDim(0.3, 0), CEGUI.UDim(0, P.textHeight)))
     title:setText(representation:getPickupName())
     title:setProperty("FrameEnabled", "set:False")
@@ -89,5 +125,5 @@
 
     local useButton = winMgr:createWindow("MenuWidgets/Button", name .. "/UseButton")
-    useButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.4, P.imageHeight+10),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2)))
+    useButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.3, P.imageHeight+10),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2)))
     useButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
     if pickup:isUsed() == false then
@@ -101,5 +137,5 @@
 
     local dropButton = winMgr:createWindow("MenuWidgets/Button", name .. "/DropButton")
-    dropButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.4, P.imageHeight+15+P.buttonWidth),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2)))
+    dropButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.3, P.imageHeight+15+P.buttonWidth),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2)))
     dropButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
     dropButton:setText("drop")
@@ -108,5 +144,5 @@
 
     local detailsButton = winMgr:createWindow("MenuWidgets/Button", name .. "/DetailsButton")
-    detailsButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.4, P.imageHeight+20+2*P.buttonWidth),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2)))
+    detailsButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.3, P.imageHeight+20+2*P.buttonWidth),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2)))
     detailsButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
     detailsButton:setText("details")
@@ -117,5 +153,5 @@
 end
 
-function P.cleanup()
+function P.cleanup(destroyDetails)
     if P.wrapper ~= nil then
         winMgr:destroyWindow(P.wrapper)
@@ -123,4 +159,7 @@
     
     --Destroy details windows.
+    if destroyDetails == false then
+        return
+    end
     for k,v in pairs(P.detailsWindows) do
         if v ~= nil then
@@ -143,10 +182,7 @@
     local pickup = P.pickupsList[pickupIndex]
     local representation = orxonox.PickupManager:getInstance():getPickupRepresentation(pickup)
-    
-    local headerOffset = 35
-    --Design parameters
-    local imageSize = 100
-    
-    local name = "orxonox/PickupInventory/Pickup" .. pickupIndex .. "/Details" .. P.getNewDetailNumber()
+
+    local index = P.getNewDetailNumber()
+    local name = "orxonox/PickupInventory/Details" .. index
     
     local window = winMgr:createWindow("MenuWidgets/FrameWindow", name)
@@ -192,8 +228,8 @@
     if pickup:isUsed() == false then
         useButton:setText("use")
-        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseButton_clicked")
+        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseDetailButton_clicked")
     else
         useButton:setText("unuse")
-        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUnuseButton_clicked")
+        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUnuseDetailButton_clicked")
     end
     wrapper:addChildWindow(useButton)
@@ -203,11 +239,13 @@
     dropButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
     dropButton:setText("drop")
-    orxonox.GUIManager:subscribeEventHelper(dropButton, "Clicked", P.name .. ".InventoryDropButton_clicked")
+    orxonox.GUIManager:subscribeEventHelper(dropButton, "Clicked", P.name .. ".InventoryDropDetailButton_clicked")
     wrapper:addChildWindow(dropButton)
-    
-    table.insert(P.detailsWindows, window)
-    
-end
-
+
+    P.detailsWindows[index] = window
+    P.detailPickups[index] = pickup
+    
+end
+
+-- TODO: Smarter
 function P.getNewDetailNumber()
     local number = table.getn(P.detailsWindows)
@@ -217,5 +255,5 @@
         end
     end
-    return number
+    return number+1
 end
 
@@ -238,4 +276,19 @@
     local pickupIndex = P.windowToPickupHelper(e)
     P.createDetailsWindow(pickupIndex)
+end
+
+function P.InventoryUseDetailButton_clicked(e)
+    local pickupIndex = P.windowToPickupHelper(e)
+    orxonox.PickupManager:getInstance():usePickup(P.detailPickups[pickupIndex], true)
+end
+
+function P.InventoryUnuseDetailButton_clicked(e)
+    local pickupIndex = P.windowToPickupHelper(e)
+    orxonox.PickupManager:getInstance():usePickup(P.detailPickups[pickupIndex], false)
+end
+
+function P.InventoryDropDetailButton_clicked(e)
+    local pickupIndex = P.windowToPickupHelper(e)
+    orxonox.PickupManager:getInstance():dropPickup(P.detailPickups[pickupIndex])
 end
 
@@ -245,10 +298,10 @@
     local name = we.window:getName()
     local match = string.gmatch(name, "%d+")
-    local pickupNr = tonumber(match())
     local detailNr = tonumber(match())
     
-    local window = P.detailsWindows[detailNr+1]
+    local window = P.detailsWindows[detailNr]
     winMgr:destroyWindow(window)
-    P.detailsWindows[detailNr+1] = nil
+    P.detailsWindows[detailNr] = nil
+    P.detailPickups[detailNr] = nil
 end
 
Index: code/branches/presentation3/src/libraries/core/GUIManager.h
===================================================================
--- code/branches/presentation3/src/libraries/core/GUIManager.h	(revision 6994)
+++ code/branches/presentation3/src/libraries/core/GUIManager.h	(revision 6996)
@@ -84,4 +84,6 @@
         //! Creates a new InputState to be used with a GUI Sheet
         const std::string& createInputState(const std::string& name, TriBool::Value showCursor = TriBool::True, TriBool::Value useKeyboard = TriBool::True, bool bBlockJoyStick = false); // tolua_export
+        LuaState* getLuaState(void)
+            { return this->luaState_.get(); }
 
         //! Returns the root window for all menu sheets
@@ -102,9 +104,9 @@
 
         static GUIManager& getInstance() { return Singleton<GUIManager>::getInstance(); } // tolua_export
-
+        
     private:
         GUIManager(const GUIManager& instance); //!< private and undefined copy c'tor (this is a singleton class)
-
         void executeCode(const std::string& str);
+        
         template <typename FunctionType>
         bool protectedCall(FunctionType function);
Index: code/branches/presentation3/src/modules/pickup/PickupManager.cc
===================================================================
--- code/branches/presentation3/src/modules/pickup/PickupManager.cc	(revision 6994)
+++ code/branches/presentation3/src/modules/pickup/PickupManager.cc	(revision 6996)
@@ -39,4 +39,5 @@
 #include "core/ScopedSingletonManager.h"
 #include "core/Identifier.h"
+#include "util/Convert.h"
 #include "interfaces/PickupCarrier.h"
 #include "infos/PlayerInfo.h"
@@ -64,5 +65,4 @@
         
         this->defaultRepresentation_ = new PickupRepresentation();
-        this->pickupsIndex_ = 0;
         
         COUT(3) << "PickupManager created." << std::endl;
@@ -154,5 +154,4 @@
     {
         this->pickupsList_.clear();
-        this->pickupsIndex_ = 0;
         
         PlayerInfo* player = GUIManager::getInstance().getPlayer(PickupManager::guiName_s);
@@ -169,5 +168,5 @@
             for(std::set<Pickupable*>::iterator pickup = pickups.begin(); pickup != pickups.end(); pickup++)
             {
-                this->pickupsList_.insert(*pickup);
+                this->pickupsList_.insert(std::pair<Pickupable*, WeakPtr<Pickupable> >(*pickup, WeakPtr<Pickupable>(*pickup)));
             }
         }
@@ -199,14 +198,24 @@
     void PickupManager::dropPickup(orxonox::Pickupable* pickup)
     {
+        std::map<Pickupable*, WeakPtr<Pickupable> >::iterator it = this->pickupsList_.find(pickup);
+        if(pickup == NULL || it == this->pickupsList_.end() || it->second.get() == NULL)
+            return;
+
         if(!pickup->isPickedUp())
             return;
-        
+
         PickupCarrier* carrier = pickup->getCarrier();
         if(pickup != NULL && carrier != NULL)
+        {
             carrier->drop(pickup);
+        }
     }
 
     void PickupManager::usePickup(orxonox::Pickupable* pickup, bool use)
     {
+        std::map<Pickupable*, WeakPtr<Pickupable> >::iterator it = this->pickupsList_.find(pickup);
+        if(pickup == NULL || it == this->pickupsList_.end() || it->second.get() == NULL)
+            return;
+        
         if(!pickup->isPickedUp())
             return;
Index: code/branches/presentation3/src/modules/pickup/PickupManager.h
===================================================================
--- code/branches/presentation3/src/modules/pickup/PickupManager.h	(revision 6994)
+++ code/branches/presentation3/src/modules/pickup/PickupManager.h	(revision 6996)
@@ -39,4 +39,5 @@
 #include <map>
 #include "util/Singleton.h"
+#include "core/WeakPtr.h"
 #include "pickup/PickupIdentifier.h"
 #include "PickupRepresentation.h"
@@ -72,10 +73,10 @@
             // tolua_begin
             int getNumPickups(void);
-            orxonox::Pickupable* popPickup(void) { this->pickupsIndex_++; return *(this->pickupsIterator_++); }
-            int getPickupIndex(void) { return this->pickupsIndex_-1; }
+            orxonox::Pickupable* popPickup(void) { return (this->pickupsIterator_++)->first; }
             orxonox::PickupRepresentation* getPickupRepresentation(orxonox::Pickupable* pickup) { if(pickup != NULL) return this->getRepresentation(pickup->getPickupIdentifier()); return NULL; }
 
             void dropPickup(orxonox::Pickupable* pickup);
             void usePickup(orxonox::Pickupable* pickup, bool use);
+            bool isValidPickup(orxonox::Pickupable* pickup) { std::map<Pickupable*, WeakPtr<Pickupable> >::iterator it = this->pickupsList_.find(pickup); if(it == this->pickupsList_.end()) return false; return it->second.get() != NULL; }
             // tolua_end
             
@@ -87,7 +88,6 @@
             std::map<const PickupIdentifier*, PickupRepresentation*, PickupIdentifierCompare> representations_; //!< Map linking PickupIdentifiers (representing types if Pickupables) and PickupRepresentations.
 
-            std::set<Pickupable*> pickupsList_;
-            std::set<Pickupable*>::iterator pickupsIterator_;
-            int pickupsIndex_;
+            std::map<Pickupable*, WeakPtr<Pickupable> > pickupsList_;
+            std::map<Pickupable*, WeakPtr<Pickupable> >::iterator pickupsIterator_;
 
             std::vector<PickupCarrier*>* getAllCarriers(PickupCarrier* carrier);
Index: code/branches/presentation3/src/orxonox/gametypes/Gametype.cc
===================================================================
--- code/branches/presentation3/src/orxonox/gametypes/Gametype.cc	(revision 6994)
+++ code/branches/presentation3/src/orxonox/gametypes/Gametype.cc	(revision 6996)
@@ -309,13 +309,30 @@
         if (this->spawnpoints_.size() > 0)
         {
+            SpawnPoint* fallbackSpawnPoint = NULL;
             unsigned int randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(this->spawnpoints_.size())));
             unsigned int index = 0;
+            std::set<SpawnPoint*> activeSpawnPoints = this->spawnpoints_;
             for (std::set<SpawnPoint*>::const_iterator it = this->spawnpoints_.begin(); it != this->spawnpoints_.end(); ++it)
+            {
+                if (index == randomspawn)
+                    fallbackSpawnPoint = (*it);
+
+                if (!(*it)->isActive())
+                    activeSpawnPoints.erase(*it);
+
+                ++index;
+            }
+
+            randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(this->spawnpoints_.size())));
+            index = 0;
+            for (std::set<SpawnPoint*>::const_iterator it = activeSpawnPoints.begin(); it != activeSpawnPoints.end(); ++it)
             {
                 if (index == randomspawn)
                     return (*it);
-
+                
                 ++index;
             }
+
+            return fallbackSpawnPoint;
         }
         return 0;
Index: code/branches/presentation3/src/orxonox/interfaces/Pickupable.cc
===================================================================
--- code/branches/presentation3/src/orxonox/interfaces/Pickupable.cc	(revision 6994)
+++ code/branches/presentation3/src/orxonox/interfaces/Pickupable.cc	(revision 6996)
@@ -34,7 +34,12 @@
 #include "Pickupable.h"
 
+#include "core/LuaState.h"
+#include "core/GUIManager.h"
 #include "core/Identifier.h"
 #include "core/CoreIncludes.h"
+#include "util/Convert.h"
+#include "infos/PlayerInfo.h"
 #include "pickup/PickupIdentifier.h"
+#include "worldentities/pawns/Pawn.h"
 #include "PickupCarrier.h"
 
@@ -91,4 +96,6 @@
         this->used_ = used;
         this->changedUsed();
+
+        GUIManager::getInstance().getLuaState()->doString("PickupInventory.update()");
         return true;
     }
@@ -196,4 +203,5 @@
         this->pickedUp_ = pickedUp;
         this->changedPickedUp();
+        GUIManager::getInstance().getLuaState()->doString("PickupInventory.update()");
         return true;
     }
@@ -273,4 +281,20 @@
         SUPER(Pickupable, clone, item);
     }
+
+    /**
+    @brief
+        Method to transcribe a Pickupable as a Rewardable to the player.
+    @param player
+        A pointer to the PlayerInfo, do whatever you want with it.
+    @return
+        Return true if successful.
+    */
+    bool Pickupable::reward(PlayerInfo* player)
+    {
+        ControllableEntity* entity = player->getControllableEntity();
+        Pawn* pawn = static_cast<Pawn*>(entity);
+        PickupCarrier* carrier = static_cast<PickupCarrier*>(pawn);
+        return carrier->pickup(this);
+    }
     
 }
Index: code/branches/presentation3/src/orxonox/interfaces/Pickupable.h
===================================================================
--- code/branches/presentation3/src/orxonox/interfaces/Pickupable.h	(revision 6994)
+++ code/branches/presentation3/src/orxonox/interfaces/Pickupable.h	(revision 6996)
@@ -41,4 +41,5 @@
 
 #include "core/OrxonoxClass.h"
+#include "Rewardable.h"
 
 namespace orxonox // tolua_export
@@ -52,5 +53,5 @@
     */
     class _OrxonoxExport Pickupable  // tolua_export
-        : virtual public OrxonoxClass
+        : virtual public OrxonoxClass, public Rewardable
     {  // tolua_export
         protected:
@@ -141,4 +142,8 @@
             std::list<Identifier*> targets_; //!< The possible targets of this pickup.
 
+        // For implementing the Rewardable interface:
+        public:
+            virtual bool reward(PlayerInfo* player); //!< Method to transcribe a Pickupable as a Rewardable to the player.
+
     };  // tolua_export
     
Index: code/branches/presentation3/src/orxonox/interfaces/Rewardable.h
===================================================================
--- code/branches/presentation3/src/orxonox/interfaces/Rewardable.h	(revision 6994)
+++ code/branches/presentation3/src/orxonox/interfaces/Rewardable.h	(revision 6996)
@@ -48,5 +48,5 @@
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport Rewardable : public OrxonoxClass
+    class _OrxonoxExport Rewardable : virtual public OrxonoxClass
     {
         public:
@@ -59,5 +59,5 @@
                 Must be implemented by every class inheriting from Rewardable.
             @param player
-                A pointer to the ControllableEntity, do whatever you want with it.
+                A pointer to the PlayerInfo, do whatever you want with it.
             @return
                 Return true if successful.
