Fix ctf scrolling
with lag, a player was able to scroll past the max, which cause the server to crash,should be fixed now. (hard to debug locally, with no lag)
This commit is contained in:
parent
f748d99908
commit
386be9fb14
@ -317,15 +317,17 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
cur_team = tname
|
||||
end
|
||||
if fields.scroll_up then
|
||||
if scroll_diplomacy > 0 then
|
||||
scroll_diplomacy = scroll_diplomacy - 1
|
||||
if scroll_diplomacy < 0 then
|
||||
else
|
||||
scroll_diplomacy = 0
|
||||
end
|
||||
ctf.gui.show(name, "diplo", cur_team)
|
||||
end
|
||||
if fields.scroll_down then
|
||||
if scroll_diplomacy < (scroll_max+5) then
|
||||
scroll_diplomacy = scroll_diplomacy + 1
|
||||
if scroll_diplomacy > (scroll_max+5) then
|
||||
else
|
||||
scroll_diplomacy = scroll_max
|
||||
end
|
||||
ctf.gui.show(name, "diplo", cur_team)
|
||||
|
Loading…
x
Reference in New Issue
Block a user