MCPcopy Create free account
hub / github.com/DFHack/dfhack / dfhack_penarray_get_tile

Function dfhack_penarray_get_tile

library/LuaApi.cpp:1012–1027  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1010}
1011
1012static int dfhack_penarray_get_tile(lua_State *L)
1013{
1014 PenArray *parr = check_penarray_native(L, 1);
1015 unsigned int x = luaL_checkint(L, 2);
1016 unsigned int y = luaL_checkint(L, 3);
1017 if (x < parr->get_dimx() && y < parr->get_dimy())
1018 {
1019 Pen pen = parr->get_tile(x, y);
1020 Lua::Push(L, pen);
1021 }
1022 else
1023 {
1024 lua_pushnil(L);
1025 }
1026 return 1;
1027}
1028
1029static int dfhack_penarray_set_tile(lua_State *L)
1030{

Callers

nothing calls this directly

Calls 4

check_penarray_nativeFunction · 0.85
PushFunction · 0.85
lua_pushnilFunction · 0.85
get_tileMethod · 0.80

Tested by

no test coverage detected