From: <ko...@us...> - 2009-02-19 08:45:30
|
Revision: 3059 http://planeshift.svn.sourceforge.net/planeshift/?rev=3059&view=rev Author: kougaro Date: 2009-02-19 08:45:25 +0000 (Thu, 19 Feb 2009) Log Message: ----------- Improved fix for PS#2579, addition of a target word for the /drop command, and a few comments in messages.h Modified Paths: -------------- trunk/src/client/cmdusers.cpp trunk/src/common/net/messages.h trunk/src/server/bulkobjects/pscharinventory.cpp Modified: trunk/src/client/cmdusers.cpp =================================================================== --- trunk/src/client/cmdusers.cpp 2009-02-19 05:43:30 UTC (rev 3058) +++ trunk/src/client/cmdusers.cpp 2009-02-19 08:45:25 UTC (rev 3059) @@ -337,7 +337,8 @@ GEMClientObject *object = NULL; // if the command's target is not precised, get the object currently targeted - if (words[1] == "x" || words[1] == "y" || words[1] == "z" || words[1] == "reset" || atoi(words[1])) + if (words[1] == "x" || words[1] == "y" || words[1] == "z" || + words[1] == "reset" || words[1]=="target" || atoi(words[1])) object = psengine->GetCharManager()->GetTarget(); else object = FindEntityWithName(words[1]); @@ -734,7 +735,9 @@ unsigned int i = 1; - if (quantity = atoi(words[1])) + // if the first word is a number, use that for quantity + quantity = atoi(words[1]); + if (quantity) { i++; } Modified: trunk/src/common/net/messages.h =================================================================== --- trunk/src/common/net/messages.h 2009-02-19 05:43:30 UTC (rev 3058) +++ trunk/src/common/net/messages.h 2009-02-19 08:45:25 UTC (rev 3059) @@ -985,6 +985,8 @@ virtual csString ToString(AccessPointers * access_ptrs); }; +//-------------------------------------------------------------------------- + /** * Guild commands sent from client to server. */ @@ -1104,7 +1106,12 @@ virtual csString ToString(AccessPointers * access_ptrs); }; +//-------------------------------------------------------------------------- +/** + * User commands. + * Those are processed by UserManager + */ class psUserCmdMessage : public psMessageCracker { public: @@ -1127,6 +1134,12 @@ virtual csString ToString(AccessPointers * access_ptrs); }; +//-------------------------------------------------------------------------- + +/** + * Work commands. + * Those are processed by WorkManager + */ class psWorkCmdMessage : public psMessageCracker { public: @@ -1150,6 +1163,12 @@ virtual csString ToString(AccessPointers * access_ptrs); }; +//-------------------------------------------------------------------------- + +/** + * Admin commands. + * Those are processed by AdminManager + */ class psAdminCmdMessage : public psMessageCracker { public: @@ -1171,6 +1190,8 @@ virtual csString ToString(AccessPointers * access_ptrs); }; +//-------------------------------------------------------------------------- + class psDisconnectMessage : public psMessageCracker { public: @@ -1191,6 +1212,8 @@ virtual csString ToString(AccessPointers * access_ptrs); }; +//-------------------------------------------------------------------------- + class psUserActionMessage : public psMessageCracker { public: @@ -1267,6 +1290,7 @@ uint32_t options; }; +//-------------------------------------------------------------------------- /** * Messages that are sent to/from the ActionManager @@ -1682,7 +1706,6 @@ csString xml; }; - //--------------------------------------------------------------------------- /// Indicates that an OverrideAction is being done and not a loop as covered in DR msgs. @@ -3900,6 +3923,7 @@ int containerID; }; +//-------------------------------------------------------------------------- class psQuestRewardMessage : public psMessageCracker { @@ -3939,6 +3963,8 @@ csString newValue; }; +//-------------------------------------------------------------------------- + class psExchangeMoneyMsg : public psMessageCracker { public: Modified: trunk/src/server/bulkobjects/pscharinventory.cpp =================================================================== --- trunk/src/server/bulkobjects/pscharinventory.cpp 2009-02-19 05:43:30 UTC (rev 3058) +++ trunk/src/server/bulkobjects/pscharinventory.cpp 2009-02-19 08:45:25 UTC (rev 3059) @@ -422,6 +422,9 @@ CS_ASSERT(proposedSlot != PSCHARACTER_SLOT_NONE); CS_ASSERT(item != NULL); // attempting either is probably bad + if(proposedSlot < PSCHARACTER_SLOT_NONE) + return false; + if (stackCount == 0) stackCount = item->GetStackCount(); @@ -473,7 +476,7 @@ } } - return false; + return true; } bool psCharacterInventory::EquipItem(psItem *item, INVENTORY_SLOT_NUMBER slot) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |