From: <mg...@us...> - 2007-10-24 15:41:45
|
Revision: 102 http://planeshift.svn.sourceforge.net/planeshift/?rev=102&view=rev Author: mgist Date: 2007-10-24 08:41:49 -0700 (Wed, 24 Oct 2007) Log Message: ----------- - Merged r99:101 Modified Paths: -------------- stable/docs/history.txt stable/src/server/bulkobjects/pscharacter.cpp stable/src/server/client.cpp stable/src/server/gem.cpp stable/src/server/slotmanager.cpp stable/src/server/workmanager.cpp Modified: stable/docs/history.txt =================================================================== --- stable/docs/history.txt 2007-10-24 15:35:13 UTC (rev 101) +++ stable/docs/history.txt 2007-10-24 15:41:49 UTC (rev 102) @@ -1,3 +1,12 @@ +*** 2007-10-24 by Sasha Levin +- Fixed crash in MoveFromInventory. +- GM2+ can now pick up any PC guarded items. +- Added guarding for items in sacks too. +- Public containers now also have the 5m guard limit. If you walk from your furnace, Your + items are free for all! +- Interrupting repair work wasn't resetting the repaired item in-use status. Makes the + repaired item 'stick' in your hand. Fixed. + *** 2007-10-23 by Michael Gist - Increased MAXQUEUESIZE to 20000. Modified: stable/src/server/bulkobjects/pscharacter.cpp =================================================================== --- stable/src/server/bulkobjects/pscharacter.cpp 2007-10-24 15:35:13 UTC (rev 101) +++ stable/src/server/bulkobjects/pscharacter.cpp 2007-10-24 15:41:49 UTC (rev 102) @@ -1322,7 +1322,7 @@ Error2("Cannot add item into container slot %zu.\n", slot); return; } - item->SetGuardingCharacterID(item->GetOwningCharacterID()); + item->SetGuardingCharacterID(GetCharacterID()); i--; // indexes shift when we remove one. item->Save(false); } Modified: stable/src/server/client.cpp =================================================================== --- stable/src/server/client.cpp 2007-10-24 15:35:13 UTC (rev 101) +++ stable/src/server/client.cpp 2007-10-24 15:41:49 UTC (rev 102) @@ -495,16 +495,29 @@ return false; } } + // Allow if the item is pickupable and either: public, guarded by the character, or the guarding character is offline unsigned int guard = item->GetGuardingCharacterID(); + gemActor* guardingActor = GEMSupervisor::GetSingleton().FindPlayerEntity(guard); + if ((guard == 0 || guard == GetCharacterData()->GetCharacterID() || - !GEMSupervisor::GetSingleton().FindPlayerEntity(guard) - ) + !guardingActor + ) && !item->GetIsNpcOwned() && !item->GetIsNoPickup() ) return true; + if (guard && guardingActor) + { + gemItem* gemitem = item->GetGemObject(); + if (item->GetContainerID()) + gemitem = GEMSupervisor::GetSingleton().FindItemEntity(item->GetContainerID()); + if (gemitem && + guardingActor->RangeTo(gemitem) > 5) + return true; + } + // Allow GM2s to take any PC-owned stuff if (GetSecurityLevel() >= 22 && !item->GetIsNpcOwned() && !item->GetIsNoPickup()) return true; Modified: stable/src/server/gem.cpp =================================================================== --- stable/src/server/gem.cpp 2007-10-24 15:35:13 UTC (rev 101) +++ stable/src/server/gem.cpp 2007-10-24 15:41:49 UTC (rev 102) @@ -1307,22 +1307,20 @@ psItem* item = GetItem(); - unsigned int guard = item->GetGuardingCharacterID(); - gemActor* guardActor = GEMSupervisor::GetSingleton().FindPlayerEntity(guard); - if (guard && - guard != actor->GetCharacterData()->GetCharacterID() && - guardActor && - guardActor->RangeTo(item->GetGemObject()) < 5) + if (actor->GetClient()->GetSecurityLevel() < GM_LEVEL_2) { - if (guardActor) + unsigned int guard = item->GetGuardingCharacterID(); + gemActor* guardActor = GEMSupervisor::GetSingleton().FindPlayerEntity(guard); + if (guard && + guard != actor->GetCharacterData()->GetCharacterID() && + guardActor && + guardActor->RangeTo(item->GetGemObject()) < 5) { psserver->SendSystemInfo(clientnum,"You notice that the item is being guarded by %s", guardActor->GetCharacterData()->GetCharFullName()); - } - else - psserver->SendSystemInfo(clientnum,"You notice that the item is being guarded"); - return; + return; + } } item->ScheduleRespawn(); Modified: stable/src/server/slotmanager.cpp =================================================================== --- stable/src/server/slotmanager.cpp 2007-10-24 15:35:13 UTC (rev 101) +++ stable/src/server/slotmanager.cpp 2007-10-24 15:41:49 UTC (rev 102) @@ -552,6 +552,12 @@ // easy case is to stack compatible items chr->Inventory().SetLockEncumbranceState(true); psItem *stack = chr->Inventory().RemoveItem(NULL, srcSlot, msg.stackCount); + if (!stack) + { + chr->Inventory().SetLockEncumbranceState(false); + return; + } + item->CombineStack(stack); item->Save(false); chr->Inventory().SetLockEncumbranceState(false); Modified: stable/src/server/workmanager.cpp =================================================================== --- stable/src/server/workmanager.cpp 2007-10-24 15:35:13 UTC (rev 101) +++ stable/src/server/workmanager.cpp 2007-10-24 15:41:49 UTC (rev 102) @@ -3489,7 +3489,13 @@ // Stop event from being executed when triggered. if(category == REPAIR && client->GetActor() && (client->GetActor()->GetMode() == PSCHARACTER_MODE_WORK)) + { client->GetActor()->SetMode(PSCHARACTER_MODE_PEACE); + + psItem *repairTarget = client->GetCharacterData()->Inventory().GetInventoryItem(PSCHARACTER_SLOT_RIGHTHAND); + if (repairTarget) + repairTarget->SetInUse(false); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |