Index: code/trunk/src/modules/pickup/PickupRepresentation.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupRepresentation.cc	(revision 8858)
+++ code/trunk/src/modules/pickup/PickupRepresentation.cc	(revision 9348)
@@ -52,5 +52,5 @@
         This is primarily for use of the PickupManager in creating a default PickupRepresentation.
     */
-    PickupRepresentation::PickupRepresentation() : BaseObject(NULL), Synchronisable(NULL), spawnerRepresentation_(NULL), pickup_(NULL)
+    PickupRepresentation::PickupRepresentation() : BaseObject(NULL), Synchronisable(NULL), spawnerRepresentation_(NULL)
     {
         RegisterObject(PickupRepresentation);
@@ -64,5 +64,5 @@
         Default Constructor. Registers the object and initializes its member variables.
     */
-    PickupRepresentation::PickupRepresentation(BaseObject* creator) : BaseObject(creator), Synchronisable(creator), spawnerRepresentation_(NULL), pickup_(NULL)
+    PickupRepresentation::PickupRepresentation(BaseObject* creator) : BaseObject(creator), Synchronisable(creator), spawnerRepresentation_(NULL)
     {
         RegisterObject(PickupRepresentation);
@@ -70,6 +70,4 @@
         this->initialize();
         this->registerVariables();
-
-        PickupManager::getInstance().registerRepresentation(this); // Registers the PickupRepresentation with the PickupManager.
     }
 
@@ -84,11 +82,5 @@
 
         if(this->isInitialized())
-        {
-            if(GameMode::isMaster() && this->pickup_ != NULL)
-            {
-                PickupManager::getInstance().unregisterRepresentation(this->pickup_->getPickupIdentifier(), this);
-            }
-            PickupManager::getInstance().unregisterRepresentation(this);
-        }
+            PickupManager::getInstance().unregisterRepresentation(this->getName());
     }
 
@@ -128,15 +120,5 @@
         XMLPortParam(PickupRepresentation, "spawnerTemplate", setSpawnerTemplate, getSpawnerTemplate, xmlelement, mode);
         XMLPortParam(PickupRepresentation, "inventoryRepresentation", setInventoryRepresentation, getInventoryRepresentation, xmlelement, mode);
-        XMLPortObject(PickupRepresentation, Pickupable, "pickup", setPickup, getPickup, xmlelement, mode);
         XMLPortObject(PickupRepresentation, StaticEntity, "spawner-representation", setSpawnerRepresentation, getSpawnerRepresentationIndex, xmlelement, mode);
-
-        if(GameMode::isMaster())
-        {
-            // Registers the PickupRepresentation with the PickupManager through the PickupIdentifier of the Pickupable it represents.
-            PickupManager::getInstance().registerRepresentation(this->pickup_->getPickupIdentifier(), this);
-        }
-
-        if(this->spawnerRepresentation_ != NULL)
-            this->spawnerRepresentation_->setVisible(false);
 
         orxout(verbose, context::pickups) << "PickupRepresentation created: name: '" << this->name_ << "', description: '" << this->description_ << "', spawnerTemplate: '" << this->spawnerTemplate_ << "'." << endl;
@@ -151,5 +133,5 @@
         Returns a pointer to the StaticEntity.
     */
-    StaticEntity* PickupRepresentation::getSpawnerRepresentation(PickupSpawner* spawner)
+    StaticEntity* PickupRepresentation::createSpawnerRepresentation(PickupSpawner* spawner)
     {
         if(this->spawnerRepresentation_ == NULL)
@@ -158,5 +140,5 @@
             if(this->spawnerTemplate_ == "")
             {
-                orxout(verbose, context::pickups) << "PickupRepresentation: Spawner template is empty." << endl;
+                orxout(internal_warning, context::pickups) << "PickupRepresentation: Spawner template is empty." << endl;
                 // If neither spawnerRepresentation nor spawnerTemplate was specified
                 return this->getDefaultSpawnerRepresentation(spawner);
@@ -165,11 +147,23 @@
         }
 
-        StaticEntity* representation = this->spawnerRepresentation_;
-        representation->setVisible(true);
+        this->spawnerRepresentation_->setVisible(true);
+        StaticEntity* temp = this->spawnerRepresentation_;
+        this->spawnerRepresentation_ = NULL;
 
-        this->addTemplate(this->spawnerTemplate_);
-        this->spawnerRepresentation_->setVisible(false);
+        return temp;
+    }
 
-        return representation;
+    void PickupRepresentation::changedName()
+    {
+        // Registers the PickupRepresentation with the PickupManager.
+        PickupManager::getInstance().unregisterRepresentation(this->getOldName());
+        PickupManager::getInstance().registerRepresentation(this->getName(), this);
+    }
+
+    void PickupRepresentation::setSpawnerRepresentation(StaticEntity* representation)
+    {
+        this->spawnerRepresentation_ = representation;
+        if(this->spawnerRepresentation_ != NULL)
+            this->spawnerRepresentation_->setVisible(false);
     }
 
