Fix: crash in remove_hits func

master
Coder12a 2020-08-06 15:36:12 -05:00
parent 24525e14a1
commit f9511d38fe
2 changed files with 10 additions and 8 deletions

View File

@ -316,7 +316,7 @@ Used to multiply wear from any tool blocking or shielding.
pvp_revamped.block_wear_mul = 9000
```
#### Effects
#### effects
Value is used to decrease the chance of disarming another player.
``` lua
pvp_revamped.disarm_chance_mul = 2

View File

@ -806,14 +806,16 @@ if sscsm then
local function remove_hits(name)
local hit_data = get_player_data(name).hit
for i = #hit_data, 1, -1 do
local data = hit_data[i]
if hit_data then
for i = #hit_data, 1, -1 do
local data = hit_data[i]
if not data.resolved then
local count = #hit_data
hit_data[i] = hit_data[count]
hit_data[count] = nil
if not data.resolved then
local count = #hit_data
hit_data[i] = hit_data[count]
hit_data[count] = nil
end
end
end
end