Index: /trunk/src/game/SpellEffects.cpp
===================================================================
--- /trunk/src/game/SpellEffects.cpp (revision 122)
+++ /trunk/src/game/SpellEffects.cpp (revision 126)
@@ -3109,4 +3109,5 @@
     uint32 level = m_caster->getLevel();
     Pet* spawnCreature = new Pet(SUMMON_PET);
+    spawnCreature->setActive(m_caster->isActive());
 
     if(spawnCreature->LoadPetFromDB(m_caster,pet_entry))
@@ -3544,4 +3545,5 @@
     {
         Pet* spawnCreature = new Pet(GUARDIAN_PET);
+        spawnCreature->setActive(m_caster->isActive());
 
         Map *map = m_caster->GetMap();
@@ -3938,4 +3940,5 @@
 
     Pet* NewSummon = new Pet;
+    NewSummon->setActive(m_caster->isActive());
 
     // petentry==0 for hunter "call pet" (current pet summoned if any)
Index: /trunk/src/game/Totem.cpp
===================================================================
--- /trunk/src/game/Totem.cpp (revision 123)
+++ /trunk/src/game/Totem.cpp (revision 126)
@@ -60,11 +60,23 @@
     if (owner->GetTypeId()==TYPEID_PLAYER && cinfo)
     {
-        if (uint32 modelid = cinfo->GetRandomValidModelId()) 
+        uint32 modelid = 0;
+        if(((Player*)owner)->GetTeam() == HORDE)
+        {
+            if(cinfo->Modelid3)
+                modelid = cinfo->Modelid3;
+            else if(cinfo->Modelid4)
+                modelid = cinfo->Modelid4;
+        }
+        else
+        {
+            if(cinfo->Modelid1)
+                modelid = cinfo->Modelid1;
+            else if(cinfo->Modelid2)
+                modelid = cinfo->Modelid2;
+        }
+        if (modelid)
             SetDisplayId(modelid);
         else
-        {
-            sLog.outErrorDb("No displayid found for the totem with the entry %u! Can't summon it!", GetEntry());
-            return;
-        }
+            sLog.outErrorDb("Totem::Summon: Missing modelid information for entry %u, team %u, totem will use default values.",GetEntry(),((Player*)owner)->GetTeam());
     }
 
Index: /trunk/src/game/Player.h
===================================================================
--- /trunk/src/game/Player.h (revision 120)
+++ /trunk/src/game/Player.h (revision 126)
@@ -904,5 +904,5 @@
         void RemoveFromWorld();
         // always active
-        void setActive() {}
+        void setActive(bool) {}
 
         bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options = 0);
Index: /trunk/src/game/Pet.h
===================================================================
--- /trunk/src/game/Pet.h (revision 120)
+++ /trunk/src/game/Pet.h (revision 126)
@@ -123,6 +123,4 @@
         void AddToWorld();
         void RemoveFromWorld();
-        // always active
-        void setActive() {}
 
         PetType getPetType() const { return m_petType; }
Index: /trunk/src/game/ObjectMgr.cpp
===================================================================
--- /trunk/src/game/ObjectMgr.cpp (revision 123)
+++ /trunk/src/game/ObjectMgr.cpp (revision 126)
@@ -712,20 +712,20 @@
 
         // check model ids, supplying and sending non-existent ids to the client might crash them
-        if(!sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid1))
+        if(cInfo->Modelid1 && !sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid1))
         {
             sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_A (%u), setting it to 0", cInfo->Entry, cInfo->Modelid1);
             const_cast<CreatureInfo*>(cInfo)->Modelid1 = 0;
         }
-        if(!sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid2))
+        if(cInfo->Modelid2 && !sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid2))
         {
             sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_A2 (%u), setting it to 0", cInfo->Entry, cInfo->Modelid2);
             const_cast<CreatureInfo*>(cInfo)->Modelid2 = 0;
         }
-        if(!sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid3))
+        if(cInfo->Modelid3 && !sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid3))
         {
             sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_H (%u), setting it to 0", cInfo->Entry, cInfo->Modelid3);
             const_cast<CreatureInfo*>(cInfo)->Modelid3 = 0;
         }
-        if(!sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid4))
+        if(cInfo->Modelid4 && !sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid4))
         {
             sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_H2 (%u), setting it to 0", cInfo->Entry, cInfo->Modelid4);
Index: /trunk/src/game/ObjectAccessor.cpp
===================================================================
--- /trunk/src/game/ObjectAccessor.cpp (revision 120)
+++ /trunk/src/game/ObjectAccessor.cpp (revision 126)
@@ -534,8 +534,13 @@
         std::set<WorldObject *> activeobjects(i_activeobjects);
 
-        std::set<WorldObject *>::const_iterator itr;
-        for(itr = activeobjects.begin(); itr != activeobjects.end(); ++itr)
-        {
-            (*itr)->GetMap()->resetMarkedCells();
+        std::set<WorldObject *>::iterator itr, next;
+        for(itr = activeobjects.begin(); itr != activeobjects.end(); itr = next)
+        {
+            next = itr;
+            ++next;
+            if((*itr)->IsInWorld())
+                (*itr)->GetMap()->resetMarkedCells();
+            else
+                activeobjects.erase(itr);
         }
 
