From 6412d51e0ac1144f47d92a6c46e67568bd9fdc86 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 19 Mar 2004 00:14:41 +0000 Subject: [PATCH] attribute saying whether unit is familiar --- src/eressea/lua/unit.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/eressea/lua/unit.cpp b/src/eressea/lua/unit.cpp index a06a1bba2..56ba64e24 100644 --- a/src/eressea/lua/unit.cpp +++ b/src/eressea/lua/unit.cpp @@ -161,6 +161,12 @@ unit_addspell(unit& u, const char * name) if (!add) log_error(("spell %s could not be found\n", name)); } +static bool +unit_isfamiliar(const unit& u) +{ + return is_familiar(&u); +} + static void unit_removespell(unit& u, const spell * sp) { @@ -206,6 +212,7 @@ bind_unit(lua_State * L) .def("set_racename", &unit_setracename) .def("add_spell", &unit_addspell) .def("remove_spell", &unit_removespell) + .property("is_familiar", &unit_isfamiliar) .property("spells", &unit_spells, return_stl_iterator) .property("familiarspells", &unit_familiarspells, return_stl_iterator) .property("number", &unit_getnumber, &unit_setnumber)