File tree 2 files changed +9
-5
lines changed
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,13 @@ local function timer_func(time_left)
47
47
timer = minetest .after (1 , timer_func , time_left - 1 )
48
48
end
49
49
50
+ function ctf_modebase .build_timer .start (build_time )
51
+ local time = build_time or ctf_modebase :get_current_mode ().build_timer or DEFAULT_BUILD_TIME
52
+
53
+ if time > 0 then
54
+ timer = timer_func (time )
55
+ end
56
+ end
50
57
51
58
function ctf_modebase .build_timer .finish ()
52
59
if timer == nil then return end
@@ -76,10 +83,6 @@ function ctf_modebase.build_timer.finish()
76
83
end
77
84
end
78
85
79
- ctf_api .register_on_new_match (function ()
80
- timer = minetest .after (1 , timer_func , ctf_modebase :get_current_mode ().build_timer or DEFAULT_BUILD_TIME )
81
- end )
82
-
83
86
ctf_api .register_on_match_end (function ()
84
87
if timer == nil then return end
85
88
timer :cancel ()
@@ -119,4 +122,3 @@ minetest.register_chatcommand("ctf_start", {
119
122
return true , " Build time ended"
120
123
end ,
121
124
})
122
-
Original file line number Diff line number Diff line change @@ -464,6 +464,8 @@ return {
464
464
minetest .after (math.max (0 , LOADING_SCREEN_TARGET_TIME - total_time ), function ()
465
465
hud :clear_all ()
466
466
set_playertags_state (PLAYERTAGS_ON )
467
+
468
+ ctf_modebase .build_timer .start ()
467
469
end )
468
470
end
469
471
end ,
You can’t perform that action at this time.
0 commit comments