aa6 / minetest_wadsprint

Minetest mod for sprinting with W, A and D buttons.
GNU Affero General Public License v3.0
5 stars 1 forks source link

Broken if used together with christmas #2

Open rusty-snake opened 4 years ago

rusty-snake commented 4 years ago

If the christmas mod and this mod are enabled in a world, the player does not change its speed when "sprinting".

aa6 commented 4 years ago

It looks like the christmas mod is constantly resetting player physics for its own purposes each tick. Its functions.lua contains the next code:

local t = 0
minetest.register_globalstep (function(dtime)
    t = t + dtime
    if t > 1 then 
        t = 0
    end
    for _, player in ipairs(minetest.get_connected_players()) do
        local p = xplayer(player)
        if p.time > 0 and t > 1-dtime then
            p.time = p.time - 1
            player:hud_change(p.hud.time, "text", "SUGAR RUSH!!\n~~"..christmas.to_time(p.time).."~~")
        elseif math.floor(p.time) == 1 then
            p.candy = 0
        end
        if p.time > 0 then
            player:set_physics_override({
                speed = 2.5,
            })
        end
        --minetest.chat_send_all(p.candy)
        if p.time == 0 then
            player:set_physics_override({
                speed = 1,
            })
            player:hud_remove(p.hud.ui)
            player:hud_remove(p.hud.icon)
            player:hud_remove(p.hud.time)
        end
    end
end)

Unsure what can be done on my side to solve this.

rusty-snake commented 4 years ago

I removed the christmas mod from my system, since I have to much mods for my hardware. Feel free to close. I was just surprised that a decorative mod cause something like this.

aa6 commented 4 years ago

It would have been nice if it supported player_monoids.

aa6 commented 4 years ago

Let it will be open for a while. I'll think about what can be done.