diff --git a/CHANGELOG b/CHANGELOG index 7a6346bde6..f2af3273dd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -44,6 +44,7 @@ Modding: * Added the weapon/summoned/spell ID as parameter 3 to the hit script event (feature request #1599) * Added the damage type flags as parameter 4 to the hit script event * Added support for stopping specific spells using the destroy script command +* Fixed the ^$objontop script variable to not have a leading space and don't repeat 'player' Debugging: diff --git a/src/graphics/data/Mesh.cpp b/src/graphics/data/Mesh.cpp index 5d397bf545..3827169892 100644 --- a/src/graphics/data/Mesh.cpp +++ b/src/graphics/data/Mesh.cpp @@ -165,17 +165,11 @@ long MakeTopObjString(Entity * entity, std::string & dest) { dest = ""; - if(player.pos.x > box.min.x && player.pos.x < box.max.x - && player.pos.z > box.min.z && player.pos.z < box.max.z) { - if(glm::abs(player.pos.y + 160.f - box.min.y) < 50.f) { - dest += " player"; - } - } - for(const Entity & other : entities.inScene(IO_NPC | IO_ITEM)) { if(&other != entity) { if(other.pos.x > box.min.x && other.pos.x < box.max.x && other.pos.z > box.min.z && other.pos.z < box.max.z) { - if(glm::abs(other.pos.y - box.min.y) < 40.f) { + float offset = (&other == entities.player() ? 10.f : 0.f); + if(glm::abs(other.pos.y - offset - box.min.y) < 40.f + offset) { if(dest.length() != 0) { dest += ' '; }