File tree Expand file tree Collapse file tree 2 files changed +2
-0
lines changed Expand file tree Collapse file tree 2 files changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ type Player struct {
3131 ViewDirectionY float32
3232 FlashDuration float32 // Blindness duration from the flashbang currently affecting the player (seconds)
3333 Team Team
34+ TeamState * TeamState // When keeping the reference make sure you notice when the player changes teams
3435 IsBot bool
3536 IsDucking bool
3637 IsDefusing bool
Original file line number Diff line number Diff line change @@ -203,6 +203,7 @@ func (p *Parser) bindNewPlayer(playerEntity *st.Entity) {
203203 // General info
204204 playerEntity .FindProperty ("m_iTeamNum" ).OnUpdate (func (val st.PropertyValue ) {
205205 pl .Team = common .Team (val .IntVal ) // Need to cast to team so we can't use BindProperty
206+ pl .TeamState = p .gameState .Team (pl .Team )
206207 })
207208 playerEntity .BindProperty ("m_iHealth" , & pl .Hp , st .ValTypeInt )
208209 playerEntity .BindProperty ("m_ArmorValue" , & pl .Armor , st .ValTypeInt )
You can’t perform that action at this time.
0 commit comments