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

15
TODO
View File

@ -42,14 +42,13 @@ add Spectator Silent for projectile weapons // //
//Visuals/GUI // //Visuals/GUI //
//------------------------------------------------------------------------------------------------------------------// // //------------------------------------------------------------------------------------------------------------------// //
// // // //
// // // //
// // // //
// // // //
// // // //
Cheat status menu (A gui to display enabled/disabled states of user settings for when the menu is off) // // 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 // // Make ubercharge esp color RGB when fully charged // //
// // // //
@ -61,7 +60,7 @@ ESP Icons // //
ESP Distance sort // // ESP Distance sort // //
Show sapped buildings in ESP // // // // Show sapped buildings in ESP // // // //
carrying esp // // carrying esp // //
Tracers/Spy Cam // // Spy Cam // //
// // // //
//------------------------------------------------------------------------------------------------------------------// // //------------------------------------------------------------------------------------------------------------------// //
// // // //
@ -74,11 +73,11 @@ Tracers/Spy Cam // //
//------------------------------------------------------------------------------------------------------------------// // //------------------------------------------------------------------------------------------------------------------// //
// // // //
TTS // // TTS // //
// // // //
// // // //
// // // //
dominatesay assistsay worldsay // // dominatesay assistsay worldsay // //
// // // //
// // // //
//------------------------------------------------------------------------------------------------------------------// // //------------------------------------------------------------------------------------------------------------------// //
// // // //

View File

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

View File

@ -168,7 +168,7 @@ struct offsets
} }
static constexpr uint32_t PreDataUpdate() static constexpr uint32_t PreDataUpdate()
{ {
return PlatformOffset(17, undefined, undefined); return PlatformOffset(15, undefined, undefined);
} }
static constexpr uint32_t Paint() 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_bBuilding = gNetvars.get_offset("DT_BaseObject", "m_hBuilding");
this->m_iObjectType = this->m_iObjectType =
gNetvars.get_offset("DT_BaseObject", "m_iObjectType"); gNetvars.get_offset("DT_BaseObject", "m_iObjectType");
this->m_bMiniBuilding =
gNetvars.get_offset("DT_BaseObject", "m_bMiniBuilding");
this->m_iTeleState = this->m_iTeleState =
gNetvars.get_offset("DT_ObjectTeleporter", "m_iState"); gNetvars.get_offset("DT_ObjectTeleporter", "m_iState");
this->m_flTeleRechargeTime = this->m_flTeleRechargeTime =

View File

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