mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-26 02:30:38 +01:00
Merge branch 'master' into NALC2
This commit is contained in:
commit
d9fe75b0e6
6
.gitmodules
vendored
6
.gitmodules
vendored
@ -79,9 +79,6 @@
|
||||
[submodule "mods/weather_pack"]
|
||||
path = mods/weather_pack
|
||||
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"]
|
||||
path = mods/moreplants
|
||||
url = https://github.com/sys4-fr/moreplants.git
|
||||
@ -90,3 +87,6 @@
|
||||
path = mods/moreflowers
|
||||
url = https://github.com/sys4-fr/moreflowers.git
|
||||
branch = master
|
||||
[submodule "mods/unifieddyes"]
|
||||
path = mods/unifieddyes
|
||||
url = https://github.com/minetest-mods/unifieddyes.git
|
||||
|
@ -182,12 +182,35 @@ end)
|
||||
|
||||
function setSprinting(playerName, sprinting) --Sets the state of a player (0=stopped/moving, 1=sprinting)
|
||||
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
|
||||
sprint.players[playerName]["sprinting"] = sprinting
|
||||
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
|
||||
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
|
||||
return true
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user