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:
parent
08bc036311
commit
5b37614d23
10 changed files with 44 additions and 59 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue