Merge branch 'main' into devtools

This commit is contained in:
MihailRis
2024-05-10 13:42:11 +03:00
55 changed files with 160 additions and 193 deletions
-1
View File
@@ -44,7 +44,6 @@ void ChunksController::update(int64_t maxDuration) {
mcstotal += mcs;
continue;
}
mcstotal += mcs;
}
break;
}
+1 -2
View File
@@ -68,7 +68,6 @@ void show_convert_request(
static void show_content_missing(
Engine* engine,
const Content* content,
std::shared_ptr<ContentLUT> lut
) {
using namespace dynamic;
@@ -135,7 +134,7 @@ void EngineController::openWorld(std::string name, bool confirmConvert) {
if (lut) {
if (lut->hasMissingContent()) {
engine->setScreen(std::make_shared<MenuScreen>(engine));
show_content_missing(engine, content, lut);
show_content_missing(engine, lut);
} else {
if (confirmConvert) {
menus::show_process_panel(engine, create_converter(engine, folder, content, lut, [=]() {
+1 -1
View File
@@ -348,7 +348,7 @@ void PlayerController::updateInteraction(){
maxDistance *= 20.0f;
}
auto inventory = player->getInventory();
ItemStack& stack = inventory->getSlot(player->getChosenSlot());
const ItemStack& stack = inventory->getSlot(player->getChosenSlot());
ItemDef* item = indices->getItemDef(stack.getItemId());
glm::vec3 end;
+2 -2
View File
@@ -48,8 +48,8 @@ inline audio::speakerid_t play_sound(
),
relative,
volume,
pitch,
false,
pitch,
loop,
audio::PRIORITY_NORMAL,
channel
);
+2 -2
View File
@@ -39,7 +39,7 @@ static int l_open_world(lua_State* L) {
return 0;
}
static int l_reopen_world(lua_State* L) {
static int l_reopen_world(lua_State*) {
auto controller = scripting::engine->getController();
controller->reopenWorld(scripting::level->getWorld());
return 0;
@@ -151,7 +151,7 @@ static int l_get_setting_info(lua_State* L) {
return 0;
}
static int l_quit(lua_State* L) {
static int l_quit(lua_State*) {
Window::setShouldClose(true);
return 0;
}
+1 -1
View File
@@ -242,7 +242,7 @@ static int p_is_visible(UINode* node) {
static int p_is_enabled(UINode* node) {
return state->pushboolean(node->isEnabled());
}
static int p_move_into(UINode* node) {
static int p_move_into(UINode*) {
return state->pushcfunction(l_uinode_move_into);
}
+4 -4
View File
@@ -23,14 +23,14 @@ namespace scripting {
extern Hud* hud;
}
static int l_hud_open_inventory(lua_State* L) {
static int l_hud_open_inventory(lua_State*) {
if (!scripting::hud->isInventoryOpen()) {
scripting::hud->openInventory();
}
return 0;
}
static int l_hud_close_inventory(lua_State* L) {
static int l_hud_close_inventory(lua_State*) {
if (scripting::hud->isInventoryOpen()) {
scripting::hud->closeInventory();
}
@@ -99,12 +99,12 @@ static int l_hud_close(lua_State* L) {
return 0;
}
static int l_hud_pause(lua_State* L) {
static int l_hud_pause(lua_State*) {
scripting::hud->setPause(true);
return 0;
}
static int l_hud_resume(lua_State* L) {
static int l_hud_resume(lua_State*) {
scripting::hud->setPause(false);
return 0;
}
+1 -1
View File
@@ -24,7 +24,7 @@ static int l_inventory_get(lua_State* L) {
if (slotid < 0 || uint64_t(slotid) >= inv->size()) {
luaL_error(L, "slot index is out of range [0, inventory.size(invid)]");
}
ItemStack& item = inv->getSlot(slotid);
const ItemStack& item = inv->getSlot(slotid);
lua_pushinteger(L, item.getItemId());
lua_pushinteger(L, item.getCount());
return 2;
+2 -2
View File
@@ -50,7 +50,7 @@ static int l_pack_get_available(lua_State* L) {
auto manager = scripting::engine->createPacksManager(worldFolder);
manager.scan();
auto& installed = scripting::engine->getContentPacks();
const auto& installed = scripting::engine->getContentPacks();
for (auto& pack : installed) {
manager.exclude(pack.id);
}
@@ -130,7 +130,7 @@ static int l_pack_get_info(lua_State* L) {
auto content = scripting::engine->getContent();
auto& packs = scripting::engine->getContentPacks();
auto found = std::find_if(packs.begin(), packs.end(), [packid](auto& pack) {
auto found = std::find_if(packs.begin(), packs.end(), [packid](const auto& pack) {
return pack.id == packid;
});
if (found == packs.end()) {