Instructions Jenkins Doxygen

[Fixed] terminal vendors no longer count towards a building's total item 87/1387/3
authorIvojedi <ivojedi@swgemu.com>
Tue, 18 Mar 2014 22:07:00 +0000 (15:07 -0700)
committergerrit <gerrit@review.swgemu.com>
Fri, 9 May 2014 06:56:27 +0000 (06:56 +0000)
count
[Fixed] items in a structure (including vendors) are now properly
destroyed when the structure is destroyed
[Added] code to cleanup a player's vendor list when the player attempts
to create a vendor

Change-Id: Ia606e99fe1642a69207aa43fccf4c211292b038b

MMOCoreORB/src/server/zone/managers/structure/tasks/DestroyStructureTask.h
MMOCoreORB/src/server/zone/objects/cell/CellObjectImplementation.cpp
MMOCoreORB/src/server/zone/objects/player/PlayerObject.idl
MMOCoreORB/src/server/zone/objects/player/PlayerObjectImplementation.cpp

index 1d87adf..652c76c 100644 (file)
@@ -100,8 +100,8 @@ public:
                        }
                }
 
-               structureObject->destroyObjectFromWorld(true);
                structureObject->destroyObjectFromDatabase(true);
+               structureObject->destroyObjectFromWorld(true);
                structureObject->notifyObservers(ObserverEventType::OBJECTDESTRUCTION, structureObject, 0);
        }
 };
index ce433e6..ab3b673 100644 (file)
@@ -162,7 +162,7 @@ int CellObjectImplementation::getCurrentNumberOfPlayerItems() {
                        ManagedReference<SceneObject*> containerObject = getContainerObject(j);
                        rlocker.release();
 
-                       if (!getParent().get()->containsChildObject(containerObject) && !containerObject->isCreatureObject()) {
+                       if (!getParent().get()->containsChildObject(containerObject) && !containerObject->isCreatureObject() && !containerObject->isVendor()) {
 
                                if (containerObject->isContainerObject())
                                        count += containerObject->getCountableObjectsRecursive();
index 6fcb284..63d65e3 100644 (file)
@@ -1431,9 +1431,7 @@ class PlayerObject extends IntangibleObject {
                ownedVendors.removeElement(vendor.getObjectID());
        }
        
-       public int getVendorCount() {
-               return ownedVendors.size();
-       }
+       public native int getVendorCount();
 
        @local
        public SortedVector<unsigned long> getOwnedVendors() {
index c98aead..5d71fb4 100644 (file)
@@ -1927,3 +1927,20 @@ void PlayerObjectImplementation::setPlayerQuestData(uint32 questHashCode, Player
 PlayerQuestData PlayerObjectImplementation::getQuestData(uint32 questHashCode) {
        return playerQuestsData.get(questHashCode);
 }
+
+int PlayerObjectImplementation::getVendorCount() {
+       // Cleanup vendor list before returning the count
+       for (int i = ownedVendors.size() - 1; i >= 0; --i) {
+               ManagedReference<SceneObject*> vendor = server->getZoneServer()->getObject(ownedVendors.get(i)).get();
+
+               if (vendor == NULL) {
+                       ownedVendors.remove(i);
+                       continue;
+               }
+
+               if (vendor->getParent().get() == NULL)
+                       vendor->destroyObjectFromDatabase(true);
+       }
+
+       return ownedVendors.size();
+}