diff options
author | KingCol13 <48412633+KingCol13@users.noreply.github.com> | 2020-09-28 14:41:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-28 14:41:49 +0200 |
commit | 8eca58a1c9d3ea928b301de1ad772a46164372e1 (patch) | |
tree | 9627cfb9c43ed9b332a493c474e7ebe119543b89 /src/Item.h | |
parent | Enchanting consumes lapis, removes correct number of levels (#4934) (diff) | |
download | cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.gz cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.bz2 cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.lz cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.xz cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.zst cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.zip |
Diffstat (limited to 'src/Item.h')
-rw-r--r-- | src/Item.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Item.h b/src/Item.h index 2f7b1a238..d3f853170 100644 --- a/src/Item.h +++ b/src/Item.h @@ -230,6 +230,8 @@ public: cItem * Get (int a_Idx); void Set (int a_Idx, const cItem & a_Item); void Add (const cItem & a_Item) {push_back(a_Item); } + void Add (short a_ItemType) { emplace_back(a_ItemType); } + void Add (short a_ItemType, char a_ItemCount) { emplace_back(a_ItemType, a_ItemCount); } void Delete(int a_Idx); void Clear (void) {clear(); } size_t Size (void) const { return size(); } @@ -239,7 +241,7 @@ public: void Add (short a_ItemType, char a_ItemCount, short a_ItemDamage) { - push_back(cItem(a_ItemType, a_ItemCount, a_ItemDamage)); + emplace_back(a_ItemType, a_ItemCount, a_ItemDamage); } /** Adds a copy of all items in a_ItemGrid. */ |