diff --git a/src/eressea/lua/region.cpp b/src/eressea/lua/region.cpp index 29fa01c5f..6df2c29c0 100644 --- a/src/eressea/lua/region.cpp +++ b/src/eressea/lua/region.cpp @@ -103,12 +103,44 @@ region_setflag(region& r, int bit, bool set) else r.flags &= ~(1<units!=NULL) { + // TODO: error message + return r; + } + terraform(r, T_FIREWALL); + // TODO: durch einen NULL-äquivalenten terraintyp ersetzen + } + return NULL; + } + if (r==NULL) r = new_region(x, y); + terraform(r, t); + return r; +} + void bind_region(lua_State * L) { module(L)[ def("regions", &get_regions, return_stl_iterator), def("get_region", &findregion), + def("terraform", &terraform_region), class_("region") .def(tostring(self)) diff --git a/src/eressea/lua/unit.cpp b/src/eressea/lua/unit.cpp index 6c905022c..67933fb4c 100644 --- a/src/eressea/lua/unit.cpp +++ b/src/eressea/lua/unit.cpp @@ -267,6 +267,19 @@ unit_setmagic(unit& u, const char * type) } } +static void +unit_addorder(unit& u, const char * str) +{ + addstrlist(&u.orders, str); +} + +static void +unit_clearorders(unit& u) +{ + freestrlist(u.orders); + u.orders = NULL; +} + void bind_unit(lua_State * L) { @@ -282,6 +295,8 @@ bind_unit(lua_State * L) .def_readonly("id", &unit::no) .def_readwrite("hp", &unit::hp) .def_readwrite("status", &unit::status) + .def("add_order", &unit_addorder) + .def("clear_orders", &unit_clearorders) .def("get_item", &unit_getitem) .def("add_item", &unit_additem) .def("get_skill", &unit_getskill)