diff options
Diffstat (limited to 'src/CraftingRecipes.cpp')
-rw-r--r-- | src/CraftingRecipes.cpp | 10 |
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--) { |