1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-05 19:31:04 +00:00

Use unique_ptr for trivial ownership (#16300)

This commit is contained in:
Lucas OH 2025-07-03 17:32:46 +02:00 committed by GitHub
parent 08bc036311
commit 5b37614d23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 44 additions and 59 deletions

View file

@ -311,7 +311,7 @@ void Client::handleCommand_BlockData(NetworkPacket* pkt)
}
if (m_localdb) {
ServerMap::saveBlock(block, m_localdb);
ServerMap::saveBlock(block, m_localdb.get());
}
/*
@ -335,9 +335,8 @@ void Client::handleCommand_Inventory(NetworkPacket* pkt)
m_update_wielded_item = true;
delete m_inventory_from_server;
m_inventory_from_server = new Inventory(player->inventory);
m_inventory_from_server_age = 0.0;
m_inventory_from_server = std::make_unique<Inventory>(player->inventory);
m_inventory_from_server_age = 0.0f;
}
void Client::handleCommand_TimeOfDay(NetworkPacket* pkt)