lua_getfield(L, -1, "flags");
if (lua_type(L, -1) == LUA_TTABLE) {
int f, nflags;
+
lua_len(L, -1);
- nflags = LUA_INTCAST(lua_tointeger(L, -1));
+ nflags = (int) lua_tointeger(L, -1);
lua_pop(L, 1);
for (f = 0; f < nflags; f++) {
lua_pushinteger(L, f+1);
panic("dungeon is not a lua table");
lua_len(L, -1);
- g.n_dgns = LUA_INTCAST(lua_tointeger(L, -1));
+ g.n_dgns = (int) lua_tointeger(L, -1);
lua_pop(L, 1);
pd.start = 0;
lua_getfield(L, -1, "levels");
if (lua_type(L, -1) == LUA_TTABLE) {
int f, nlevels;
+
lua_len(L, -1);
- nlevels = LUA_INTCAST(lua_tointeger(L, -1));
+ nlevels = (int) lua_tointeger(L, -1);
pd.tmpdungeon[i].levels = nlevels;
lua_pop(L, 1);
for (f = 0; f < nlevels; f++) {
lua_getfield(L, -1, "branches");
if (lua_type(L, -1) == LUA_TTABLE) {
int f, nbranches;
+
lua_len(L, -1);
- nbranches = LUA_INTCAST(lua_tointeger(L, -1));
+ nbranches = (int) lua_tointeger(L, -1);
pd.tmpdungeon[i].branches = nbranches;
lua_pop(L, 1);
for (f = 0; f < nbranches; f++) {
int argc = lua_gettop(L);
if (argc == 2) {
- int x = LUA_INTCAST(lua_tointeger(L, 1));
- int y = LUA_INTCAST(lua_tointeger(L, 2));
+ int x = (int) lua_tointeger(L, 1);
+ int y = (int) lua_tointeger(L, 2);
if (x >= 0 && x < COLNO && y >= 0 && y < ROWNO) {
char buf[BUFSZ];
if (!synopsis && !text) {
int nelems;
+
lua_len(L, -1);
- nelems = LUA_INTCAST(lua_tointeger(L, -1));
+ nelems = (int) lua_tointeger(L, -1);
lua_pop(L, 1);
if (nelems < 2) {
impossible("com_pager: questtext[%s][%s] in %s in not an array of strings", section, msgid, QTEXT_FILE);