Skip to content

Commit 86881d2

Browse files
author
Esben Glavind Clausen
committed
Source 2: Fixed Player.Armor() sometimes being a few ticks outdated. Experiments show that m_iPawnArmor on the Player entity tends to be updated a few ticks later than m_ArmorValue of the Pawn entity.
1 parent 905ddfc commit 86881d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/demoinfocs/common/player.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ func (p *Player) Health() int {
363363
// Armor returns the player's armor points, normally 0-100.
364364
func (p *Player) Armor() int {
365365
if p.demoInfoProvider.IsSource2() {
366-
return getInt(p.Entity, "m_iPawnArmor")
366+
return getInt(p.PlayerPawnEntity(), "m_ArmorValue")
367367
}
368368

369369
return getInt(p.Entity, "m_ArmorValue")

0 commit comments

Comments
 (0)