mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-26 02:30:38 +01:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
255064a689
@ -139,7 +139,7 @@ hudbars_start_offset_right_y = -100
|
||||
# Mysql Auth, config file path
|
||||
mysql_auth.cfgfile = /home/quentinbd/mysql_auth/mff-classic_config
|
||||
# CHRISTMAS_CRAFT, active snow when winter(december/january)
|
||||
is_winter = true
|
||||
is_winter = false
|
||||
|
||||
### IRC CHAT ###
|
||||
################
|
||||
|
@ -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