diff --git a/src/bind_faction.c b/src/bind_faction.c index b62c004f8..fafd6bc21 100644 --- a/src/bind_faction.c +++ b/src/bind_faction.c @@ -22,6 +22,7 @@ without prior permission by the authors of Eressea. #include #include #include +#include #include #include #include @@ -211,6 +212,15 @@ static int tolua_faction_renumber(lua_State * L) return 0; } +static int tolua_faction_addnotice(lua_State * L) +{ + faction *self = (faction *)tolua_tousertype(L, 1, 0); + const char *str = tolua_tostring(L, 2, 0); + + addmessage(NULL, self, str, MSG_MESSAGE, ML_IMPORTANT); + return 0; +} + static int tolua_faction_get_objects(lua_State * L) { faction *self = (faction *) tolua_tousertype(L, 1, 0); @@ -563,9 +573,10 @@ void tolua_faction_open(lua_State * L) .property("x", &faction_getorigin_x, &faction_setorigin_x) .property("y", &faction_getorigin_y, &faction_setorigin_y) - .def("add_notice", &faction_addnotice) #endif - tolua_variable(L, TOLUA_CAST "objects", tolua_faction_get_objects, + tolua_function(L, TOLUA_CAST "add_notice", &tolua_faction_addnotice); + + tolua_variable(L, TOLUA_CAST "objects", tolua_faction_get_objects, NULL); } tolua_endmodule(L);