- if not texture then
- obj:set_properties({
- mesh = def.entity_info.mesh,
- visual_size = text_scale,
- })
- else
- obj:set_properties({
- mesh = def.entity_info.mesh,
- visual_size = text_scale,
- textures={texture},
- })
+ if not string.find(node.name, "onpole") and not string.find(node.name, "hanging") then
+ local rot90 = math.pi/2
+
+ if def.paramtype2 == "wallmounted" then
+ if node.param2 == 1 then -- on floor
+ pitch = -rot90
+ yaw = 0
+ elseif node.param2 == 0 then -- on ceiling
+ pitch = rot90
+ yaw = math.pi
+ end
+ elseif def.paramtype2 == "facedir" then
+ if node.param2 == 4 then
+ pitch = -rot90
+ yaw = 0
+ elseif node.param2 == 6 then
+ pitch = rot90
+ yaw = math.pi
+ end
+ end
+ end
+
+ if yaw then
+ obj:set_rotation({x = pitch, y = yaw, z=0})
+
+ if not texture then
+ obj:set_properties({
+ mesh = def.entity_info.mesh,
+ visual_size = text_scale,
+ })
+ else
+ obj:set_properties({
+ mesh = def.entity_info.mesh,
+ visual_size = text_scale,
+ textures={texture},
+ })
+ end