mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-02-20 17:14:44 +01:00
-Removed the fail cond from Bag::get_item.
-Removed the bag include from item template.
This commit is contained in:
parent
f337ab57c4
commit
a4554f5bf7
@ -3,7 +3,6 @@
|
||||
#include "item_instance.h"
|
||||
#include "aura.h"
|
||||
#include "spell.h"
|
||||
#include "../inventory/bag.h"
|
||||
|
||||
int ItemTemplate::get_id() const {
|
||||
return _id;
|
||||
|
@ -13,7 +13,6 @@
|
||||
class ItemInstance;
|
||||
class Aura;
|
||||
class Spell;
|
||||
class Bag;
|
||||
|
||||
class ItemTemplate : public Resource {
|
||||
GDCLASS(ItemTemplate, Resource);
|
||||
|
@ -80,7 +80,9 @@ Ref<ItemInstance> Bag::get_item(const int index) {
|
||||
return call("_get_item", index);
|
||||
}
|
||||
|
||||
ERR_FAIL_INDEX_V(index, _items.size(), Ref<ItemInstance>());
|
||||
if (index >= _items.size()) {
|
||||
return Ref<ItemInstance>();
|
||||
}
|
||||
|
||||
return _items.get(index);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user