View Issue Details

IDProjectCategoryView StatusLast Update
0003315The Dark ModCodingpublic18.02.2013 21:42
ReporterZbyl Assigned Tograyman  
PrioritynormalSeveritynormalReproducibilityalways
Status resolvedResolutionfixed 
Product VersionSVN 
Target VersionTDM 2.00Fixed in VersionTDM 2.00 
Summary0003315: Second identical item pickpocketed does not count to "Pockets picked" statistic
DescriptionIf we pickpocket second identical stackable item, then this item does not count to "pockets picked" statistic.
Steps To ReproduceSee steps to reproduce for 0003313: "Picked pockets are counted twice"
Additional InformationThe reason for this is that once the item is pickpocketted it's unbound from it's bindMaster.
If we pickpocket the second identical stackable item, then the item already in the inventory is queried for bindMaster, and not the new one.

Here's the code from CInventory::PutItem(idEntity * ent, idEntity * owner):

gameLocal.m_MissionData->InventoryCallback(
            existing->GetItemEntity(), // <-- old, unbound entity used!
            existing->GetName(),
            existing->GetCount(),
            1,
            true
        );
TagsNo tags attached.

Activities

Zbyl

Zbyl

10.02.2013 01:46

reporter  

3315.patch (640 bytes)   
Index: game/Inventory/Inventory.cpp
===================================================================
--- game/Inventory/Inventory.cpp	(revision 5694)
+++ game/Inventory/Inventory.cpp	(working copy)
@@ -607,7 +607,8 @@ CInventoryItemPtr CInventory::PutItem(idEntity *ent, idEntity *owner)
 
 		// We added a stackable item that was already in the inventory
 		gameLocal.m_MissionData->InventoryCallback(
-			existing->GetItemEntity(), existing->GetName(), 
+			ent, // use currently added entity, not the previously added "identical" existing->GetItemEntity() (#3315)
+			existing->GetName(), 
 			existing->GetCount(), 
 			1, 
 			true
3315.patch (640 bytes)   
Zbyl

Zbyl

10.02.2013 01:49

reporter   ~0005061

Attached a patch that fixes this problem by passing currently picked up entity to the InventoryCallback() (instead of the one already in the inventory).
grayman

grayman

18.02.2013 21:42

administrator   ~0005077

Applied solution from Zbyl to check the new item for its bindmaster instead of the existing item already in inventory, which already had its bindmaster NULLed.

rev. 5698:

Inventory.cpp

Issue History

Date Modified Username Field Change
10.02.2013 01:01 Zbyl New Issue
10.02.2013 01:46 Zbyl File Added: 3315.patch
10.02.2013 01:49 Zbyl Note Added: 0005061
18.02.2013 21:42 grayman Note Added: 0005077
18.02.2013 21:42 grayman Assigned To => grayman
18.02.2013 21:42 grayman Status new => resolved
18.02.2013 21:42 grayman Resolution open => fixed
18.02.2013 21:42 grayman Fixed in Version => TDM 2.00
18.02.2013 21:42 grayman Target Version => TDM 2.00