1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-06-28 06:11:47 +02:00

Merge branch 'pipeworks_fix_connected_chests' into NALC2

This commit is contained in:
sys4-fr
2017-04-09 10:59:20 +02:00
9 changed files with 795 additions and 108 deletions

View File

@ -244,7 +244,8 @@ armor.set_player_armor = function(self, player)
armor_groups.radiation = 100 - armor_radiation
end
player:set_armor_groups(armor_groups)
player:set_physics_override(physics_o)
--player:set_physics_override(physics_o)
player_physics.set_stats(player, "3d_armor", {speed=physics_o.speed-1, jump=physics_o.jump-1, gravity=physics_o.gravity-1})
self.textures[name].armor = armor_texture
self.textures[name].preview = preview
self.def[name].state = state

View File

@ -1,4 +1,5 @@
default
player_physics
inventory_plus?
unified_inventory?
fire?

View File

@ -144,6 +144,14 @@ local function punch_filter(data, filtpos, filtnode, msg)
local dir = minetest.facedir_to_right_dir(filtnode.param2)
local frompos = vector.subtract(filtpos, dir)
local fromnode = minetest.get_node(frompos)
-- Fix crash with connected_chests (sys4 fix for MFF)
if fromnode.name == "connected_chests:chest_right" then
local v_mul = vector.multiply(dir, 2)
frompos = vector.subtract(filtpos, v_mul)
fromnode = minetest.get_node(frompos)
end
if not fromnode then return end
local fromdef = minetest.registered_nodes[fromnode.name]
if not fromdef then return end

View File

@ -182,39 +182,12 @@ 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 + bonus_speed,jump=SPRINT_JUMP + bonus_jump})
player_physics.add(player, "speed", "sprint_speed", 0.35+ bonus_speed)
player_physics.add(player, "jump", "sprint_jump", 0.1+ bonus_jump)
player_physics.set_stats(player, "sprint", {speed=SPRINT_SPEED, jump=SPRINT_JUMP})
elseif sprinting == false then
-- player:set_physics_override({speed=1.0 + bonus_speed,jump=1.0 + bonus_jump})
player_physics.add(player, "speed", "sprint_speed", bonus_speed)
player_physics.add(player, "jump", "sprint_jump", bonus_jump)
player_physics.set_stats(player, "sprint", {speed=0, jump=0})
end
return true
end

View File

@ -9,8 +9,8 @@ distributed without any warranty.
--Configuration variables, these are all explained in README.md
SPRINT_METHOD = 1
SPRINT_SPEED = 1.35
SPRINT_JUMP = 1.1
SPRINT_SPEED = 0.35
SPRINT_JUMP = 0.1
SPRINT_STAMINA = 10
SPRINT_TIMEOUT = 0.5 --Only used if SPRINT_METHOD = 0

View File

@ -140,11 +140,11 @@ function setState(playerName, state) --Sets the state of a player (0=stopped, 1=
if players[playerName] then
players[playerName]["state"] = state
if state == 0 then--Stopped
player:set_physics_override({speed=1.0,jump=1.0})
player_physics.set_stats(player, "sprint", {speed=0, jump=0})
elseif state == 2 then --Primed
players[playerName]["timeOut"] = gameTime
elseif state == 3 then --Sprinting
player:set_physics_override({speed=SPRINT_SPEED,jump=SPRINT_JUMP})
player_physics.set_stats(player, "sprint", {speed=SPRINT_SPEED, jump=SPRINT_JUMP})
end
return true
end