Bug fixes
- Fix crashing issues caused by trying to substring weapon_ prefix when it is not there - Hopefully reduce lag by moving C4 esp code outside of entity list loop, fix provided by Tucucu on UC forums
This commit is contained in:
@@ -29,15 +29,6 @@ namespace hack {
|
|||||||
|
|
||||||
const Vector3 localOrigin = process->read<Vector3>(localpCSPlayerPawn + updater::offsets::m_vecOrigin);
|
const Vector3 localOrigin = process->read<Vector3>(localpCSPlayerPawn + updater::offsets::m_vecOrigin);
|
||||||
|
|
||||||
int playerIndex = 0;
|
|
||||||
uintptr_t list_entry;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Loop through all the players in the entity list
|
|
||||||
*
|
|
||||||
* (This could have been done by getting a entity list count from the engine, but I'm too lazy to do that)
|
|
||||||
**/
|
|
||||||
while (true) {
|
|
||||||
bool c4IsPlanted = process->read<bool>(base_client.base + updater::offsets::dwPlantedC4 - 0x8);
|
bool c4IsPlanted = process->read<bool>(base_client.base + updater::offsets::dwPlantedC4 - 0x8);
|
||||||
if (c4IsPlanted)
|
if (c4IsPlanted)
|
||||||
{
|
{
|
||||||
@@ -74,6 +65,17 @@ namespace hack {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int playerIndex = 0;
|
||||||
|
uintptr_t list_entry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loop through all the players in the entity list
|
||||||
|
*
|
||||||
|
* (This could have been done by getting a entity list count from the engine, but I'm too lazy to do that)
|
||||||
|
**/
|
||||||
|
while (true) {
|
||||||
|
|
||||||
|
|
||||||
playerIndex++;
|
playerIndex++;
|
||||||
list_entry = process->read<uintptr_t>(entity_list + (8 * (playerIndex & 0x7FFF) >> 9) + 16);
|
list_entry = process->read<uintptr_t>(entity_list + (8 * (playerIndex & 0x7FFF) >> 9) + 16);
|
||||||
if (!list_entry)
|
if (!list_entry)
|
||||||
@@ -136,6 +138,7 @@ namespace hack {
|
|||||||
char buf[32];
|
char buf[32];
|
||||||
process->read_raw(weaponNameAddress, buf, sizeof(buf));
|
process->read_raw(weaponNameAddress, buf, sizeof(buf));
|
||||||
weaponName = std::string(buf);
|
weaponName = std::string(buf);
|
||||||
|
if (weaponName.compare(0, 7, "weapon_") == 0)
|
||||||
weaponName = weaponName.substr(7, weaponName.length()); // Remove weapon_ prefix
|
weaponName = weaponName.substr(7, weaponName.length()); // Remove weapon_ prefix
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user