summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWuzzy <wuzzy2@mail.ru>2020-01-22 09:19:27 +0000
committerLoïc Blot <nerzhul@users.noreply.github.com>2020-01-22 10:19:27 +0100
commite05b7dbb3c89ddaf52a4c493a0d05f1ca2244dce (patch)
tree76194e6a7646cffffa9133935a82cd3400466b81 /src
parent3dfb6ecbb26516bcbcc1ef88860175e39af71381 (diff)
downloadminetest-e05b7dbb3c89ddaf52a4c493a0d05f1ca2244dce.tar.gz
minetest-e05b7dbb3c89ddaf52a4c493a0d05f1ca2244dce.tar.bz2
minetest-e05b7dbb3c89ddaf52a4c493a0d05f1ca2244dce.zip
Remove unused weight property from objects (#9320)
Diffstat (limited to 'src')
-rw-r--r--src/content_sao.cpp1
-rw-r--r--src/object_properties.cpp5
-rw-r--r--src/object_properties.h1
-rw-r--r--src/script/common/c_content.cpp4
4 files changed, 2 insertions, 9 deletions
diff --git a/src/content_sao.cpp b/src/content_sao.cpp
index ebda0efc9..43c784b42 100644
--- a/src/content_sao.cpp
+++ b/src/content_sao.cpp
@@ -869,7 +869,6 @@ PlayerSAO::PlayerSAO(ServerEnvironment *env_, RemotePlayer *player_, session_t p
m_prop.hp_max = PLAYER_MAX_HP_DEFAULT;
m_prop.breath_max = PLAYER_MAX_BREATH_DEFAULT;
m_prop.physical = false;
- m_prop.weight = 75;
m_prop.collisionbox = aabb3f(-0.3f, 0.0f, -0.3f, 0.3f, 1.77f, 0.3f);
m_prop.selectionbox = aabb3f(-0.3f, 0.0f, -0.3f, 0.3f, 1.77f, 0.3f);
m_prop.pointable = true;
diff --git a/src/object_properties.cpp b/src/object_properties.cpp
index a037c5f65..4cf180b18 100644
--- a/src/object_properties.cpp
+++ b/src/object_properties.cpp
@@ -37,7 +37,6 @@ std::string ObjectProperties::dump()
os << ", breath_max=" << breath_max;
os << ", physical=" << physical;
os << ", collideWithObjects=" << collideWithObjects;
- os << ", weight=" << weight;
os << ", collisionbox=" << PP(collisionbox.MinEdge) << "," << PP(collisionbox.MaxEdge);
os << ", visual=" << visual;
os << ", mesh=" << mesh;
@@ -77,7 +76,7 @@ void ObjectProperties::serialize(std::ostream &os) const
writeU8(os, 4); // PROTOCOL_VERSION >= 37
writeU16(os, hp_max);
writeU8(os, physical);
- writeF32(os, weight);
+ writeF32(os, 0.f); // Removed property (weight)
writeV3F32(os, collisionbox.MinEdge);
writeV3F32(os, collisionbox.MaxEdge);
writeV3F32(os, selectionbox.MinEdge);
@@ -128,7 +127,7 @@ void ObjectProperties::deSerialize(std::istream &is)
hp_max = readU16(is);
physical = readU8(is);
- weight = readF32(is);
+ readU32(is); // removed property (weight)
collisionbox.MinEdge = readV3F32(is);
collisionbox.MaxEdge = readV3F32(is);
selectionbox.MinEdge = readV3F32(is);
diff --git a/src/object_properties.h b/src/object_properties.h
index 199182d70..3895f3379 100644
--- a/src/object_properties.h
+++ b/src/object_properties.h
@@ -31,7 +31,6 @@ struct ObjectProperties
u16 breath_max = 0;
bool physical = false;
bool collideWithObjects = true;
- float weight = 5.0f;
// Values are BS=1
aabb3f collisionbox = aabb3f(-0.5f, -0.5f, -0.5f, 0.5f, 0.5f, 0.5f);
aabb3f selectionbox = aabb3f(-0.5f, -0.5f, -0.5f, 0.5f, 0.5f, 0.5f);
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp
index fc1d82bcc..ca061c454 100644
--- a/src/script/common/c_content.cpp
+++ b/src/script/common/c_content.cpp
@@ -208,8 +208,6 @@ void read_object_properties(lua_State *L, int index,
getboolfield(L, -1, "physical", prop->physical);
getboolfield(L, -1, "collide_with_objects", prop->collideWithObjects);
- getfloatfield(L, -1, "weight", prop->weight);
-
lua_getfield(L, -1, "collisionbox");
bool collisionbox_defined = lua_istable(L, -1);
if (collisionbox_defined)
@@ -340,8 +338,6 @@ void push_object_properties(lua_State *L, ObjectProperties *prop)
lua_setfield(L, -2, "physical");
lua_pushboolean(L, prop->collideWithObjects);
lua_setfield(L, -2, "collide_with_objects");
- lua_pushnumber(L, prop->weight);
- lua_setfield(L, -2, "weight");
push_aabb3f(L, prop->collisionbox);
lua_setfield(L, -2, "collisionbox");
push_aabb3f(L, prop->selectionbox);