mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fixed handling of inventory in creative mode (normal inventory is not trashed anymore), fixed mese pick speed, added some forgotten stuff
This commit is contained in:
parent
4ccc99b291
commit
8e1eacf3a8
13 changed files with 89 additions and 3 deletions
|
@ -29,6 +29,7 @@ Player::Player():
|
|||
in_water(false),
|
||||
in_water_stable(false),
|
||||
swimming_up(false),
|
||||
inventory_backup(NULL),
|
||||
craftresult_is_preview(true),
|
||||
hp(20),
|
||||
peer_id(PEER_ID_INEXISTENT),
|
||||
|
@ -43,6 +44,7 @@ Player::Player():
|
|||
|
||||
Player::~Player()
|
||||
{
|
||||
delete inventory_backup;
|
||||
}
|
||||
|
||||
void Player::resetInventory()
|
||||
|
@ -106,8 +108,13 @@ void Player::serialize(std::ostream &os)
|
|||
args.writeLines(os);
|
||||
|
||||
os<<"PlayerArgsEnd\n";
|
||||
|
||||
inventory.serialize(os);
|
||||
|
||||
// If actual inventory is backed up due to creative mode, save it
|
||||
// instead of the dummy creative mode inventory
|
||||
if(inventory_backup)
|
||||
inventory_backup->serialize(os);
|
||||
else
|
||||
inventory.serialize(os);
|
||||
}
|
||||
|
||||
void Player::deSerialize(std::istream &is)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue