Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: place history.scores updates to correct loc #32

Merged
merged 2 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ All other information should be explored by reading the source code!
- [2023/3/27 23:53] fix: use `npc:GetEntityIndex()` and `npc:GetTeam()` to avoid unexpect behaviors.([#27](https://github.com/Escapingbug/dotaxctf/pull/27), reporter: 114@x1ct34m)
- [2023/3/28 09:11] fix: ban nonhero units for hero choosing.([#31](https://github.com/Escapingbug/dotaxctf/pull/31))
- [2023/3/28 09:16] feat: clean up items when round ends.([#30](https://github.com/Escapingbug/dotaxctf/pull/30))
- [2023/3/29 08:46] fix: place history.scores updates to correct loc.([#32](https://github.com/Escapingbug/dotaxctf/pull/32), reporter: AAA剑圣)
11 changes: 6 additions & 5 deletions rounds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ end
]]
function Rounds:FlushScoresAndRunNextRound()
print("[xctf Rounds:FlushRoundScores]" .. "Flushing round scores")

if self.round_count > 0 then
local last_scores = deepcopy(self.scores_this_round)
table.insert(self.history.scores, last_scores)
end

local req = CreateHTTPRequest("POST", Config.server_url.service)
if req == nil then
print("[xctf Rounds:FlushRoundScores]" .. "Failed to create http request")
Expand Down Expand Up @@ -296,11 +302,6 @@ end
function Rounds:NextRound(scripts)
print("[xctf Rounds:NextRound()]" .. "Next Round")

if self.round_count > 0 then
local last_scores = deepcopy(self.scores_this_round)
table.insert(self.history.scores, last_scores)
end

Rounds:CleanupLivingHerosAndClearUnits()
Rounds:ChooseHeros(scripts["chooser_scripts"], scripts["attributes"], scripts["bot_scripts"])
Timers:CreateTimer(
Expand Down