Merge branch '1097_fix_element_cloning' into 'master'

1097_fix_element_when_revid_is_updated_or_stat_data_is_cloned

Closes #1097

See merge request phoenix-dvpmt/mmoitems!73
This commit is contained in:
Jules 2023-04-15 19:21:27 +00:00
commit 03a49d0589

View File

@ -41,7 +41,13 @@ public class ElementListData implements Mergeable {
@Override
public StatData cloneData() {
ElementListData ret = new ElementListData();
stats.forEach((key, value) -> ret.stats.put(key, value));
for (Map.Entry<Pair<Element, ElementStatType>, Double> entry : stats.entrySet()) {
Pair<Element, ElementStatType> key = entry.getKey();
Double value = entry.getValue();
if (value != 0) {
ret.stats.put(key, value);
}
}
return ret;
}