gcc warning fix
This commit is contained in:
@@ -380,8 +380,9 @@ void WorldRegions::put(Chunk* chunk){
|
|||||||
// Writing block inventories
|
// Writing block inventories
|
||||||
if (!chunk->inventories.empty()){
|
if (!chunk->inventories.empty()){
|
||||||
uint datasize;
|
uint datasize;
|
||||||
|
auto data = write_inventories(chunk, datasize);
|
||||||
put(chunk->x, chunk->z, REGION_LAYER_INVENTORIES,
|
put(chunk->x, chunk->z, REGION_LAYER_INVENTORIES,
|
||||||
write_inventories(chunk, datasize), datasize, false);
|
std::move(data), datasize, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -360,8 +360,7 @@ void Hud::openPermanent(UiDocument* doc) {
|
|||||||
|
|
||||||
auto invview = std::dynamic_pointer_cast<InventoryView>(root);
|
auto invview = std::dynamic_pointer_cast<InventoryView>(root);
|
||||||
if (invview) {
|
if (invview) {
|
||||||
auto inventory = player->getInventory();
|
invview->bind(player->getInventory(), frontend);
|
||||||
invview->bind(inventory, frontend);
|
|
||||||
}
|
}
|
||||||
add(HudElement(hud_element_mode::permanent, doc, doc->getRoot(), false));
|
add(HudElement(hud_element_mode::permanent, doc, doc->getRoot(), false));
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
#ifndef SRC_HUD_H_
|
#ifndef FRONTEND_HUD_H_
|
||||||
#define SRC_HUD_H_
|
#define FRONTEND_HUD_H_
|
||||||
|
|
||||||
#include "../typedefs.h"
|
#include "../typedefs.h"
|
||||||
|
|
||||||
@@ -162,4 +162,4 @@ public:
|
|||||||
std::shared_ptr<Inventory> getBlockInventory();
|
std::shared_ptr<Inventory> getBlockInventory();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SRC_HUD_H_
|
#endif // FRONTEND_HUD_H_
|
||||||
|
|||||||
@@ -50,8 +50,7 @@ std::shared_ptr<Inventory> Inventories::clone(int64_t id) {
|
|||||||
auto original = get(id);
|
auto original = get(id);
|
||||||
if (original == nullptr)
|
if (original == nullptr)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
auto origptr = reinterpret_cast<const Inventory*>(original.get());
|
auto clone = std::make_shared<Inventory>(*original);
|
||||||
auto clone = std::make_shared<Inventory>(*origptr);
|
|
||||||
clone->setId(level.getWorld()->getNextInventoryId());
|
clone->setId(level.getWorld()->getNextInventoryId());
|
||||||
store(clone);
|
store(clone);
|
||||||
return clone;
|
return clone;
|
||||||
|
|||||||
Reference in New Issue
Block a user