diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-01-27 08:59:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-27 08:59:30 +0100 |
commit | b7a98e98500402c3bbdb6d56d0fe42b4f5b3cedb (patch) | |
tree | cc45c9609f5e0fe7714e33615b0defe5d42f4840 /src/content_sao.cpp | |
parent | 2a8953107181b4df6ff55d0ae214490575609f49 (diff) | |
download | minetest-b7a98e98500402c3bbdb6d56d0fe42b4f5b3cedb.tar.gz minetest-b7a98e98500402c3bbdb6d56d0fe42b4f5b3cedb.tar.bz2 minetest-b7a98e98500402c3bbdb6d56d0fe42b4f5b3cedb.zip |
Implement player attribute backend (#4155)
* This backend permit mods to store extra players attributes to a common interface.
* Add the obj:set_attribute(attr, value) Lua call
* Add the obj:get_attribute(attr) Lua call
Examples:
* player:set_attribute("home:home", "10,25,-78")
* player:get_attribute("default:mana")
Attributes are saved as a json in the player file in extended_attributes
key
They are saved only if a modification on the attributes occurs and loaded
when emergePlayer is called (they are attached to PlayerSAO).
Diffstat (limited to 'src/content_sao.cpp')
-rw-r--r-- | src/content_sao.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/content_sao.cpp b/src/content_sao.cpp index bb62aea7d..35133490e 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -791,6 +791,7 @@ PlayerSAO::PlayerSAO(ServerEnvironment *env_, u16 peer_id_, bool is_singleplayer m_pitch(0), m_fov(0), m_wanted_range(0), + m_extended_attributes_modified(false), // public m_physics_override_speed(1), m_physics_override_jump(1), |