Small performance tweaks
- Tweaked reader to only read head part of bones when using only head tracker
This commit is contained in:
@@ -125,7 +125,7 @@ void CGame::loop() {
|
|||||||
if (player.health <= 0 || player.health > 100) continue;
|
if (player.health <= 0 || player.health > 100) continue;
|
||||||
|
|
||||||
if (config::team_esp && (player.pCSPlayerPawn == localPlayer)) continue;
|
if (config::team_esp && (player.pCSPlayerPawn == localPlayer)) continue;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unused for now, but for a vis check
|
* Unused for now, but for a vis check
|
||||||
*
|
*
|
||||||
@@ -156,6 +156,12 @@ void CGame::loop() {
|
|||||||
player.ReadBones();
|
player.ReadBones();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config::show_head_tracker && !config::show_skeleton_esp) {
|
||||||
|
player.gameSceneNode = process->read<uint64_t>(player.pCSPlayerPawn + 0x310);
|
||||||
|
player.boneArray = process->read<uint64_t>(player.gameSceneNode + 0x160 + 0x80);
|
||||||
|
player.ReadHead();
|
||||||
|
}
|
||||||
|
|
||||||
if (config::show_extra_flags) {
|
if (config::show_extra_flags) {
|
||||||
/*
|
/*
|
||||||
* Reading values for extra flags is now seperated from the other reads
|
* Reading values for extra flags is now seperated from the other reads
|
||||||
@@ -187,12 +193,22 @@ void CGame::loop() {
|
|||||||
players.assign(list.begin(), list.end());
|
players.assign(list.begin(), list.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uintptr_t boneAddress;
|
||||||
|
Vector3 bonePosition;
|
||||||
|
int boneIndex;
|
||||||
|
void CPlayer::ReadHead() {
|
||||||
|
boneAddress = boneArray + 6 * 32;
|
||||||
|
bonePosition = g_game.process->read<Vector3>(boneAddress);
|
||||||
|
bones.bonePositions["head"] = g_game.world_to_screen(&bonePosition);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void CPlayer::ReadBones() {
|
void CPlayer::ReadBones() {
|
||||||
for (const auto& entry : boneMap) {
|
for (const auto& entry : boneMap) {
|
||||||
const std::string& boneName = entry.first;
|
const std::string& boneName = entry.first;
|
||||||
int boneIndex = entry.second;
|
boneIndex = entry.second;
|
||||||
uintptr_t boneAddress = boneArray + boneIndex * 32;
|
boneAddress = boneArray + boneIndex * 32;
|
||||||
Vector3 bonePosition = g_game.process->read<Vector3>(boneAddress);
|
bonePosition = g_game.process->read<Vector3>(boneAddress);
|
||||||
bones.bonePositions[boneName] = g_game.world_to_screen(&bonePosition);
|
bones.bonePositions[boneName] = g_game.world_to_screen(&bonePosition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ public:
|
|||||||
float flashAlpha;
|
float flashAlpha;
|
||||||
std::string weapon;
|
std::string weapon;
|
||||||
void ReadBones();
|
void ReadBones();
|
||||||
|
void ReadHead();
|
||||||
};
|
};
|
||||||
|
|
||||||
class CGame
|
class CGame
|
||||||
|
|||||||
Reference in New Issue
Block a user