@@ -150,24 +150,24 @@ int ModApiCraft::l_register_craft(lua_State *L)
150
150
if (type == " shaped" ){
151
151
std::string output = getstringfield_default (L, table, " output" , " " );
152
152
if (output == " " )
153
- throw LuaError (NULL , " Crafting definition is missing an output" );
153
+ throw LuaError (L , " Crafting definition is missing an output" );
154
154
155
155
int width = 0 ;
156
156
std::vector<std::string> recipe;
157
157
lua_getfield (L, table, " recipe" );
158
158
if (lua_isnil (L, -1 ))
159
- throw LuaError (NULL , " Crafting definition is missing a recipe"
159
+ throw LuaError (L , " Crafting definition is missing a recipe"
160
160
" (output=\" " + output + " \" )" );
161
161
if (!readCraftRecipeShaped (L, -1 , width, recipe))
162
- throw LuaError (NULL , " Invalid crafting recipe"
162
+ throw LuaError (L , " Invalid crafting recipe"
163
163
" (output=\" " + output + " \" )" );
164
164
165
165
CraftReplacements replacements;
166
166
lua_getfield (L, table, " replacements" );
167
167
if (!lua_isnil (L, -1 ))
168
168
{
169
169
if (!readCraftReplacements (L, -1 , replacements))
170
- throw LuaError (NULL , " Invalid replacements"
170
+ throw LuaError (L , " Invalid replacements"
171
171
" (output=\" " + output + " \" )" );
172
172
}
173
173
@@ -181,25 +181,25 @@ int ModApiCraft::l_register_craft(lua_State *L)
181
181
else if (type == " shapeless" ){
182
182
std::string output = getstringfield_default (L, table, " output" , " " );
183
183
if (output == " " )
184
- throw LuaError (NULL , " Crafting definition (shapeless)"
184
+ throw LuaError (L , " Crafting definition (shapeless)"
185
185
" is missing an output" );
186
186
187
187
std::vector<std::string> recipe;
188
188
lua_getfield (L, table, " recipe" );
189
189
if (lua_isnil (L, -1 ))
190
- throw LuaError (NULL , " Crafting definition (shapeless)"
190
+ throw LuaError (L , " Crafting definition (shapeless)"
191
191
" is missing a recipe"
192
192
" (output=\" " + output + " \" )" );
193
193
if (!readCraftRecipeShapeless (L, -1 , recipe))
194
- throw LuaError (NULL , " Invalid crafting recipe"
194
+ throw LuaError (L , " Invalid crafting recipe"
195
195
" (output=\" " + output + " \" )" );
196
196
197
197
CraftReplacements replacements;
198
198
lua_getfield (L, table, " replacements" );
199
199
if (!lua_isnil (L, -1 ))
200
200
{
201
201
if (!readCraftReplacements (L, -1 , replacements))
202
- throw LuaError (NULL , " Invalid replacements"
202
+ throw LuaError (L , " Invalid replacements"
203
203
" (output=\" " + output + " \" )" );
204
204
}
205
205
@@ -224,12 +224,12 @@ int ModApiCraft::l_register_craft(lua_State *L)
224
224
else if (type == " cooking" ){
225
225
std::string output = getstringfield_default (L, table, " output" , " " );
226
226
if (output == " " )
227
- throw LuaError (NULL , " Crafting definition (cooking)"
227
+ throw LuaError (L , " Crafting definition (cooking)"
228
228
" is missing an output" );
229
229
230
230
std::string recipe = getstringfield_default (L, table, " recipe" , " " );
231
231
if (recipe == " " )
232
- throw LuaError (NULL , " Crafting definition (cooking)"
232
+ throw LuaError (L , " Crafting definition (cooking)"
233
233
" is missing a recipe"
234
234
" (output=\" " + output + " \" )" );
235
235
@@ -240,7 +240,7 @@ int ModApiCraft::l_register_craft(lua_State *L)
240
240
if (!lua_isnil (L, -1 ))
241
241
{
242
242
if (!readCraftReplacements (L, -1 , replacements))
243
- throw LuaError (NULL , " Invalid replacements"
243
+ throw LuaError (L , " Invalid replacements"
244
244
" (cooking output=\" " + output + " \" )" );
245
245
}
246
246
@@ -254,7 +254,7 @@ int ModApiCraft::l_register_craft(lua_State *L)
254
254
else if (type == " fuel" ){
255
255
std::string recipe = getstringfield_default (L, table, " recipe" , " " );
256
256
if (recipe == " " )
257
- throw LuaError (NULL , " Crafting definition (fuel)"
257
+ throw LuaError (L , " Crafting definition (fuel)"
258
258
" is missing a recipe" );
259
259
260
260
float burntime = getfloatfield_default (L, table, " burntime" , 1.0 );
@@ -264,7 +264,7 @@ int ModApiCraft::l_register_craft(lua_State *L)
264
264
if (!lua_isnil (L, -1 ))
265
265
{
266
266
if (!readCraftReplacements (L, -1 , replacements))
267
- throw LuaError (NULL , " Invalid replacements"
267
+ throw LuaError (L , " Invalid replacements"
268
268
" (fuel recipe=\" " + recipe + " \" )" );
269
269
}
270
270
@@ -274,7 +274,7 @@ int ModApiCraft::l_register_craft(lua_State *L)
274
274
}
275
275
else
276
276
{
277
- throw LuaError (NULL , " Unknown crafting definition type: \" " + type + " \" " );
277
+ throw LuaError (L , " Unknown crafting definition type: \" " + type + " \" " );
278
278
}
279
279
280
280
lua_pop (L, 1 );
0 commit comments