code cleanup, small fixes

This commit is contained in:
TotallyNotElite 2019-12-22 11:04:23 +01:00
parent be1bc9837f
commit b5ae4ca2fa
4 changed files with 19 additions and 16 deletions

View File

@ -128,7 +128,7 @@ matrix3x4_t *EntityHitboxCache::GetBones()
{ {
if (g_Settings.is_create_move) if (g_Settings.is_create_move)
{ {
#if ENABLE_TEXTMODE #if !ENABLE_TEXTMODE
if (!*bonecache_enabled || parent_ref->m_Type() != ENTITY_PLAYER || IsPlayerInvisible(parent_ref)) if (!*bonecache_enabled || parent_ref->m_Type() != ENTITY_PLAYER || IsPlayerInvisible(parent_ref))
{ {
PROF_SECTION(bone_setup); PROF_SECTION(bone_setup);

View File

@ -125,7 +125,7 @@ static void doAutoZoom(bool target_found)
{ {
if (target_found) if (target_found)
zoomTime.update(); zoomTime.update();
if (isIdle || !zoomTime.check(5000)) if (isIdle || !zoomTime.check(3000))
{ {
current_user_cmd->buttons |= IN_ATTACK2; current_user_cmd->buttons |= IN_ATTACK2;
} }

View File

@ -105,23 +105,33 @@ void increaseBruteNum(int idx)
static void pitchHook(const CRecvProxyData *pData, void *pStruct, void *pOut) static void pitchHook(const CRecvProxyData *pData, void *pStruct, void *pOut)
{ {
float *ang = (float *) pOut; float flPitch = pData->m_Value.m_Float;
*ang = pData->m_Value.m_Float; float *flPitch_out = (float *) pOut;
if (!enable)
{
*flPitch_out = flPitch;
return;
}
auto client_ent = (IClientEntity *) (pStruct); auto client_ent = (IClientEntity *) (pStruct);
CachedEntity *ent = ENTITY(client_ent->entindex()); CachedEntity *ent = ENTITY(client_ent->entindex());
if (CE_GOOD(ent)) if (CE_GOOD(ent))
*ang = resolveAnglePitch(pData->m_Value.m_Float, resolver_map[ent->player_info.friendsID]); *flPitch_out = resolveAnglePitch(flPitch, resolver_map[ent->player_info.friendsID]);
} }
static void yawHook(const CRecvProxyData *pData, void *pStruct, void *pOut) static void yawHook(const CRecvProxyData *pData, void *pStruct, void *pOut)
{ {
float flYaw = pData->m_Value.m_Float; float flYaw = pData->m_Value.m_Float;
float *flYaw_out = (float *) pOut; float *flYaw_out = (float *) pOut;
auto client_ent = (IClientEntity *) (pStruct); if (!enable)
{
*flYaw_out = flYaw;
return;
}
auto client_ent = (IClientEntity *) (pStruct);
CachedEntity *ent = ENTITY(client_ent->entindex()); CachedEntity *ent = ENTITY(client_ent->entindex());
if (CE_GOOD(ent)) if (CE_GOOD(ent))
*flYaw_out = resolveAngleYaw(flYaw, resolver_map[ent->player_info.friendsID]); *flYaw_out = resolveAngleYaw(flYaw, resolver_map[ent->player_info.friendsID]);

View File

@ -10,13 +10,6 @@ namespace hooked_methods
DEFINE_HOOKED_METHOD(IN_KeyEvent, int, void *this_, int eventcode, ButtonCode_t keynum, const char *binding) DEFINE_HOOKED_METHOD(IN_KeyEvent, int, void *this_, int eventcode, ButtonCode_t keynum, const char *binding)
{ {
#if ENABLE_GUI
/*
if (g_pGUI->ConsumesKey((ButtonCode_t)keynum) && g_pGUI->Visible()) {
return 0;
}
*/
#endif
return original::IN_KeyEvent(this_, eventcode, keynum, binding); return original::IN_KeyEvent(this_, eventcode, keynum, binding);
} }
} // namespace hooked_methods } // namespace hooked_methods