Skip to content

Commit 22d4419

Browse files
committed
update(EmitSound): Allow playing on pawn
1 parent 6766065 commit 22d4419

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/plugins/core/scripting/sdk/sdkaccess.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ void SDKBaseClass::CBaseEntity_CollisionRulesChanged()
105105
}
106106

107107
void SDKBaseClass::CBaseEntity_Teleport(Vector value, QAngle angle, Vector velocity) {
108-
if(!IsValid()) return;
109-
108+
if (!IsValid()) return;
109+
110110
((CBaseEntity*)this->GetPtr())->Teleport(&value, &angle, &velocity);
111111
}
112112

@@ -115,7 +115,7 @@ void SDKBaseClass::CBaseEntity_EmitSound(std::string sound_name, float pitch, fl
115115
Player* player = g_playerManager->GetPlayer(i);
116116
if (!player) continue;
117117
if (player->IsFakeClient()) continue;
118-
if ((void*)player->GetPlayerController() == this->GetPtr()) {
118+
if ((void*)player->GetPlayerController() == this->GetPtr() || (void*)player->GetPlayerPawn() == this->GetPtr()) {
119119
CSingleRecipientFilter filter(i);
120120
((CBaseEntity*)this->GetPtr())->EmitSoundFilter(filter, sound_name, pitch, volume);
121121
break;
@@ -907,8 +907,8 @@ SDKBaseType::SDKBaseType(std::string typeName)
907907
int64_t SDKBaseType::GetTypeValue(std::string key)
908908
{
909909
auto types = g_sdk->GetSDKTypes();
910-
if(types.find(m_typeName) == types.end()) return 0;
911-
if(types[m_typeName].find(key) == types[m_typeName].end()) return 0;
910+
if (types.find(m_typeName) == types.end()) return 0;
911+
if (types[m_typeName].find(key) == types[m_typeName].end()) return 0;
912912

913913
return types[m_typeName][key];
914914
}

0 commit comments

Comments
 (0)