From: DaveG <da...@us...> - 2006-01-15 21:30:45
|
Update of /cvsroot/planeshift/planeshift/src/server/bulkobjects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27042/src/server/bulkobjects Modified Files: pscharacter.h psitem.cpp Log Message: Removed the old public AdjustWeight() function to fix bugs Index: pscharacter.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/bulkobjects/pscharacter.h,v retrieving revision 1.178 retrieving revision 1.179 diff -C2 -d -r1.178 -r1.179 *** pscharacter.h 15 Jan 2006 18:50:38 -0000 1.178 --- pscharacter.h 15 Jan 2006 21:30:30 -0000 1.179 *************** *** 552,558 **** float MaxCapacity() { return maxSize; } - /// Adjust the current weight level in the inventory. - float AdjustWeight( float delta ) { totalWeight+=delta; return totalWeight; } - /// @return The current weight level of the inventory. float Weight() { return totalWeight; } --- 552,555 ---- *************** *** 718,721 **** --- 715,721 ---- csString lastError; + /// Recalculate total weight, bulk, and count of inventory items. (use when dealing with containers) + void ReassessInventoryDimensions(); + private: /** Places loaded items into the correct locations when loading from database. *************** *** 727,732 **** bool PlaceLoadedItem(const char *location, const char *slot, psItem * & item); - /// Recalculate total weight, bulk, and count of inventory items. (use when dealing with containers) - void ReassessInventoryDimensions(); /// Add the weight, bulk, and count of this item to the totals. void AddDimensionsToInventory(psItem *item); --- 727,730 ---- Index: psitem.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/bulkobjects/psitem.cpp,v retrieving revision 1.151 retrieving revision 1.152 diff -C2 -d -r1.151 -r1.152 *** psitem.cpp 15 Jan 2006 19:16:16 -0000 1.151 --- psitem.cpp 15 Jan 2006 21:30:31 -0000 1.152 *************** *** 1223,1233 **** float psItem::AdjustSumWeight(float delta) { ! sum_weight+=delta; ! if (container_parent!=NULL) container_parent->AdjustSumWeight(delta); ! else if (owning_character!=NULL) ! owning_character->Inventory().AdjustWeight(delta); ! return sum_weight; } --- 1223,1233 ---- float psItem::AdjustSumWeight(float delta) { ! sum_weight += delta; ! if (container_parent != NULL) container_parent->AdjustSumWeight(delta); ! else if (owning_character != NULL && GetIsContainer()) // Top level container in character's inventory ! owning_character->Inventory().ReassessInventoryDimensions(); // Update inventory ! return sum_weight; } |