Skip to content

Commit d75feac

Browse files
committed
fix(engine/gameevents): TakeDamage getting controller on wrong stuff
1 parent 5a9b147 commit d75feac

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/scripting/engine/gameevents.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ dyno::ReturnAction Hook_CBaseEntity_TakeDamage(dyno::CallbackType type, dyno::IH
100100
void* _this = hook.getArgument<void*>(0);
101101
CTakeDamageInfo* info = hook.getArgument<CTakeDamageInfo*>(1);
102102

103+
if (((CEntityInstance*)_this)->GetClassname() != std::string("player")) return dyno::ReturnAction::Ignored;
103104
CHandle<CEntityInstance> playerController = schema::GetProp<CHandle<CEntityInstance>>(_this, "CBasePlayerPawn", "m_hController");
104105
if (!playerController) return dyno::ReturnAction::Ignored;
105106

0 commit comments

Comments
 (0)