diff --git a/scripts/tests/faction.lua b/scripts/tests/faction.lua index f0cd9335c..38fdc4eb7 100644 --- a/scripts/tests/faction.lua +++ b/scripts/tests/faction.lua @@ -17,7 +17,7 @@ function setup() end function test_faction_flags() - assert_equal(0, f.flags) + assert_equal(2, f.flags) -- FFL_ISNEW f.flags = 42 assert_equal(42, f.flags) end diff --git a/src/battle.c b/src/battle.c index 4686a942a..392b24441 100644 --- a/src/battle.c +++ b/src/battle.c @@ -88,7 +88,6 @@ static FILE *bdebug; #define TDIFF_CHANGE 5 /* 5% höher pro Stufe */ #define DAMAGE_QUOTIENT 2 /* damage += skilldiff/DAMAGE_QUOTIENT */ -#undef DEBUG_FAST /* should be disabled when b->fast and b->rowcache works */ #define DEBUG_SELECT /* should be disabled if select_enemy works */ typedef enum combatmagic { @@ -205,12 +204,7 @@ static const char *sideabkz(side * s, bool truename) const faction *f = (s->stealthfaction && !truename) ? s->stealthfaction : s->faction; -#undef SIDE_ABKZ -#ifdef SIDE_ABKZ - abkz(f->name, sideabkz_buf, sizeof(sideabkz_buf), 3); -#else strlcpy(sideabkz_buf, itoa36(f->no), sizeof(sideabkz_buf)); -#endif return sideabkz_buf; } @@ -471,13 +465,7 @@ static int get_unitrow(const fighter * af, const side * vs) b->rowcache.result = get_row(af->side, row, vs); return b->rowcache.result; } -#ifdef DEBUG_FAST /* validation code */ - { - int i = get_row(af->side, row, vs); - assert(i == b->rowcache.result); - } -#endif - return b->rowcache.result; + return b->rowcache.result; } } @@ -1445,18 +1433,10 @@ int select) if (b->alive == b->fast.alive && as == b->fast.side && sr == b->fast.status && minrow == b->fast.minrow && maxrow == b->fast.maxrow) { if (b->fast.enemies[select] >= 0) { -#ifdef DEBUG_FAST - int i = count_enemies_i(b, af, minrow, maxrow, select); - assert(i == b->fast.enemies[select]); -#endif return b->fast.enemies[select]; } else if (select & SELECT_FIND) { if (b->fast.enemies[select - SELECT_FIND] >= 0) { -#ifdef DEBUG_FAST - int i = count_enemies_i(b, af, minrow, maxrow, select); - assert((i > 0) == (b->fast.enemies[select - SELECT_FIND] > 0)); -#endif return b->fast.enemies[select - SELECT_FIND]; } } diff --git a/src/bind_ship.c b/src/bind_ship.c index 22015f673..f1c1c412a 100644 --- a/src/bind_ship.c +++ b/src/bind_ship.c @@ -233,15 +233,7 @@ void tolua_ship_open(lua_State * L) tolua_variable(L, TOLUA_CAST "type", tolua_ship_get_type, 0); tolua_variable(L, TOLUA_CAST "damage", tolua_ship_get_damage, tolua_ship_set_damage); - -#ifdef TODO - .property("weight", &ship_getweight) - .property("capacity", &ship_getcapacity) - .property("maxsize", &ship_maxsize) - .def_readwrite("damage", &ship::damage) - .def_readwrite("size", &ship::size) -#endif - tolua_variable(L, TOLUA_CAST "objects", tolua_ship_get_objects, 0); + tolua_variable(L, TOLUA_CAST "objects", tolua_ship_get_objects, 0); tolua_function(L, TOLUA_CAST "create", tolua_ship_create); } diff --git a/src/bind_unit.c b/src/bind_unit.c index 353bd4667..a7ba3fe96 100755 --- a/src/bind_unit.c +++ b/src/bind_unit.c @@ -767,25 +767,6 @@ static int tolua_unit_get_spells(lua_State * L) return tolua_quicklist_push(L, "spellbook", "spell_entry", slist); } -#ifdef TODO /* spellbooks */ -static void unit_removespell(unit * u, spell * sp) -{ - quicklist **isptr; - - isptr = get_spelllist(get_mage(u), u->faction); - ql_set_remove(isptr, sp); -} - -static int tolua_unit_removespell(lua_State * L) -{ - unit *self = (unit *) tolua_tousertype(L, 1, 0); - spell *sp = (spell *) tolua_tousertype(L, 2, 0); - unit_removespell(self, sp); - return 0; -} - -#endif - static int tolua_unit_get_orders(lua_State * L) { unit *self = (unit *)tolua_tousertype(L, 1, 0); @@ -1019,9 +1000,6 @@ void tolua_unit_open(lua_State * L) tolua_variable(L, TOLUA_CAST "race_name", &tolua_unit_get_racename, &tolua_unit_set_racename); tolua_function(L, TOLUA_CAST "add_spell", &tolua_unit_addspell); -#ifdef TODO /* spellbooks */ - tolua_function(L, TOLUA_CAST "remove_spell", &tolua_unit_removespell); -#endif tolua_variable(L, TOLUA_CAST "spells", &tolua_unit_get_spells, 0); tolua_function(L, TOLUA_CAST "cast_spell", &tolua_unit_castspell); diff --git a/src/main.c b/src/main.c index 3748c2d49..d3d2cbe50 100644 --- a/src/main.c +++ b/src/main.c @@ -322,10 +322,6 @@ int main(int argc, char **argv) log_error("script %s failed with code %d\n", luafile, err); return err; } -#ifdef MSPACES - malloc_stats(); -#endif - game_done(); lua_done(L); log_close(); diff --git a/src/report.c b/src/report.c index be6c2273f..2c79209b9 100644 --- a/src/report.c +++ b/src/report.c @@ -2128,23 +2128,6 @@ const char *charset) RENDER(f, buf, sizeof(buf), ("nr_score", "score average", score, avg)); centre(out, buf, true); } -#ifdef COUNT_AGAIN - no_units = 0; - no_people = 0; - for (u = f->units; u; u = u->nextF) { - if (playerrace(u_race(u))) { - ++no_people; - no_units += u->number; - assert(f == u->faction); - } - } - if (no_units != f->no_units) { - f->no_units = no_units; - } - if (no_people != f->num_people) { - f->num_people = no_people; -} -#else no_units = count_units(f); no_people = count_all(f); if (f->flags & FFL_NPC) { @@ -2153,7 +2136,6 @@ const char *charset) else { no_people = f->num_people; } -#endif m = msg_message("nr_population", "population units limit", no_people, no_units, rule_faction_limit()); nr_render(m, f->locale, buf, sizeof(buf), f); msg_release(m);