1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-26 18:50:38 +01:00

Merge branch 'master' into NALC2

This commit is contained in:
sys4-fr 2017-04-03 16:34:56 +02:00
commit d9fe75b0e6
2 changed files with 28 additions and 5 deletions

6
.gitmodules vendored
View File

@ -79,9 +79,6 @@
[submodule "mods/weather_pack"] [submodule "mods/weather_pack"]
path = mods/weather_pack path = mods/weather_pack
url = https://github.com/xeranas/weather_pack.git url = https://github.com/xeranas/weather_pack.git
[submodule "mods/unifieddyes"]
path = mods/unifieddyes
url = https://github.com/minetest-mods/unifieddyes.git
[submodule "mods/moreplants"] [submodule "mods/moreplants"]
path = mods/moreplants path = mods/moreplants
url = https://github.com/sys4-fr/moreplants.git url = https://github.com/sys4-fr/moreplants.git
@ -90,3 +87,6 @@
path = mods/moreflowers path = mods/moreflowers
url = https://github.com/sys4-fr/moreflowers.git url = https://github.com/sys4-fr/moreflowers.git
branch = master branch = master
[submodule "mods/unifieddyes"]
path = mods/unifieddyes
url = https://github.com/minetest-mods/unifieddyes.git

View File

@ -182,12 +182,35 @@ end)
function setSprinting(playerName, sprinting) --Sets the state of a player (0=stopped/moving, 1=sprinting) function setSprinting(playerName, sprinting) --Sets the state of a player (0=stopped/moving, 1=sprinting)
local player = minetest.get_player_by_name(playerName) local player = minetest.get_player_by_name(playerName)
local bonus_speed = 0
local bonus_jump = 0
if minetest.get_modpath("3d_armor") then
local player_inv = player:get_inventory()
if player_inv then
for i=1, player_inv:get_size("armor") do
local stack = player_inv:get_stack("armor", i)
if stack:get_count() > 0 then
local def = stack:get_definition()
if def and def.groups then
if def.groups["physics_speed"] then
bonus_speed = bonus_speed + def.groups["physics_speed"]
end
if def.groups["physics_jump"] then
bonus_jump = bonus_jump + def.groups["physics_jump"]
end
end
end
end
end
end
if sprint.players[playerName] then if sprint.players[playerName] then
sprint.players[playerName]["sprinting"] = sprinting sprint.players[playerName]["sprinting"] = sprinting
if sprinting == true then if sprinting == true then
player:set_physics_override({speed=SPRINT_SPEED,jump=SPRINT_JUMP}) player:set_physics_override({speed=SPRINT_SPEED + bonus_speed,jump=SPRINT_JUMP + bonus_jump})
elseif sprinting == false then elseif sprinting == false then
player:set_physics_override({speed=1.0,jump=1.0}) player:set_physics_override({speed=1.0 + bonus_speed,jump=1.0 + bonus_jump})
end end
return true return true
end end