mirror of
https://github.com/minetest-mods/digtron.git
synced 2024-12-22 20:32:22 +01:00
Fix digtron owner moving twice when standing in front of their digtron (#110)
This commit is contained in:
parent
321444b936
commit
9e6c2db897
3
util.lua
3
util.lua
@ -321,6 +321,8 @@ digtron.damage_creatures = function(player, source_pos, target_pos, amount, item
|
||||
}
|
||||
for _, obj in ipairs(objects) do
|
||||
if obj:is_player() then
|
||||
-- Digtron moving logic handles owner movement
|
||||
if obj:get_player_name() ~= player:get_player_name() then
|
||||
-- See issue #2960 for status of a "set player velocity" method
|
||||
-- instead, knock the player back
|
||||
local newpos = {
|
||||
@ -330,6 +332,7 @@ digtron.damage_creatures = function(player, source_pos, target_pos, amount, item
|
||||
}
|
||||
obj:set_pos(newpos)
|
||||
obj:punch(player, 1.0, damage_def, nil)
|
||||
end
|
||||
else
|
||||
local lua_entity = obj:get_luaentity()
|
||||
if lua_entity ~= nil then
|
||||
|
Loading…
Reference in New Issue
Block a user