CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.42k stars 4.15k forks source link

Items with relic_data don't stack #45542

Closed MikuMiddo closed 3 years ago

MikuMiddo commented 3 years ago

Describe the bug

Usually,the completly same item(same attributes) will stack together to save the looking-space of invertory. but now,if the item has a relic_data,It will be showen one by one in your invertory,even if they have the same attributes

If you have 20 strenght-ring in your pockets,in the past,it will show '20 strenght-rings'in one line,but now,it will show 'strenght-ring' for 20 lines,it makes the invertory menu ugly and hard to use.

Steps To Reproduce

1.debug for 30 strenght-ring(with Magiclysm mod) 2.open [i]nvertory menu.

Expected behavior

They should stack together again.

Screenshots

image

Versions and configuration

Additional context

anothersimulacrum commented 3 years ago

The is_relic() check below should probably be replaced with is_relic() && *relic_data == *rhs.relic_data (or equivalent). The relic datum might need an equality operator or other way to check equality implemented. https://github.com/CleverRaven/Cataclysm-DDA/blob/d4a0263c47860e87a298b9d0ae7eed3c7b6a2646/src/item.cpp#L943-L951

(C.C. @KorGgenT if this solution sounds correct)

KorGgenT commented 3 years ago

i agree. possibly we want items that have relic charges to still not stack, but i can also see a reason to have them still stack

Fris0uman commented 3 years ago

Yeah i just put the is_relic() check because I though relic were unique.

Maleclypse commented 3 years ago

I know that previously when they stacked it caused the procedurally generated relics once stacked to be identical in effects.