summaryrefslogtreecommitdiffstats
path: root/src/FurnaceRecipe.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-08-31 22:04:52 +0200
committerHowaner <franzi.moos@googlemail.com>2014-08-31 22:04:52 +0200
commitaf125d2a61096c6eef97d86bc815196c8d5275de (patch)
treef3fec9187005ec3f86fbd6f6a7c1b3e5ce3ed153 /src/FurnaceRecipe.cpp
parentFixed compile warnings. (diff)
downloadcuberite-af125d2a61096c6eef97d86bc815196c8d5275de.tar
cuberite-af125d2a61096c6eef97d86bc815196c8d5275de.tar.gz
cuberite-af125d2a61096c6eef97d86bc815196c8d5275de.tar.bz2
cuberite-af125d2a61096c6eef97d86bc815196c8d5275de.tar.lz
cuberite-af125d2a61096c6eef97d86bc815196c8d5275de.tar.xz
cuberite-af125d2a61096c6eef97d86bc815196c8d5275de.tar.zst
cuberite-af125d2a61096c6eef97d86bc815196c8d5275de.zip
Diffstat (limited to '')
-rw-r--r--src/FurnaceRecipe.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/FurnaceRecipe.cpp b/src/FurnaceRecipe.cpp
index eec76fa4a..d200ef3d7 100644
--- a/src/FurnaceRecipe.cpp
+++ b/src/FurnaceRecipe.cpp
@@ -115,7 +115,7 @@ void cFurnaceRecipe::AddFuelFromLine(const AString & a_Line, unsigned int a_Line
Line.erase(Line.begin()); // Remove the beginning "!"
Line.erase(std::remove_if(Line.begin(), Line.end(), isspace), Line.end());
- cItem * Item = new cItem();
+ std::auto_ptr<cItem> Item(new cItem);
int BurnTime;
const AStringVector & Sides = StringSplit(Line, "=");
@@ -142,7 +142,7 @@ void cFurnaceRecipe::AddFuelFromLine(const AString & a_Line, unsigned int a_Line
// Add to fuel list:
cFuel Fuel;
- Fuel.In = Item;
+ Fuel.In = Item.release();
Fuel.BurnTime = BurnTime;
m_pState->Fuel.push_back(Fuel);
}
@@ -157,8 +157,8 @@ void cFurnaceRecipe::AddRecipeFromLine(const AString & a_Line, unsigned int a_Li
Line.erase(std::remove_if(Line.begin(), Line.end(), isspace), Line.end());
int CookTime = 200;
- cItem * InputItem = new cItem();
- cItem * OutputItem = new cItem();
+ std::auto_ptr<cItem> InputItem(new cItem());
+ std::auto_ptr<cItem> OutputItem(new cItem());
const AStringVector & Sides = StringSplit(Line, "=");
if (Sides.size() != 2)
@@ -194,8 +194,8 @@ void cFurnaceRecipe::AddRecipeFromLine(const AString & a_Line, unsigned int a_Li
}
cRecipe Recipe;
- Recipe.In = InputItem;
- Recipe.Out = OutputItem;
+ Recipe.In = InputItem.release();
+ Recipe.Out = OutputItem.release();
Recipe.CookTime = CookTime;
m_pState->Recipes.push_back(Recipe);
}