Move flag-bearer slowdown to a separate speed modifier (#601)

Improves separation; less prone to error
This commit is contained in:
ANAND 2020-05-01 11:42:16 +05:30 committed by GitHub
parent bc46f56852
commit c44827f2f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View file

@ -111,13 +111,8 @@ function ctf_classes.update(player)
set_max_hp(player, class.properties.max_hp)
ctf_classes.set_skin(player, color, class)
local speed = class.properties.speed
if ctf_flag.has_flag(name) and speed > 0.9 then
speed = 0.9
end
physics.set(player:get_player_name(), "ctf_classes:speed", {
speed = speed,
speed = class.properties.speed,
})
crafting.lock_all(player:get_player_name())