summaryrefslogtreecommitdiffstats
path: root/src/CraftingRecipes.cpp
diff options
context:
space:
mode:
authorPeter Bell <peterbell10@live.co.uk>2020-05-09 17:51:54 +0200
committerpeterbell10 <peterbell10@live.co.uk>2020-05-09 21:37:16 +0200
commit1123c95cf2efdcb23ff557b956d58538ca24aefe (patch)
treee8f39c2519ad06afc4f52d8fbc1d8fb334aeea42 /src/CraftingRecipes.cpp
parentUpdate submodules (#4727) (diff)
downloadcuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar
cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.gz
cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.bz2
cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.lz
cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.xz
cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.zst
cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.zip
Diffstat (limited to 'src/CraftingRecipes.cpp')
-rw-r--r--src/CraftingRecipes.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/CraftingRecipes.cpp b/src/CraftingRecipes.cpp
index 1a8a68523..fc0ce92f1 100644
--- a/src/CraftingRecipes.cpp
+++ b/src/CraftingRecipes.cpp
@@ -18,7 +18,7 @@
cCraftingGrid::cCraftingGrid(int a_Width, int a_Height) :
m_Width(a_Width),
m_Height(a_Height),
- m_Items(new cItem[a_Width * a_Height])
+ m_Items(new cItem[ToUnsigned(a_Width * a_Height)])
{
}
@@ -27,9 +27,7 @@ cCraftingGrid::cCraftingGrid(int a_Width, int a_Height) :
cCraftingGrid::cCraftingGrid(const cItem * a_Items, int a_Width, int a_Height) :
- m_Width(a_Width),
- m_Height(a_Height),
- m_Items(new cItem[a_Width * a_Height])
+ cCraftingGrid(a_Width, a_Height)
{
for (int i = a_Width * a_Height - 1; i >= 0; i--)
{
@@ -42,9 +40,7 @@ cCraftingGrid::cCraftingGrid(const cItem * a_Items, int a_Width, int a_Height) :
cCraftingGrid::cCraftingGrid(const cCraftingGrid & a_Original) :
- m_Width(a_Original.m_Width),
- m_Height(a_Original.m_Height),
- m_Items(new cItem[a_Original.m_Width * a_Original.m_Height])
+ cCraftingGrid(a_Original.m_Width, a_Original.m_Height)
{
for (int i = m_Width * m_Height - 1; i >= 0; i--)
{