Fix some crashes
This commit is contained in:
parent
3eae4bd666
commit
946ccc4649
@ -161,7 +161,7 @@ IClientEntity *GetActiveTFWeapon_detour(IClientEntity *this_ /* C_TFPlayer * */)
|
|||||||
{
|
{
|
||||||
// trace and find where player is aiming
|
// trace and find where player is aiming
|
||||||
auto cent = ENTITY(this_->entindex());
|
auto cent = ENTITY(this_->entindex());
|
||||||
if (CE_BAD(cent))
|
if (CE_BAD(cent) || !cent->hitboxes.GetHitbox(0))
|
||||||
return weapon;
|
return weapon;
|
||||||
Vector eyePos = cent->hitboxes.GetHitbox(0)->center;
|
Vector eyePos = cent->hitboxes.GetHitbox(0)->center;
|
||||||
trace::filter_default.SetSelf(this_);
|
trace::filter_default.SetSelf(this_);
|
||||||
|
@ -148,7 +148,8 @@ void gui::init()
|
|||||||
|
|
||||||
void gui::shutdown()
|
void gui::shutdown()
|
||||||
{
|
{
|
||||||
g_IGameEventManager->RemoveListener(&listener);
|
if (init_done)
|
||||||
|
g_IGameEventManager->RemoveListener(&listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gui::draw()
|
void gui::draw()
|
||||||
|
Reference in New Issue
Block a user