From 9f539b8c12a30f350e6b243d3df3bb8f8528bc91 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 6 Mar 2011 23:07:04 -0800 Subject: [PATCH] CRLF confusion? --- src/bindings/bindings.c | 73 +++++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 24 deletions(-) diff --git a/src/bindings/bindings.c b/src/bindings/bindings.c index dd30566e3..881e55273 100644 --- a/src/bindings/bindings.c +++ b/src/bindings/bindings.c @@ -967,35 +967,60 @@ static int config_get_resource(lua_State * L) if (itype) { lua_newtable(L); lua_pushstring(L, "weight"); - lua_pushinteger(L, itype->weight); - lua_settable(L, -3); - if (itype->capacity > 0) { + +lua_pushinteger(L, itype->weight); + +lua_settable(L, -3); + +if (itype->capacity > 0) { lua_pushstring(L, "capacity"); - lua_pushinteger(L, itype->capacity); - lua_settable(L, -3); - } - if (itype->construction) { + +lua_pushinteger(L, itype->capacity); + +lua_settable(L, -3); + +} + +if (itype->construction) { int i; lua_pushstring(L, "build_skill_min"); - lua_pushinteger(L, itype->construction->minskill); - lua_settable(L, -3); - lua_pushstring(L, "build_skill_name"); - lua_pushstring(L, skillnames[itype->construction->skill]); - lua_settable(L, -3); - if (itype->construction->materials) { - lua_pushstring(L, "materials"); - lua_newtable(L); - for (i = 0; itype->construction->materials[i].number; ++i) { - lua_pushstring(L, + +lua_pushinteger(L, itype->construction->minskill); + +lua_settable(L, -3); + +lua_pushstring(L, "build_skill_name"); + +lua_pushstring(L, skillnames[itype->construction->skill]); + +lua_settable(L, -3); + + +if (itype->construction->materials) { + +lua_pushstring(L, "materials"); + +lua_newtable(L); + +for (i = 0; itype->construction->materials[i].number; ++i) { + +lua_pushstring(L, itype->construction->materials[i].rtype->_name[0]); - lua_pushinteger(L, itype->construction->materials[i].number); - lua_settable(L, -3); - } - lua_settable(L, -3); - } - } - return 1; + +lua_pushinteger(L, itype->construction->materials[i].number); + +lua_settable(L, -3); + +} + +lua_settable(L, -3); + +} + +} + +return 1; } } return 0;