Apply the new ground_level method.
[crawl.git] / crawl-ref / source / l_mapmrk.cc
blob155568d5b776754727f4cb249a69eebd63454327
1 #include "AppHdr.h"
3 #include "cluautil.h"
4 #include "l_libs.h"
6 #include "env.h"
7 #include "mapmark.h"
9 static int mapmarker_pos(lua_State *ls)
11 MAPMARKER(ls, 1, mark);
12 lua_pushnumber(ls, mark->pos.x);
13 lua_pushnumber(ls, mark->pos.y);
14 return (2);
17 static int mapmarker_move(lua_State *ls)
19 MAPMARKER(ls, 1, mark);
20 const coord_def dest(luaL_checkint(ls, 2), luaL_checkint(ls, 3));
21 env.markers.move_marker(mark, dest);
22 return (0);
25 static int mapmarker_remove(lua_State *ls)
27 MAPMARKER(ls, 1, mark);
28 env.markers.remove(mark);
29 return (0);
32 const struct luaL_reg mapmarker_dlib[] =
34 { "pos", mapmarker_pos },
35 { "move", mapmarker_move },
36 { "remove", mapmarker_remove },
37 { NULL, NULL }
40 void luaopen_mapmarker(lua_State *ls)
42 luaopen_setmeta(ls, "mapmarker", mapmarker_dlib, MAPMARK_METATABLE);