game: fixed crash in the lua_api command, refs #608