mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 12:01:50 +00:00
propogate player smart-pointer usage
This commit is contained in:
parent
7c6b52cb2a
commit
0b31a19f47
5 changed files with 9 additions and 9 deletions
|
|
@ -559,11 +559,11 @@ bool WorldFiles::readWorldInfo(World* world) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void WorldFiles::writePlayer(Player* player) {
|
||||
void WorldFiles::writePlayer(std::shared_ptr<Player> player) {
|
||||
files::write_json(getPlayerFile(), player->serialize().release());
|
||||
}
|
||||
|
||||
bool WorldFiles::readPlayer(Player* player) {
|
||||
bool WorldFiles::readPlayer(std::shared_ptr<Player> player) {
|
||||
fs::path file = getPlayerFile();
|
||||
if (!fs::is_regular_file(file)) {
|
||||
std::cerr << "warning: player.json does not exists" << std::endl;
|
||||
|
|
|
|||
|
|
@ -143,13 +143,13 @@ public:
|
|||
chunk_inventories_map fetchInventories(int x, int z);
|
||||
|
||||
bool readWorldInfo(World* world);
|
||||
bool readPlayer(Player* player);
|
||||
bool readPlayer(std::shared_ptr<Player> player);
|
||||
|
||||
void writeRegion(int x, int y,
|
||||
WorldRegion* entry,
|
||||
fs::path file,
|
||||
int layer);
|
||||
void writePlayer(Player* player);
|
||||
void writePlayer(std::shared_ptr<Player> player);
|
||||
/* @param world world info to save (nullable) */
|
||||
void write(const World* world, const Content* content);
|
||||
void writePacks(const World* world);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue