["Coords"] = "coords",
["Tracers"] = "enable_tracers",
["ESP"] = "enable_esp",
+ ["NodeTracers"] = "enable_node_tracers",
+ ["NodeESP"] = "enable_node_esp",
["CheatHUD"] = "cheat_hud",
},
["World"] = {
core.register_list_command("xray", "Configure X-Ray", "xray_nodes")
+core.register_list_command("search", "Configure NodeESP", "node_esp_nodes")
end
end
end
- return false, "Invalid usage. (See /help " .. command .. ")"
+ return false, "Invalid usage. (See .help " .. command .. ")"
end
core.register_chatcommand(command, def)
end
friendlist (Killaura / Forcefield Friendlist) string
cheat_hud (CheatHUD) bool true
+
+enable_node_esp (NodeESP) bool false
+
+enable_node_tracers (NodeTracers) bool false
+
+node_esp_nodes (NodeESP Nodes) string
&updateAllMapBlocksCallback, this);
g_settings->registerChangedCallback("fullbright",
&updateAllMapBlocksCallback, this);
+ g_settings->registerChangedCallback("node_esp_nodes",
+ &updateAllMapBlocksCallback, this);
readSettings();
&updateAllMapBlocksCallback, this);
g_settings->deregisterChangedCallback("fullbright",
&updateAllMapBlocksCallback, this);
+ g_settings->deregisterChangedCallback("node_esp_nodes",
+ &updateAllMapBlocksCallback, this);
}
bool Game::startup(bool *kill,
}
#endif
RenderingEngine::draw_scene(skycolor, m_game_ui->m_flags.show_hud,
- m_game_ui->m_flags.show_minimap, draw_wield_tool, draw_crosshair, g_settings->getBool("enable_tracers"), g_settings->getBool("enable_esp"));
+ m_game_ui->m_flags.show_minimap, draw_wield_tool, draw_crosshair, g_settings->getBool("enable_esp"), g_settings->getBool("enable_tracers"), g_settings->getBool("enable_node_esp"), g_settings->getBool("enable_node_tracers"));
/*
Profiler graph
u16 *lights,
u8 &waving,
TileSpec &tile,
+ // lol more Input
bool xray,
- std::set<content_t> xraySet
- )
+ std::set<content_t> xraySet)
{
VoxelManipulator &vmanip = data->m_vmanip;
const NodeDefManager *ndef = data->m_client->ndef();
content_t c0 = n0.getContent();
if (xray && xraySet.find(c0) != xraySet.end())
c0 = CONTENT_AIR;
-
// Don't even try to get n1 if n0 is already CONTENT_IGNORE
if (c0 == CONTENT_IGNORE) {
makes_face = false;
// the face must be drawn anyway
if (j != MAP_BLOCKSIZE - 1) {
p += translate_dir;
-
+
getTileInfo(data, p, face_dir,
next_makes_face, next_p_corrected,
next_face_dir_corrected, next_lights,
next_tile,
xray,
xraySet);
-
+
if (next_makes_face == makes_face
&& next_p_corrected == p_corrected + translate_dir
&& next_face_dir_corrected == face_dir_corrected
X-Ray
*/
bool xray = g_settings->getBool("xray");
- std::set<content_t> xraySet;
+ std::set<content_t> xraySet, nodeESPSet;
if (xray)
xraySet = splitToContentT(g_settings->get("xray_nodes"), data->m_client->ndef());
+ nodeESPSet = splitToContentT(g_settings->get("node_esp_nodes"), data->m_client->ndef());
+
/*
We are including the faces of the trailing edges of the block.
This means that when something changes, the caller must
}
// End of slow part
+ /*
+ NodeESP
+ */
+ {
+ v3s16 blockpos_nodes = data->m_blockpos * MAP_BLOCKSIZE;
+ for (s16 x = 0; x < MAP_BLOCKSIZE; x++) {
+ for (s16 y = 0; y < MAP_BLOCKSIZE; y++) {
+ for (s16 z = 0; z < MAP_BLOCKSIZE; z++) {
+ v3s16 pos = v3s16(x, y, z) + blockpos_nodes;
+ const MapNode &node = data->m_vmanip.getNodeRefUnsafeCheckFlags(pos);
+ if (nodeESPSet.find(node.getContent()) != nodeESPSet.end())
+ esp_nodes.insert(pos);
+ }
+ }
+ }
+ }
+
/*
Convert FastFaces to MeshCollector
*/
void updateCameraOffset(v3s16 camera_offset);
+ std::set<v3s16> esp_nodes;
+
private:
scene::IMesh *m_mesh[MAX_TILE_LAYERS];
MinimapMapblock *m_minimap_mapblock;
core::matrix4 oldViewMat = driver->getTransform(video::ETS_VIEW);
driver->setViewPort(core::rect<s32>(
- screensize.X - size - 10, 10,
- screensize.X - 10, size + 10));
+ screensize.X - size * 2 - 10, 10,
+ screensize.X - size - 10, size + 10));
driver->setTransform(video::ETS_PROJECTION, core::matrix4());
driver->setTransform(video::ETS_VIEW, core::matrix4());
driver->setViewPort(oldViewPort);
// Draw player markers
- v2s32 s_pos(screensize.X - size - 10, 10);
+ v2s32 s_pos(screensize.X - size * 2 - 10, 10);
core::dimension2di imgsize(data->object_marker_red->getOriginalSize());
core::rect<s32> img_rect(0, 0, imgsize.Width, imgsize.Height);
static const video::SColor col(255, 255, 255, 255);
#include "client/hud.h"
#include "client/minimap.h"
#include "client/content_cao.h"
+#include "mapblock.h"
+#include "mapsector.h"
RenderingCore::RenderingCore(IrrlichtDevice *_device, Client *_client, Hud *_hud)
: device(_device), driver(device->getVideoDriver()), smgr(device->getSceneManager()),
}
void RenderingCore::draw(video::SColor _skycolor, bool _show_hud, bool _show_minimap,
- bool _draw_wield_tool, bool _draw_crosshair, bool _draw_tracers, bool _draw_esp)
+ bool _draw_wield_tool, bool _draw_crosshair, bool _draw_esp, bool _draw_tracers, bool _draw_node_esp, bool _draw_node_tracers)
{
v2u32 ss = driver->getScreenSize();
if (screensize != ss) {
show_minimap = _show_minimap;
draw_wield_tool = _draw_wield_tool;
draw_crosshair = _draw_crosshair;
- draw_tracers = _draw_tracers;
draw_esp = _draw_esp;
+ draw_tracers = _draw_tracers;
+ draw_node_esp = _draw_node_esp;
+ draw_node_tracers = _draw_node_tracers;
beforeDraw();
drawAll();
material.setFlag(video::EMF_ZWRITE_ENABLE, false);
driver->setMaterial(material);
- auto allObjects = env.getAllActiveObjects();
- for (auto &it : allObjects) {
- ClientActiveObject *cao = it.second;
- if (cao->isLocalPlayer() || cao->getParent())
- continue;
- GenericCAO *obj = dynamic_cast<GenericCAO *>(cao);
- if (! obj)
- continue;
- aabb3f box;
- if (! obj->getSelectionBox(&box))
- continue;
- v3f pos = obj->getPosition();
- pos -= camera_offset;
- box.MinEdge += pos;
- box.MaxEdge += pos;
- pos = box.getCenter();
- if (draw_esp)
- driver->draw3DBox(box, video::SColor(255, 255, 255, 255));
- if (draw_tracers)
- driver->draw3DLine(eye_pos, pos, video::SColor(255, 255, 255, 255));
+ if (draw_esp || draw_tracers) {
+ auto allObjects = env.getAllActiveObjects();
+
+ for (auto &it : allObjects) {
+ ClientActiveObject *cao = it.second;
+ if (cao->isLocalPlayer() || cao->getParent())
+ continue;
+ GenericCAO *obj = dynamic_cast<GenericCAO *>(cao);
+ if (! obj)
+ continue;
+ aabb3f box;
+ if (! obj->getSelectionBox(&box))
+ continue;
+ v3f pos = obj->getPosition() - camera_offset;
+ box.MinEdge += pos;
+ box.MaxEdge += pos;
+ if (draw_esp)
+ driver->draw3DBox(box, video::SColor(255, 255, 255, 255));
+ if (draw_tracers)
+ driver->draw3DLine(eye_pos, box.getCenter(), video::SColor(255, 255, 255, 255));
+ }
+ }
+ if (draw_node_esp || draw_node_tracers) {
+ Map &map = env.getMap();
+ std::map<v2s16, MapSector*> *sectors = map.getSectorsPtr();
+
+ for (auto §or_it : *sectors) {
+ MapSector *sector = sector_it.second;
+ MapBlockVect blocks;
+ sector->getBlocks(blocks);
+ for (MapBlock *block : blocks) {
+ if (! block->mesh)
+ continue;
+ for (v3s16 p : block->mesh->esp_nodes) {
+ v3f pos = intToFloat(p, BS) - camera_offset;
+ MapNode node = map.getNode(p);
+ std::vector<aabb3f> boxes;
+ node.getSelectionBoxes(client->getNodeDefManager(), &boxes, node.getNeighbors(p, &map));
+ video::SColor color = client->getNodeDefManager()->get(node).minimap_color;
+
+ for (aabb3f box : boxes) {
+ box.MinEdge += pos;
+ box.MaxEdge += pos;
+ if (draw_node_esp)
+ driver->draw3DBox(box, color);
+ if (draw_node_tracers)
+ driver->draw3DLine(eye_pos, box.getCenter(), color);
+ }
+ }
+ }
+ }
+
}
driver->setMaterial(oldmaterial);
if (!show_hud)
return;
hud->drawSelectionMesh();
- if (draw_tracers || draw_esp)
+ if (draw_esp || draw_tracers || draw_node_esp || draw_node_tracers)
drawTracersAndESP();
if (draw_wield_tool)
camera->drawWieldedTool();
bool show_minimap;
bool draw_wield_tool;
bool draw_crosshair;
- bool draw_tracers;
bool draw_esp;
+ bool draw_tracers;
+ bool draw_node_esp;
+ bool draw_node_tracers;
IrrlichtDevice *device;
video::IVideoDriver *driver;
void initialize();
void draw(video::SColor _skycolor, bool _show_hud, bool _show_minimap,
- bool _draw_wield_tool, bool _draw_crosshair, bool _draw_tracers,
- bool _draw_esp);
+ bool _draw_wield_tool, bool _draw_crosshair, bool _draw_esp,
+ bool _draw_tracers, bool _draw_node_esp, bool _draw_node_tracers);
inline v2u32 getVirtualSize() const { return virtual_size; }
};
}
void RenderingEngine::_draw_scene(video::SColor skycolor, bool show_hud,
- bool show_minimap, bool draw_wield_tool, bool draw_crosshair, bool draw_tracers, bool draw_esp)
+ bool show_minimap, bool draw_wield_tool, bool draw_crosshair, bool draw_esp, bool draw_tracers, bool draw_node_esp, bool draw_node_tracers)
{
- core->draw(skycolor, show_hud, show_minimap, draw_wield_tool, draw_crosshair, draw_tracers, draw_esp);
+ core->draw(skycolor, show_hud, show_minimap, draw_wield_tool, draw_crosshair, draw_esp, draw_tracers, draw_node_esp, draw_node_tracers);
}
const char *RenderingEngine::getVideoDriverName(irr::video::E_DRIVER_TYPE type)
class LocalPlayer;
class Hud;
class Minimap;
-class Tracers;
class RenderingCore;
}
inline static void draw_scene(video::SColor skycolor, bool show_hud,
- bool show_minimap, bool draw_wield_tool, bool draw_crosshair, bool draw_tracers, bool draw_esp)
+ bool show_minimap, bool draw_wield_tool, bool draw_crosshair, bool draw_esp, bool draw_tracers, bool draw_node_esp, bool draw_node_tracers)
{
s_singleton->_draw_scene(skycolor, show_hud, show_minimap,
- draw_wield_tool, draw_crosshair, draw_tracers, draw_esp);
+ draw_wield_tool, draw_crosshair, draw_esp, draw_tracers, draw_node_esp, draw_node_tracers);
}
inline static void initialize(Client *client, Hud *hud)
bool clouds = true);
void _draw_scene(video::SColor skycolor, bool show_hud, bool show_minimap,
- bool draw_wield_tool, bool draw_crosshair, bool draw_tracers, bool draw_esp);
+ bool draw_wield_tool, bool draw_crosshair, bool draw_esp, bool draw_tracers, bool draw_node_esp, bool draw_node_tracers);
void _initialize(Client *client, Hud *hud);
settings->setDefault("forcefield", "false");
settings->setDefault("friendlist", "");
settings->setDefault("cheat_hud", "true");
+ settings->setDefault("enable_node_esp", "false");
+ settings->setDefault("enable_node_tracers", "false");
+ settings->setDefault("node_esp_nodes", "");
// Keymap
settings->setDefault("remote_port", "30000");
settings->setDefault("arm_inertia", "true");
settings->setDefault("enable_minimap", "true");
- settings->setDefault("minimap_shape_round", "true");
+ settings->setDefault("minimap_shape_round", "false");
settings->setDefault("minimap_double_scan_height", "true");
// Effects
#include "cheatMenu.h"
#include <cstddef>
-FontMode CheatMenu::fontStringToEnum(std::string str) {
- if (str == "FM_Standard")
+FontMode CheatMenu::fontStringToEnum(std::string str)
+{
+ if (str == "FM_Standard")
return FM_Standard;
else if (str == "FM_Mono")
return FM_Mono;
font_color = g_settings->getV3F("cheat_menu_font_color");
selected_font_color = g_settings->getV3F("cheat_menu_selected_font_color");
- m_bg_color = video::SColor(g_settings->getU32("cheat_menu_bg_color_alpha"),
- bg_color.X, bg_color.Y, bg_color.Z);
-
- m_active_bg_color = video::SColor(g_settings->getU32("cheat_menu_active_bg_color_alpha"),
- active_bg_color.X, active_bg_color.Y, active_bg_color.Z);
+ m_bg_color = video::SColor(g_settings->getU32("cheat_menu_bg_color_alpha"),
+ bg_color.X, bg_color.Y, bg_color.Z);
+
+ m_active_bg_color = video::SColor(
+ g_settings->getU32("cheat_menu_active_bg_color_alpha"),
+ active_bg_color.X, active_bg_color.Y, active_bg_color.Z);
m_font_color = video::SColor(g_settings->getU32("cheat_menu_font_color_alpha"),
- font_color.X, font_color.Y, font_color.Z);
+ font_color.X, font_color.Y, font_color.Z);
+
+ m_selected_font_color = video::SColor(
+ g_settings->getU32("cheat_menu_selected_font_color_alpha"),
+ selected_font_color.X, selected_font_color.Y,
+ selected_font_color.Z);
- m_selected_font_color = video::SColor(g_settings->getU32("cheat_menu_selected_font_color_alpha"),
- selected_font_color.X, selected_font_color.Y, selected_font_color.Z);
-
m_font = g_fontengine->getFont(FONT_SIZE_UNSPECIFIED, fontMode);
if (!m_font) {
void CheatMenu::drawHUD(video::IVideoDriver *driver, double dtime)
{
CHEAT_MENU_GET_SCRIPTPTR
-
+
m_rainbow_offset += dtime;
m_rainbow_offset = fmod(m_rainbow_offset, 6.0f);
-
+
std::vector<std::string> enabled_cheats;
-
+
int cheat_count = 0;
-
- for (auto category = script->m_cheat_categories.begin(); category != script->m_cheat_categories.end(); category++) {
- for (auto cheat = (*category)->m_cheats.begin(); cheat != (*category)->m_cheats.end(); cheat++) {
+
+ for (auto category = script->m_cheat_categories.begin();
+ category != script->m_cheat_categories.end(); category++) {
+ for (auto cheat = (*category)->m_cheats.begin();
+ cheat != (*category)->m_cheats.end(); cheat++) {
if ((*cheat)->is_enabled()) {
enabled_cheats.push_back((*cheat)->m_name);
cheat_count++;
}
}
}
-
+
if (enabled_cheats.empty())
return;
-
+
std::vector<video::SColor> colors;
-
+
for (int i = 0; i < cheat_count; i++) {
video::SColor color;
f32 h = (f32)i * 2.0f / (f32)cheat_count - m_rainbow_offset;
if (h < 0)
h = 6.0f + h;
f32 x = (1 - fabs(fmod(h, 2.0f) - 1.0f)) * 255.0f;
- switch((int)h) {
+ switch ((int)h) {
case 0:
- color = video::SColor(255, 255, x, 0); break;
+ color = video::SColor(255, 255, x, 0);
+ break;
case 1:
- color = video::SColor(255, x, 255, 0); break;
+ color = video::SColor(255, x, 255, 0);
+ break;
case 2:
- color = video::SColor(255, 0, 255, x); break;
+ color = video::SColor(255, 0, 255, x);
+ break;
case 3:
- color = video::SColor(255, 0, x, 255); break;
+ color = video::SColor(255, 0, x, 255);
+ break;
case 4:
- color = video::SColor(255, x, 0, 255); break;
+ color = video::SColor(255, x, 0, 255);
+ break;
case 5:
- color = video::SColor(255, 255, 0, x); break;
+ color = video::SColor(255, 255, 0, x);
+ break;
}
colors.push_back(color);
}
-
+
core::dimension2d<u32> screensize = driver->getScreenSize();
-
+
u32 y = 5;
-
+
int i = 0;
for (std::string cheat : enabled_cheats) {
- core::dimension2d<u32> dim = m_font->getDimension(utf8_to_wide(cheat).c_str());
+ core::dimension2d<u32> dim =
+ m_font->getDimension(utf8_to_wide(cheat).c_str());
u32 x = screensize.Width - 5 - dim.Width;
-
+
core::rect<s32> fontbounds(x, y, x + dim.Width, y + dim.Height);
m_font->draw(cheat.c_str(), fontbounds, colors[i], false, false);
-
+
y += dim.Height;
i++;
}
public:
CheatMenu(Client *client);
- ClientScripting *getScript()
- {
- return m_client->getScript();
- }
+ ClientScripting *getScript() { return m_client->getScript(); }
void draw(video::IVideoDriver *driver, bool show_debug);
-
+
void drawHUD(video::IVideoDriver *driver, double dtime);
void drawEntry(video::IVideoDriver *driver, std::string name, int number,
- bool selected, bool active,
- CheatMenuEntryType entry_type = CHEAT_MENU_ENTRY_TYPE_ENTRY);
+ bool selected, bool active,
+ CheatMenuEntryType entry_type = CHEAT_MENU_ENTRY_TYPE_ENTRY);
void selectUp();
void selectDown();
gui::IGUIFont *m_font = nullptr;
v2u32 m_fontsize;
-
+
float m_rainbow_offset = 0.0;
};
} else if (pointed.type == POINTEDTHING_OBJECT) {
lua_pushstring(L, "object");
lua_setfield(L, -2, "type");
-
if (csm) {
+#ifndef SERVER
ClientObjectRef::create(L, pointed.object_id);
+#endif
} else {
push_objectRef(L, pointed.object_id);
}
${CMAKE_CURRENT_SOURCE_DIR}/l_env.cpp
${CMAKE_CURRENT_SOURCE_DIR}/l_http.cpp
${CMAKE_CURRENT_SOURCE_DIR}/l_inventory.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/l_inventoryaction.cpp
${CMAKE_CURRENT_SOURCE_DIR}/l_item.cpp
${CMAKE_CURRENT_SOURCE_DIR}/l_itemstackmeta.cpp
${CMAKE_CURRENT_SOURCE_DIR}/l_mapgen.cpp
${CMAKE_CURRENT_SOURCE_DIR}/l_camera.cpp
${CMAKE_CURRENT_SOURCE_DIR}/l_client.cpp
${CMAKE_CURRENT_SOURCE_DIR}/l_clientobject.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/l_inventoryaction.cpp
${CMAKE_CURRENT_SOURCE_DIR}/l_localplayer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/l_mainmenu.cpp
${CMAKE_CURRENT_SOURCE_DIR}/l_minimap.cpp
{
ClientObjectRef *ref = checkobject(L, 1);
GenericCAO *gcao = get_generic_cao(ref, L);
- PointedThing pointed(gcao->getId(), v3f(0,0,0), v3s16(0,0,0), 0);
+ PointedThing pointed(gcao->getId(), v3f(0, 0, 0), v3s16(0, 0, 0), 0);
getClient(L)->interact(INTERACT_START_DIGGING, pointed);
return 0;
}
{
ClientObjectRef *ref = checkobject(L, 1);
GenericCAO *gcao = get_generic_cao(ref, L);
- PointedThing pointed(gcao->getId(), v3f(0,0,0), v3s16(0,0,0), 0);
+ PointedThing pointed(gcao->getId(), v3f(0, 0, 0), v3s16(0, 0, 0), 0);
getClient(L)->interact(INTERACT_PLACE, pointed);
return 0;
}
luamethod(ClientObjectRef, get_attach),
luamethod(ClientObjectRef, get_nametag),
luamethod(ClientObjectRef, get_item_textures),
- luamethod(ClientObjectRef, get_max_hp),
- luamethod(ClientObjectRef, punch),
+ luamethod(ClientObjectRef, get_max_hp), luamethod(ClientObjectRef, punch),
luamethod(ClientObjectRef, rightclick), {0, 0}};
// is_player(self)
static int l_is_player(lua_State *L);
-
+
// is_local_player(self)
static int l_is_local_player(lua_State *L);
std::ostringstream os(std::ios::binary);
o->m_action->serialize(os);
-
+
std::istringstream is(os.str(), std::ios_base::binary);
-
+
InventoryAction *a = InventoryAction::deSerialize(is);
getClient(L)->inventoryAction(a);
int LuaInventoryAction::l_craft(lua_State *L)
{
LuaInventoryAction *o = checkobject(L, 1);
-
+
if (o->m_action->getType() != IAction::Craft)
return 0;
-
+
std::string locStr;
InventoryLocation loc;
-
+
locStr = readParam<std::string>(L, 2);
-
+
try {
loc.deSerialize(locStr);
dynamic_cast<ICraftAction *>(o->m_action)->craft_inv = loc;
- } catch (SerializationError &) {}
-
+ } catch (SerializationError &) {
+ }
+
return 0;
}
int LuaInventoryAction::l_set_count(lua_State *L)
{
LuaInventoryAction *o = checkobject(L, 1);
-
+
s16 count = luaL_checkinteger(L, 2);
-
+
switch (o->m_action->getType()) {
case IAction::Move:
((IMoveAction *)o->m_action)->count = count;
((ICraftAction *)o->m_action)->count = count;
break;
}
-
+
return 0;
}
delete m_action;
}
-void LuaInventoryAction::readFullInventoryLocationInto(lua_State *L, InventoryLocation *loc, std::string *list, s16 *index)
+void LuaInventoryAction::readFullInventoryLocationInto(
+ lua_State *L, InventoryLocation *loc, std::string *list, s16 *index)
{
try {
loc->deSerialize(readParam<std::string>(L, 2));
std::string l = readParam<std::string>(L, 3);
*list = l;
*index = luaL_checkinteger(L, 4) - 1;
- } catch (SerializationError &) {}
+ } catch (SerializationError &) {
+ }
}
int LuaInventoryAction::create_object(lua_State *L)
{
IAction type;
std::string typeStr;
-
+
typeStr = readParam<std::string>(L, 1);
-
+
if (typeStr == "move")
type = IAction::Move;
else if (typeStr == "drop")
}
const char LuaInventoryAction::className[] = "InventoryAction";
-const luaL_Reg LuaInventoryAction::methods[] = {
- luamethod(LuaInventoryAction, apply),
- luamethod(LuaInventoryAction, from),
- luamethod(LuaInventoryAction, to),
- luamethod(LuaInventoryAction, craft),
- luamethod(LuaInventoryAction, set_count),
- {0,0}
-};
+const luaL_Reg LuaInventoryAction::methods[] = {luamethod(LuaInventoryAction, apply),
+ luamethod(LuaInventoryAction, from), luamethod(LuaInventoryAction, to),
+ luamethod(LuaInventoryAction, craft),
+ luamethod(LuaInventoryAction, set_count), {0, 0}};
#include "inventorymanager.h"
#include "lua_api/l_base.h"
-#define GET_MOVE_ACTION \
- LuaInventoryAction *o = checkobject(L, 1); \
- if (o->m_action->getType() == IAction::Craft) \
- return 0; \
+#define GET_MOVE_ACTION \
+ LuaInventoryAction *o = checkobject(L, 1); \
+ if (o->m_action->getType() == IAction::Craft) \
+ return 0; \
MoveAction *act = dynamic_cast<MoveAction *>(o->m_action);
-class LuaInventoryAction : public ModApiBase {
+class LuaInventoryAction : public ModApiBase
+{
private:
InventoryAction *m_action;
-
- static void readFullInventoryLocationInto(lua_State *L, InventoryLocation *loc, std::string *list, s16 *index);
-
+
+ static void readFullInventoryLocationInto(lua_State *L, InventoryLocation *loc,
+ std::string *list, s16 *index);
+
static const char className[];
static const luaL_Reg methods[];
-
+
// Exported functions
-
+
// garbage collector
static int gc_object(lua_State *L);
// __tostring metamethod
static int mt_tostring(lua_State *L);
-
+
// apply(self)
static int l_apply(lua_State *L);
-
+
// from(self, location, list, index)
static int l_from(lua_State *L);
-
+
// to(self, location, list, index)
static int l_to(lua_State *L);
-
+
// craft(self, location)
static int l_craft(lua_State *L);
// set_count(self, count)
static int l_set_count(lua_State *L);
-
+
public:
LuaInventoryAction(const IAction &type);
~LuaInventoryAction();
static int create_object(lua_State *L);
// Not callable from Lua
static int create(lua_State *L, const IAction &type);
- static LuaInventoryAction* checkobject(lua_State *L, int narg);
+ static LuaInventoryAction *checkobject(lua_State *L, int narg);
static void Register(lua_State *L);
};
printf ":\n%s\n" "$d"
fi
- ${CLANG_FORMAT} "-i $f"
+ ${CLANG_FORMAT} -i "$f"
fail=1
fi