Fix another crash.
This commit is contained in:
parent
c54579e426
commit
a7ed39131c
3 changed files with 8 additions and 4 deletions
|
|
@ -60,7 +60,7 @@ function artifact.play_sound(def)
|
|||
--def.gain = nil
|
||||
if def.pos then
|
||||
for _, m in pairs(artifact.players) do
|
||||
local dist = m.pos:distance(def.pos)
|
||||
local dist = vector.distance(m.pos, def.pos)
|
||||
if dist <= (def.range or 32) and m.name ~= def.exclude_player and not (def.to_player and m.name ~= def.to_player) then
|
||||
def.to_player = m.name
|
||||
def.gain = (def.gain or 1) *(1 -math.sqrt(dist /(def.range or 32)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue