Bugfix: (regression) prevent pushing your teammates with the sword
This commit is contained in:
parent
edf453f5fa
commit
ce2e4356b9
@ -59,8 +59,8 @@ weapons_lib.register_weapon("block_league:pixelgun", {
|
||||
block_league.util_update_mag_hud(player:get_player_name(), weapon.name)
|
||||
end,
|
||||
|
||||
on_hit = function(hitter, target, weapon, action, damage, hit_ppint)
|
||||
return block_league.util_on_hit(hitter, target, weapon, action, damage, hit_ppint)
|
||||
on_hit = function(hitter, target, weapon, action, hit_point, damage)
|
||||
return block_league.util_on_hit(hitter, target, weapon, action, hit_point, damage)
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -61,8 +61,8 @@ weapons_lib.register_weapon("block_league:smg", {
|
||||
block_league.util_update_mag_hud(player:get_player_name(), weapon.name)
|
||||
end,
|
||||
|
||||
on_hit = function(hitter, target, weapon, action, damage, hit_ppint)
|
||||
return block_league.util_on_hit(hitter, target, weapon, action, damage, hit_ppint)
|
||||
on_hit = function(hitter, target, weapon, action, hit_point, damage)
|
||||
return block_league.util_on_hit(hitter, target, weapon, action, hit_point, damage)
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -51,8 +51,8 @@ weapons_lib.register_weapon("block_league:sword", {
|
||||
delay = 1.2,
|
||||
sound = "bl_sword_hit",
|
||||
|
||||
on_hit = function(hitter, target, weapon, action, damage, hit_point)
|
||||
return block_league.util_on_hit(hitter, target, weapon, action, damage, hit_point)
|
||||
on_hit = function(hitter, target, weapon, action, hit_point, damage, knockback)
|
||||
return block_league.util_on_hit(hitter, target, weapon, action, hit_point, damage, knockback)
|
||||
end,
|
||||
|
||||
on_end = function(player, weapon, action)
|
||||
|
@ -37,12 +37,14 @@ end
|
||||
|
||||
|
||||
|
||||
function block_league.util_on_hit(hitter, target, weapon, action, damage, hit_point)
|
||||
function block_league.util_on_hit(hitter, target, weapon, action, hit_point, damage, knockback)
|
||||
local p_name = hitter:get_player_name()
|
||||
local is_target_player = target:is_player()
|
||||
local t_name = is_target_player and target:get_player_name() or target:get_luaentity().name
|
||||
|
||||
if not arena_lib.is_player_playing(p_name, "block_league") or (is_target_player and not arena_lib.is_player_playing(t_name, "block_league")) then return 0 end
|
||||
if not arena_lib.is_player_playing(p_name, "block_league")
|
||||
or (is_target_player and not arena_lib.is_player_playing(t_name, "block_league"))
|
||||
then return 0 end
|
||||
|
||||
local arena = arena_lib.get_arena_by_player(p_name)
|
||||
|
||||
@ -66,7 +68,7 @@ function block_league.util_on_hit(hitter, target, weapon, action, damage, hit_po
|
||||
}
|
||||
end
|
||||
|
||||
return damage
|
||||
return damage, knockback
|
||||
end
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user