aboutsummaryrefslogtreecommitdiff
path: root/src/player.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-04-11 21:28:04 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-04-11 21:28:04 +0300
commit249c0dc68a107878b7aaca0c8d2dcc3e08862430 (patch)
tree734bb0c1aee5c81d8a4eaa3b9e8efdc179041d21 /src/player.cpp
parent81ac026e1f04f1c40eb246e21e9aac25c8ec8f92 (diff)
downloadminetest-249c0dc68a107878b7aaca0c8d2dcc3e08862430.tar.gz
minetest-249c0dc68a107878b7aaca0c8d2dcc3e08862430.tar.bz2
minetest-249c0dc68a107878b7aaca0c8d2dcc3e08862430.zip
Fixed some problems with crafting and inventory
Diffstat (limited to 'src/player.cpp')
-rw-r--r--src/player.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/player.cpp b/src/player.cpp
index 3bde8a563..8f594eee6 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -32,6 +32,7 @@ Player::Player():
in_water(false),
in_water_stable(false),
swimming_up(false),
+ craftresult_is_preview(true),
peer_id(PEER_ID_INEXISTENT),
m_pitch(0),
m_yaw(0),
@@ -100,6 +101,7 @@ void Player::serialize(std::ostream &os)
args.setFloat("pitch", m_pitch);
args.setFloat("yaw", m_yaw);
args.setV3F("position", m_position);
+ args.setBool("craftresult_is_preview", craftresult_is_preview);
args.writeLines(os);
@@ -131,6 +133,11 @@ void Player::deSerialize(std::istream &is)
m_pitch = args.getFloat("pitch");
m_yaw = args.getFloat("yaw");
m_position = args.getV3F("position");
+ try{
+ craftresult_is_preview = args.getBool("craftresult_is_preview");
+ }catch(SettingNotFoundException &e){
+ craftresult_is_preview = true;
+ }
inventory.deSerialize(is);
}