Remove delayed consumption when switching types (#5949)

* Fixes #5937.
* Removed the delayed consumption flag when switching item types.
Thanks to @mazvi!
This commit is contained in:
Aleos 2021-05-19 09:46:49 -04:00 committed by GitHub
parent 8fc0ab44cd
commit ec91884ca6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,6 +102,8 @@ uint64 ItemDatabase::parseBodyNode(const YAML::Node &node) {
if (constant == IT_DELAYCONSUME) { // Items that are consumed only after target confirmation
constant = IT_USABLE;
item->flag.delay_consume |= DELAYCONSUME_TEMP;
} else {
item->flag.delay_consume &= ~DELAYCONSUME_TEMP; // Remove delayed consumption flag if switching types
}
item->type = static_cast<item_types>(constant);