Skip to content

Commit d2da2c1

Browse files
authored
Merge pull request #21 from Escapingbug/sandbox-candidate-id
2 parents 4199443 + f7f832c commit d2da2c1

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@ All other information should be explored by reading the source code!
5151
## Changelog
5252

5353
- [2023/3/21 21:13] fix: remove shop and spawn heros as a circle.([#20](https://github.com/Escapingbug/dotaxctf/pull/20))
54+
- [2023/3/21 22:00] feat: support getting hero's candidate id.([#21](https://github.com/Escapingbug/dotaxctf/pull/21))

rounds.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ function Rounds:ChooseHeros(chooser_scripts, attributes)
356356

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

359+
candidate_hero.candidate_id = candidate_id
359360
Rounds:InitCandidateHero(candidate_hero, attributes[candidate_id])
360361
self.heros[candidate_id] = candidate_hero
361362
choices[candidate_id] = hero_name

sandbox.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ function Sandbox:SandboxHero(hero, readonly)
9595
sandboxed.GetStrength = copy_method(hero, "GetStrength")
9696
sandboxed.GetGold = copy_method(hero, "GetGold")
9797

98+
sandboxed.candidate_id = hero.candidate_id
99+
98100
-- TODO: level up
99101

100102
return sandboxed

0 commit comments

Comments
 (0)