From 866abcc92cbb960ef2cb837ed54c634de94f7dfa Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 9 Dec 2017 16:53:36 +0100 Subject: [PATCH] remove obsolete defines. --- src/bind_unit.c | 35 ----------------------------------- src/study.h | 2 -- 2 files changed, 37 deletions(-) diff --git a/src/bind_unit.c b/src/bind_unit.c index 879af57ec..a7e8f61ab 100644 --- a/src/bind_unit.c +++ b/src/bind_unit.c @@ -763,38 +763,6 @@ static int tolua_unit_get_spells(lua_State * L) return tolua_selist_push(L, "spellbook", "spell_entry", slist); } -#ifdef TOLUA_ORDERS_CLOSURE -/* TODO: this requires that the locale for write_order is included in the closure */ -static int tolua_orderlist_next(lua_State * L) -{ - order **order_ptr = (order **)lua_touserdata(L, lua_upvalueindex(1)); - order *ord = *order_ptr; - if (ord != NULL) { - char cmd[8192]; - write_order(ord, cmd, sizeof(cmd)); - tolua_pushstring(L, cmd); - *order_ptr = ord->next; - return 1; - } - return 0; -} - -static int tolua_unit_get_orders(lua_State * L) -{ - unit *self = (unit *)tolua_tousertype(L, 1, 0); - - order **order_ptr = (order **)lua_newuserdata(L, sizeof(order *)); - - luaL_getmetatable(L, TOLUA_CAST "order"); - lua_setmetatable(L, -2); - - *order_ptr = self->orders; - - lua_pushcclosure(L, tolua_orderlist_next, 1); - - return 1; -} -#endif static int tolua_unit_get_curse(lua_State *L) { unit *self = (unit *)tolua_tousertype(L, 1, 0); const char *name = tolua_tostring(L, 2, 0); @@ -1006,9 +974,6 @@ void tolua_unit_open(lua_State * L) tolua_function(L, TOLUA_CAST "add_order", tolua_unit_add_order); tolua_function(L, TOLUA_CAST "clear_orders", tolua_unit_clear_orders); -#ifdef TOLUA_ORDERS_CLOSURE - tolua_variable(L, TOLUA_CAST "orders", tolua_unit_get_orders, 0); -#endif tolua_function(L, TOLUA_CAST "get_curse", tolua_unit_get_curse); tolua_function(L, TOLUA_CAST "has_attrib", tolua_unit_has_attrib); diff --git a/src/study.h b/src/study.h index ff43f1f43..b4b76bb8c 100644 --- a/src/study.h +++ b/src/study.h @@ -56,9 +56,7 @@ extern "C" { extern const struct attrib_type at_learning; -#ifndef NO_TESTS void inject_learn(learn_fun fun); -#endif #ifdef __cplusplus }