Teleporter countdown

This commit is contained in:
LightCat 2018-09-02 12:49:30 +02:00
parent c9181bc9f7
commit 08769e165e
5 changed files with 33 additions and 18 deletions

3
TODO
View File

@ -48,7 +48,6 @@ add Spectator Silent for projectile weapons // //
// //
Cheat status menu (A gui to display enabled/disabled states of user settings for when the menu is off) // //
// //
add teleporter count down // //
// //
// //
Make ubercharge esp color RGB when fully charged // //
@ -61,7 +60,7 @@ ESP Icons // //
ESP Distance sort // //
Show sapped buildings in ESP // // // //
carrying esp // //
Tracers/Spy Cam // //
Spy Cam // //
// //
//------------------------------------------------------------------------------------------------------------------// //
// //

View File

@ -65,6 +65,7 @@ public:
offset_t iUpgradeLevel;
offset_t m_hBuilder;
offset_t m_iObjectType;
offset_t m_bMiniBuilding;
offset_t m_bBuilding;
offset_t m_iTeleState;
offset_t m_flTeleRechargeTime;

View File

@ -168,7 +168,7 @@ struct offsets
}
static constexpr uint32_t PreDataUpdate()
{
return PlatformOffset(17, undefined, undefined);
return PlatformOffset(15, undefined, undefined);
}
static constexpr uint32_t Paint()
{

View File

@ -124,6 +124,8 @@ void NetVars::Init()
this->m_bBuilding = gNetvars.get_offset("DT_BaseObject", "m_hBuilding");
this->m_iObjectType =
gNetvars.get_offset("DT_BaseObject", "m_iObjectType");
this->m_bMiniBuilding =
gNetvars.get_offset("DT_BaseObject", "m_bMiniBuilding");
this->m_iTeleState =
gNetvars.get_offset("DT_ObjectTeleporter", "m_iState");
this->m_flTeleRechargeTime =

View File

@ -251,7 +251,7 @@ void CreateMove()
{
// Check usersettings if enabled
if (!enable)
if (!*enable)
return;
// Something
@ -259,25 +259,22 @@ void CreateMove()
ResetEntityStrings(); // Clear any strings entities have
entities_need_repaint.clear(); // Clear data on entities that need redraw
// TODO, Find the benefit of using max clients with this logic
// Get max clients and
static int max_clients = g_IEngine->GetMaxClients();
int max_clients = g_IEngine->GetMaxClients();
int limit = HIGHEST_ENTITY;
// If not using any other special esp, we lower the min to the max clients
if (!buildings && !proj_esp && !item_esp)
limit = std::min(max_clients, HIGHEST_ENTITY);
{ // I still dont understand the purpose of prof_section and surrounding in
// brackets
{ // Prof section ends when out of scope, these brackets here.
PROF_SECTION(CM_ESP_EntityLoop);
// Loop through entities
for (int i = 0; i < limit; i++)
{
// Get an entity from the loop tick and process it
CachedEntity *ent = ENTITY(i);
if (CE_BAD(ent))
continue;
ProcessEntity(ent);
// Update Bones
if (i <= 32)
@ -1041,7 +1038,23 @@ void _FASTCALL ProcessEntity(CachedEntity *ent)
: (classid == CL_CLASS(CObjectSentrygun) ? "Sentry Gun"
: "Dispenser"));
int level = CE_INT(ent, netvar.iUpgradeLevel);
int IsMini = CE_INT(ent, netvar.m_bMiniBuilding);
if (!IsMini)
AddEntityString(ent, format("LV ", level, ' ', name));
else
AddEntityString(ent, format("Mini ", name));
if (classid == CL_CLASS(CObjectTeleporter))
{
float next_teleport = CE_FLOAT(ent, netvar.m_flTeleRechargeTime);
float yaw_to_exit = CE_FLOAT(ent, netvar.m_flTeleYawToExit);
if (yaw_to_exit)
{
if (next_teleport < g_GlobalVars->curtime)
AddEntityString(ent, "Ready");
else
AddEntityString(ent, format(next_teleport - g_GlobalVars->curtime, "s"));
}
}
}
// If text health is true, then add a string with the health
if ((int) show_health == 1 || (int) show_health == 3)