mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-30 21:09:19 +01:00
Also check if the item's template is valid in Bag::add_item.
This commit is contained in:
parent
d3f5ed6511
commit
32acbf4252
@ -35,6 +35,7 @@ void Bag::set_allowed_item_types(const int value) {
|
||||
|
||||
bool Bag::add_item(Ref<ItemInstance> item) {
|
||||
ERR_FAIL_COND_V(!item.is_valid(), false);
|
||||
ERR_FAIL_COND_V(!item->get_item_template().is_valid(), false);
|
||||
|
||||
if (has_method("_add_item")) {
|
||||
return call("_add_item", item);
|
||||
|
Loading…
Reference in New Issue
Block a user