projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0ae75f2
)
Fix minetest.get_craft_recipe function
author
est31
<MTest31@outlook.com>
Mon, 23 Mar 2015 01:38:53 +0000
(
02:38
+0100)
committer
Craig Robbins
<kde.psych@gmail.com>
Mon, 23 Mar 2015 03:40:20 +0000
(13:40 +1000)
Previously, calling it resulted in a crash.
src/script/lua_api/l_craft.cpp
patch
|
blob
|
history
diff --git
a/src/script/lua_api/l_craft.cpp
b/src/script/lua_api/l_craft.cpp
index 40342871dc76e08e26319e760c81f16875a7e276..b321fb32f77daed8d271a1d6a3116ab38b737cf8 100644
(file)
--- a/
src/script/lua_api/l_craft.cpp
+++ b/
src/script/lua_api/l_craft.cpp
@@
-393,6
+393,8
@@
int ModApiCraft::l_get_craft_recipe(lua_State *L)
std::vector<CraftDefinition*> recipes = server->cdef()
->getCraftRecipes(output, server, 1);
+ lua_createtable(L, 1, 0);
+
if (recipes.empty()) {
lua_pushnil(L);
lua_setfield(L, -2, "items");