View Issue Details

IDProjectCategoryView StatusLast Update
0003316The Dark ModCodingpublic27.02.2013 00:01
ReporterZbyl Assigned Tograyman  
PrioritynormalSeveritynormalReproducibilityalways
Status resolvedResolutionfixed 
Product VersionSVN 
Target VersionTDM 2.00Fixed in VersionTDM 2.00 
Summary0003316: Pickup messages for stackable objects do not include count information.
DescriptionPicking up for example 5 keys does not inform about the number of keys picked up.
The reason for this is twofold: bug in code in one place and oversight in another.
Additional InformationPatch is included.
TagsNo tags attached.

Activities

Zbyl

Zbyl

10.02.2013 01:42

reporter  

stackable.patch (1,028 bytes)   
Index: game/Inventory/Inventory.cpp
===================================================================
--- game/Inventory/Inventory.cpp	(revision 5694)
+++ game/Inventory/Inventory.cpp	(working copy)
@@ -619,9 +619,9 @@ CInventoryItemPtr CInventory::PutItem(idEntity *ent, idEntity *owner)
 		{
 			idStr msg = common->Translate( name );
 
-			if (count > 0) 
+			if (count > 1) 
 			{
-				name += " x" + idStr(count);
+				msg += " x" + idStr(count);
 			}
 
 			NotifyOwnerAboutPickup(msg, existing);
@@ -653,7 +653,14 @@ CInventoryItemPtr CInventory::PutItem(idEntity *ent, idEntity *owner)
 
 			if (!ent->spawnArgs.GetBool("inv_map_start", "0") && !ent->spawnArgs.GetBool("inv_no_pickup_message", "0"))
 			{
-				NotifyOwnerAboutPickup( common->Translate( name ), item);
+				idStr msg = common->Translate( name );
+
+				if (item->GetCount() > 1) 
+				{
+					msg += " x" + idStr(item->GetCount());
+				}
+
+				NotifyOwnerAboutPickup(msg, item);
 			}
 
 			// Hide the entity from the map (don't delete the entity)
stackable.patch (1,028 bytes)   
grayman

grayman

27.02.2013 00:01

administrator   ~0005115

Zbyl contributed corrected code for showing item counts in the pickup message.

rev. 5704:

Inventory.cpp

Issue History

Date Modified Username Field Change
10.02.2013 01:42 Zbyl New Issue
10.02.2013 01:42 Zbyl File Added: stackable.patch
27.02.2013 00:00 grayman Assigned To => grayman
27.02.2013 00:00 grayman Status new => assigned
27.02.2013 00:01 grayman Note Added: 0005115
27.02.2013 00:01 grayman Status assigned => resolved
27.02.2013 00:01 grayman Resolution open => fixed
27.02.2013 00:01 grayman Fixed in Version => TDM 2.00
27.02.2013 00:01 grayman Target Version => TDM 2.00