]> granicus.if.org Git - nethack/commitdiff
Simplify abscoord code
authorPasi Kallinen <paxed@alt.org>
Wed, 16 Mar 2022 14:46:06 +0000 (16:46 +0200)
committerPasi Kallinen <paxed@alt.org>
Wed, 16 Mar 2022 14:46:10 +0000 (16:46 +0200)
No need to call get_location_coord, as we're never dealing with
random coordinates or rooms.

src/sp_lev.c

index 44ea80e4058e04615515610f2015f74b0784d5e9..ddecbe129c3b24d52ec43581387fe984fd21c5bf 100644 (file)
@@ -4932,7 +4932,8 @@ nhl_abs_coord(lua_State *L)
     if (argc == 2) {
         x = (xchar) lua_tointeger(L, 1);
         y = (xchar) lua_tointeger(L, 2);
-        get_location_coord(&x, &y, ANY_LOC, NULL, SP_COORD_PACK(x,y));
+        x += g.xstart;
+        y += g.ystart;
     } else
         nhl_error(L, "nhl_abs_coord: Wrong args");
     lua_pushinteger(L, x);