summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_craft.cpp
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2014-03-15 16:28:59 -0400
committerShadowNinja <shadowninja@minetest.net>2014-03-15 16:28:59 -0400
commit31fe72dbac3d53e8da21ef116ccf99febbc5196e (patch)
tree2a040621c7ee34a67a09f50e7fe19bf9b6c34c90 /src/script/lua_api/l_craft.cpp
parentf8b75555586e0e67d8320a804b9e077d29b96403 (diff)
downloadminetest-31fe72dbac3d53e8da21ef116ccf99febbc5196e.tar.gz
minetest-31fe72dbac3d53e8da21ef116ccf99febbc5196e.tar.bz2
minetest-31fe72dbac3d53e8da21ef116ccf99febbc5196e.zip
Remove lua_State parameter from LuaError::LuaError
Diffstat (limited to 'src/script/lua_api/l_craft.cpp')
-rw-r--r--src/script/lua_api/l_craft.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/script/lua_api/l_craft.cpp b/src/script/lua_api/l_craft.cpp
index aaca84c56..8f8efbfbc 100644
--- a/src/script/lua_api/l_craft.cpp
+++ b/src/script/lua_api/l_craft.cpp
@@ -150,16 +150,16 @@ int ModApiCraft::l_register_craft(lua_State *L)
if(type == "shaped"){
std::string output = getstringfield_default(L, table, "output", "");
if(output == "")
- throw LuaError(NULL, "Crafting definition is missing an output");
+ throw LuaError("Crafting definition is missing an output");
int width = 0;
std::vector<std::string> recipe;
lua_getfield(L, table, "recipe");
if(lua_isnil(L, -1))
- throw LuaError(NULL, "Crafting definition is missing a recipe"
+ throw LuaError("Crafting definition is missing a recipe"
" (output=\"" + output + "\")");
if(!readCraftRecipeShaped(L, -1, width, recipe))
- throw LuaError(NULL, "Invalid crafting recipe"
+ throw LuaError("Invalid crafting recipe"
" (output=\"" + output + "\")");
CraftReplacements replacements;
@@ -167,7 +167,7 @@ int ModApiCraft::l_register_craft(lua_State *L)
if(!lua_isnil(L, -1))
{
if(!readCraftReplacements(L, -1, replacements))
- throw LuaError(NULL, "Invalid replacements"
+ throw LuaError("Invalid replacements"
" (output=\"" + output + "\")");
}
@@ -181,17 +181,17 @@ int ModApiCraft::l_register_craft(lua_State *L)
else if(type == "shapeless"){
std::string output = getstringfield_default(L, table, "output", "");
if(output == "")
- throw LuaError(NULL, "Crafting definition (shapeless)"
+ throw LuaError("Crafting definition (shapeless)"
" is missing an output");
std::vector<std::string> recipe;
lua_getfield(L, table, "recipe");
if(lua_isnil(L, -1))
- throw LuaError(NULL, "Crafting definition (shapeless)"
+ throw LuaError("Crafting definition (shapeless)"
" is missing a recipe"
" (output=\"" + output + "\")");
if(!readCraftRecipeShapeless(L, -1, recipe))
- throw LuaError(NULL, "Invalid crafting recipe"
+ throw LuaError("Invalid crafting recipe"
" (output=\"" + output + "\")");
CraftReplacements replacements;
@@ -199,7 +199,7 @@ int ModApiCraft::l_register_craft(lua_State *L)
if(!lua_isnil(L, -1))
{
if(!readCraftReplacements(L, -1, replacements))
- throw LuaError(NULL, "Invalid replacements"
+ throw LuaError("Invalid replacements"
" (output=\"" + output + "\")");
}
@@ -224,12 +224,12 @@ int ModApiCraft::l_register_craft(lua_State *L)
else if(type == "cooking"){
std::string output = getstringfield_default(L, table, "output", "");
if(output == "")
- throw LuaError(NULL, "Crafting definition (cooking)"
+ throw LuaError("Crafting definition (cooking)"
" is missing an output");
std::string recipe = getstringfield_default(L, table, "recipe", "");
if(recipe == "")
- throw LuaError(NULL, "Crafting definition (cooking)"
+ throw LuaError("Crafting definition (cooking)"
" is missing a recipe"
" (output=\"" + output + "\")");
@@ -240,7 +240,7 @@ int ModApiCraft::l_register_craft(lua_State *L)
if(!lua_isnil(L, -1))
{
if(!readCraftReplacements(L, -1, replacements))
- throw LuaError(NULL, "Invalid replacements"
+ throw LuaError("Invalid replacements"
" (cooking output=\"" + output + "\")");
}
@@ -254,7 +254,7 @@ int ModApiCraft::l_register_craft(lua_State *L)
else if(type == "fuel"){
std::string recipe = getstringfield_default(L, table, "recipe", "");
if(recipe == "")
- throw LuaError(NULL, "Crafting definition (fuel)"
+ throw LuaError("Crafting definition (fuel)"
" is missing a recipe");
float burntime = getfloatfield_default(L, table, "burntime", 1.0);
@@ -264,7 +264,7 @@ int ModApiCraft::l_register_craft(lua_State *L)
if(!lua_isnil(L, -1))
{
if(!readCraftReplacements(L, -1, replacements))
- throw LuaError(NULL, "Invalid replacements"
+ throw LuaError("Invalid replacements"
" (fuel recipe=\"" + recipe + "\")");
}
@@ -274,7 +274,7 @@ int ModApiCraft::l_register_craft(lua_State *L)
}
else
{
- throw LuaError(NULL, "Unknown crafting definition type: \"" + type + "\"");
+ throw LuaError("Unknown crafting definition type: \"" + type + "\"");
}
lua_pop(L, 1);