Skip to content
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 @@ -51,3 +51,4 @@ All other information should be explored by reading the source code!
## Changelog

- [2023/3/21 21:13] fix: remove shop and spawn heros as a circle.([#20](https://github.com/Escapingbug/dotaxctf/pull/20))
- [2023/3/21 22:00] feat: support getting hero's candidate id.([#21](https://github.com/Escapingbug/dotaxctf/pull/21))
1 change: 1 addition & 0 deletions rounds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ function Rounds:ChooseHeros(chooser_scripts, attributes)

print("[xctf Rounds:ChooseHeros()]" .. "check player and team .. " .. tostring(candidate_hero:GetPlayerID()) .. " " .. tostring(candidate_hero:GetTeam()))

candidate_hero.candidate_id = candidate_id
Rounds:InitCandidateHero(candidate_hero, attributes[candidate_id])
self.heros[candidate_id] = candidate_hero
choices[candidate_id] = hero_name
Expand Down
2 changes: 2 additions & 0 deletions sandbox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ function Sandbox:SandboxHero(hero, readonly)
sandboxed.GetStrength = copy_method(hero, "GetStrength")
sandboxed.GetGold = copy_method(hero, "GetGold")

sandboxed.candidate_id = hero.candidate_id

-- TODO: level up

return sandboxed
Expand Down