Splizard / minetest-mod-snow

Adds snow biomes to Minetest.
http://splizard.com/minetest/mods/snow-biomes/
Other
10 stars 9 forks source link

Various bugs/typos #43

Open axcore opened 1 year ago

axcore commented 1 year ago

Several of these notes are aimed at someone who wants to fork the mod, or re-use its contents.

Minor bugs:

Minor typos:

axcore commented 3 months ago

17 complains that the player sometimes gets stuck mounted on the sledge. I have investigated that, and found a workaround, which is to add the following code in sled.lua, just after the call to sled:on_activate()

function sled:on_deactivate(removal)
    if not self.driver then
        return
    end
    local player = minetest.get_player_by_name(self.driver)
    if player then
        leave_sled(self, player)
    end
end

More technical explanation:

Especially in 3rd person view, clicking the ground both mounts the sledge and punches the sledge (if it's at the punched location). This is what causes the player to get stuck in a seated position. A full fix would modify sled:on_punch() to do nothing, if the player had mounted the sledge within (say) the last 0.5 seconds. My workaround above works just fine, though.

Specifically, the sequence of calls is:

:on_activate
:get_staticdata
:on_rightclick
:on_step
:on_punch
:on_deactivate

(On the understanding that this mod is abandoned, I'm posting all fixes here in this thread, for the benefit of anyone who might want to fork the mod.)

axcore commented 3 months ago

After mounting the sled, it is invisible because the code places it beneath the ground. An acceptable workaround is to replace this line in sled.lua:

self.object:set_attach(player, "", {x=0,y=-9,z=0}, {x=0,y=90,z=0})

With this one:

self.object:set_attach(player, "", {x=0,y=1,z=0}, {x=0,y=90,z=0})

Unfortunately, even after this change, the character animation places the character slightly below the top of the sled, and the rails of the sled are slightly below the ground. This one-line workaround isn't perfect, but is still an improvement and it doesn't require creating new character animations.

Splizard commented 3 months ago

The project is certainly open to adopting a new maintainer if anybody is looking to develop this mod into the future.