fix rendering message

This commit is contained in:
Enno Rehling 2009-07-23 20:04:39 +00:00
parent df2a9b7957
commit 521719e239
1 changed files with 5 additions and 2 deletions

View File

@ -289,8 +289,11 @@ tolua_msg_report_action(lua_State * L)
lua_message * lmsg = (lua_message *)tolua_tousertype(L, 1, 0);
region * r = (region *)tolua_tousertype(L, 2, 0);
unit * u = (unit *)tolua_tousertype(L, 3, 0);
int flags = (int)tolua_tonumber(L, 4, 0);
int result = report_action(r, u, lmsg->msg, flags);
int result, flags = (int)tolua_tonumber(L, 4, 0);
if (lmsg->msg==NULL) {
lmsg->msg = msg_create(lmsg->mtype, lmsg->args);
}
result = report_action(r, u, lmsg->msg, flags);
tolua_pushnumber(L, (lua_Number)result);
return 1;
}