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: panic on bot_takeover events #491

Merged
merged 1 commit into from
Jan 8, 2024
Merged

fix: panic on bot_takeover events #491

merged 1 commit into from
Jan 8, 2024

Conversation

akiver
Copy link
Collaborator

@akiver akiver commented Dec 30, 2023

The demo from this issue has the problem described and fixed in this PR.

The other PR fixes the first panic, but another happens due to a missing prop when a player takes control of a bot.

The prop m_iControlledBotEntIndex expected in player.ControlledBot() doesn't exist in CS2 demos.
As a replacement I use the prop m_hOriginalControllerOfCurrentPawn.

I also had to change the signature of FindPlayerByHandle to FindPlayerByHandle(handle uint64) *Player since the controllers are uin64 values.

Copy link

codecov bot commented Dec 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0ac0c4b) 80.67% compared to head (60a3075) 80.67%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #491   +/-   ##
=======================================
  Coverage   80.67%   80.67%           
=======================================
  Files          47       47           
  Lines        6327     6330    +3     
=======================================
+ Hits         5104     5107    +3     
  Misses       1014     1014           
  Partials      209      209           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants