Poikilos / EnlivenMinetest

Minetest engine server management tools and ENLIVEN game installer/updater
Other
3 stars 0 forks source link

The signs_lib signs (in the default:* namespace) always show text facing south, floating if sign is not facing south. #418

Open Poikilos opened 3 years ago

Poikilos commented 3 years ago

:edit: This only affects classic for some reason. Note that the text itself is an entity, so there may be an issue in classic with setting entity, or a breaking change in the engine which is assumed by signs_lib (The issue doesn't occur in Finetest). Also note that the issue doesn't occur in the zahyest world, but the default and signs_lib are identical to the tested copy other than spacing and some additions such as mese post, multiply_texture, and other unrelated additions.

affected nodes

The player can craft two wall signs that are affected. They transform into the subtypes listed under them below depending on whether they are placed on top of or on the bottom of a node rather than on a wall. All 6 nodes are affected by the issue.

All nodes listed above have the issue (tested in bucket_game 211107c).

Reproduce the issue

Up-down facing sign failures

The following nodes don't show text on them when they are placed on the ceiling or floor, but work in all other cases:

Signs known to not have the issue

Related issues

Poikilos commented 7 months ago

It can be solved in one of two ways: in minetest/src/script/lua_api/l_object.cpp change:

int ObjectRef::l_set_rotation(lua_State *L)
{
-    NO_MAP_LOCK_REQUIRED;
-    return 0;
+    // ^ This is a ~2019 MT5 feature, so above stub was the former code.
+    // code below is from Finetest:
+    NO_MAP_LOCK_REQUIRED;
+    ObjectRef *ref = checkobject(L, 1);
+    LuaEntitySAO *entitysao = getluaobject(ref);
+    if (entitysao == nullptr)
+        return 0;
+
+    v3f rotation = check_v3f(L, 2) * core::RADTODEG;
+
+    // entitysao->setRotation(rotation);
+    // ‘class LuaEntitySAO’ has no member named ‘setRotation’ in MT4, so:
+    entitysao->setYaw(rotation.Y);
+    return 0;

or (backward compatible): signs_lib.spawn_entity function

in signs_lib/api.lua

-        obj:set_rotation({x = pitch, y = yaw, z=0})
+        if obj.setyaw then
+            obj:setyaw(yaw)
+        else
+            obj:set_rotation({x = pitch, y = yaw, z=0})  -- exists in some version of classic but is a stub (no op)
+        end