1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Make entity selection and collision boxes independently settable (#6218)

* Make entity selection and collision boxes independently settable
This commit is contained in:
stujones11 2017-08-24 09:01:16 +01:00 committed by Loïc Blot
parent 01c319d778
commit ac4884c3d6
6 changed files with 38 additions and 9 deletions

View file

@ -346,7 +346,7 @@ GenericCAO::~GenericCAO()
bool GenericCAO::getSelectionBox(aabb3f *toset) const
{
if (!m_prop.is_visible || !m_is_visible || m_is_local_player
|| getParent() != NULL){
|| !m_prop.pointable || getParent() != NULL) {
return false;
}
*toset = m_selection_box;
@ -1226,7 +1226,7 @@ void GenericCAO::processMessage(const std::string &data)
if (cmd == GENERIC_CMD_SET_PROPERTIES) {
m_prop = gob_read_set_properties(is);
m_selection_box = m_prop.collisionbox;
m_selection_box = m_prop.selectionbox;
m_selection_box.MinEdge *= BS;
m_selection_box.MaxEdge *= BS;
@ -1240,7 +1240,10 @@ void GenericCAO::processMessage(const std::string &data)
if (m_is_local_player) {
LocalPlayer *player = m_env->getLocalPlayer();
player->makes_footstep_sound = m_prop.makes_footstep_sound;
player->setCollisionbox(m_selection_box);
aabb3f collision_box = m_prop.collisionbox;
collision_box.MinEdge *= BS;
collision_box.MaxEdge *= BS;
player->setCollisionbox(collision_box);
}
if ((m_is_player && !m_is_local_player) && m_prop.nametag.empty())