mirror of
https://github.com/diasurgical/DevilutionX.git
synced 2026-06-20 05:44:36 +00:00
32f9cc9ad9
This may not be how we'll eventually expose towners but it's good enough for now.
23 lines
515 B
C++
23 lines
515 B
C++
#include "lua/modules/player.hpp"
|
|
|
|
#include <sol/sol.hpp>
|
|
|
|
#include "engine/point.hpp"
|
|
#include "lua/metadoc.hpp"
|
|
#include "player.h"
|
|
|
|
namespace devilution {
|
|
|
|
sol::table LuaPlayerModule(sol::state_view &lua)
|
|
{
|
|
sol::table table = lua.create_table();
|
|
SetDocumented(table, "walk_to", "(x: integer, y: integer)",
|
|
"Walk to the given coordinates",
|
|
[](int x, int y) {
|
|
NetSendCmdLoc(MyPlayerId, true, CMD_WALKXY, Point { x, y });
|
|
});
|
|
return table;
|
|
}
|
|
|
|
} // namespace devilution
|