diff options
author | TeTpaAka <TeTpaAka@users.noreply.github.com> | 2015-05-29 20:30:55 +0200 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2017-07-21 02:03:22 +0100 |
commit | 49920cfe8dc7869bb8235c6fe2b8ef26e2a523ca (patch) | |
tree | 4ef6f620933a5af6e845bf5cb2a4c448331bb5b1 /src/content_sao.cpp | |
parent | 5045bdc6d81445ecf600ff9c268886cada935a7f (diff) | |
download | minetest-49920cfe8dc7869bb8235c6fe2b8ef26e2a523ca.tar.gz minetest-49920cfe8dc7869bb8235c6fe2b8ef26e2a523ca.tar.bz2 minetest-49920cfe8dc7869bb8235c6fe2b8ef26e2a523ca.zip |
Player collisionbox: Make settable
Breaks compatibility with old clients.
Diffstat (limited to 'src/content_sao.cpp')
-rw-r--r-- | src/content_sao.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 5bbbd154d..df5cae34f 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -784,7 +784,7 @@ PlayerSAO::PlayerSAO(ServerEnvironment *env_, RemotePlayer *player_, u16 peer_id m_prop.hp_max = PLAYER_MAX_HP; m_prop.physical = false; m_prop.weight = 75; - m_prop.collisionbox = aabb3f(-0.3f, -1.0f, -0.3f, 0.3f, 0.75f, 0.3f); + m_prop.collisionbox = aabb3f(-0.3f, 0.0f, -0.3f, 0.3f, 1.77f, 0.3f); // start of default appearance, this should be overwritten by LUA m_prop.visual = "upright_sprite"; m_prop.visual_size = v2f(1, 2); @@ -856,7 +856,7 @@ std::string PlayerSAO::getClientInitializationData(u16 protocol_version) os << serializeString(m_player->getName()); // name writeU8(os, 1); // is_player writeS16(os, getId()); //id - writeV3F1000(os, m_base_position + v3f(0,BS*1,0)); + writeV3F1000(os, m_base_position); writeF1000(os, m_yaw); writeS16(os, getHP()); @@ -1009,7 +1009,7 @@ void PlayerSAO::step(float dtime, bool send_recommended) if(isAttached()) // Just in case we ever do send attachment position too pos = m_env->getActiveObject(m_attachment_parent_id)->getBasePosition(); else - pos = m_base_position + v3f(0,BS*1,0); + pos = m_base_position; std::string str = gob_cmd_update_position( pos, v3f(0,0,0), @@ -1414,7 +1414,9 @@ bool PlayerSAO::checkMovementCheat() bool PlayerSAO::getCollisionBox(aabb3f *toset) const { - *toset = aabb3f(-0.3f * BS, 0.0f, -0.3f * BS, 0.3f * BS, 1.75f * BS, 0.3f * BS); + //update collision box + toset->MinEdge = m_prop.collisionbox.MinEdge * BS; + toset->MaxEdge = m_prop.collisionbox.MaxEdge * BS; toset->MinEdge += m_base_position; toset->MaxEdge += m_base_position; |