Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pova support #51

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ stamina = {}
local modname = minetest.get_current_modname()
local armor_mod = minetest.get_modpath("3d_armor") and minetest.global_exists("armor") and armor.def
local player_monoids_mod = minetest.get_modpath("player_monoids") and minetest.global_exists("player_monoids")
local pova_mod = minetest.get_modpath("pova") and minetest.global_exists("pova")

function stamina.log(level, message, ...)
return minetest.log(level, ("[%s] %s"):format(modname, message:format(...)))
Expand Down Expand Up @@ -264,6 +265,15 @@ function stamina.set_sprinting(player, sprinting)
player_monoids.speed:del_change(player, "stamina:physics")
player_monoids.jump:del_change(player, "stamina:physics")
end
elseif pova_mod then
if sprinting then
pova.add_override(player:get_player_name(), "stamina:physics",
{speed = settings.sprint_speed, jump = settings.sprint_jump})
pova.do_override(player)
else
pova.del_override(player:get_player_name(), "stamina:physics")
pova.do_override(player)
end
else
local def
if armor_mod then
Expand Down
2 changes: 1 addition & 1 deletion mod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ title = Stamina
description = Adds stamina and hunger effects.
min_minetest_version = 5.4
depends = default
optional_depends = 3d_armor, player_monoids
optional_depends = 3d_armor, player_monoids, pova