Refactoring and bug fixes in ESP and spectators list handling #132
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The changes primarily focus on refactoring and fixing bugs in the handling of ESP and spectators list.
In the
observer.rs
file, in thecreate
function, the 'target_controller_entity_id', which represented 'EntityHandle.get_entity_index()', was replaced by 'target_entity_handle_index', which representsEntityHandle<C_BaseEntity>.value
. This adjustment was made becauseobserver_target
can now also beC_PlantedC4
.The check for matching target entities has been updated to use
observer_target_handle.value
. I am not sure that this is optimal, as I don't even know what the 'serial_number` represents, so I will be happy to hear your opinion.In the
player.rs
file, the local player controller is now fetched directly using theget_local_player_controller
function and is used to updatelocal_team_id
.The code for fetching the local player's pawn position has been removed. The distance calculation for each player now uses
view_world_position
instead oflocal_pos
.In the
world.rs
file, a new functionget_view_world_position
has been added to theViewController
structure. This function calculates the world position based on the view matrix.