remove old & unused fix_famililar repair code.

This commit is contained in:
Enno Rehling 2017-01-07 20:20:13 +01:00
parent 8d02d5a5aa
commit 494643d65f
1 changed files with 0 additions and 29 deletions

View File

@ -58,34 +58,6 @@ static int tolua_spawn_undead(lua_State * L)
return 0; return 0;
} }
static int fix_familiars(struct lua_State *L)
{
faction *f;
for (f = factions; f; f = f->next) {
unit *u;
for (u = f->units; u; u = u->nextF) {
struct sc_mage *mage = get_mage(u);
if (mage && is_familiar(u)) {
if (mage->spellbook && mage->magietyp == M_GRAY) {
equipment *eq;
char buffer[64];
spellbook_clear(mage->spellbook);
free(mage->spellbook);
mage->spellbook = 0;
_snprintf(buffer, sizeof(buffer), "%s_familiar", u_race(u)->_name);
eq = get_equipment(buffer);
if (eq) {
equip_unit_mask(u, eq, EQUIP_SPELLS);
}
}
}
}
}
return 0;
}
void bind_monsters(struct lua_State *L) void bind_monsters(struct lua_State *L)
{ {
tolua_module(L, NULL, 0); tolua_module(L, NULL, 0);
@ -95,7 +67,6 @@ void bind_monsters(struct lua_State *L)
tolua_function(L, TOLUA_CAST "plan_monsters", tolua_planmonsters); tolua_function(L, TOLUA_CAST "plan_monsters", tolua_planmonsters);
tolua_function(L, TOLUA_CAST "spawn_undead", tolua_spawn_undead); tolua_function(L, TOLUA_CAST "spawn_undead", tolua_spawn_undead);
tolua_function(L, TOLUA_CAST "spawn_dragons", tolua_spawn_dragons); tolua_function(L, TOLUA_CAST "spawn_dragons", tolua_spawn_dragons);
tolua_function(L, TOLUA_CAST "fix_familiars", fix_familiars);
tolua_function(L, TOLUA_CAST "get_monsters", tolua_get_monsters); tolua_function(L, TOLUA_CAST "get_monsters", tolua_get_monsters);
} }
tolua_endmodule(L); tolua_endmodule(L);