diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fe4613e7d..ebe914dfe 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -187,12 +187,10 @@ target_link_libraries(eressea ${INIPARSER_LIBRARIES} ) -find_library(C_MATH_LIBRARY m) - add_executable(convert convert.c) target_link_libraries(convert game - ${C_MATH_LIBRARY} + ${LUA_MATH_LIBRARY} ${STORAGE_LIBRARIES} ${CLIBS_LIBRARIES} ${INIPARSER_LIBRARIES} diff --git a/src/bind_unit.c b/src/bind_unit.c index 8247e13d5..b95f43d4a 100644 --- a/src/bind_unit.c +++ b/src/bind_unit.c @@ -787,7 +787,13 @@ static int tolua_unit_get_curse(lua_State *L) { static int tolua_unit_has_attrib(lua_State *L) { unit *self = (unit *)tolua_tousertype(L, 1, 0); const char *name = tolua_tostring(L, 2, 0); - attrib * a = self->attribs ? a_find(self->attribs, at_find(name)) : NULL; + attrib * a = self->attribs; + while (a) { + if (strcmp(a->type->name, name) == 0) { + break; + } + a = a->nexttype; + } lua_pushboolean(L, a != NULL); return 1; }