Skip to content

Commit dc8b855

Browse files
committed
Fix usermessages not being sent when player classname is changed.
1 parent 94b79c9 commit dc8b855

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

src/core/modules/filters/filters_recipients.cpp

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,6 @@ void MRecipientFilter::AddAllPlayers()
109109
continue;
110110
}
111111

112-
// Get and compare the classnames. Skip non-player
113-
// entities.
114-
const char* classname = pPlayer->GetClassName();
115-
if( strcmp(classname, "player") != 0 ) {
116-
continue;
117-
}
118-
119112
m_Recipients.AddToTail(i);
120113
}
121114
}
@@ -130,14 +123,9 @@ void MRecipientFilter::AddRecipient(int iPlayer)
130123
if(!pPlayer)
131124
return;
132125

133-
// Get and compare the classnames. Skip non-player
134-
// entities.
135-
const char* classname = pPlayer->GetClassName();
136-
if( strcmp(classname, "player") != 0 ) {
137-
return;
138-
}
139-
140-
m_Recipients.AddToTail(iPlayer);
126+
// Skip non-player entities.
127+
if (iPlayer > WORLD_ENTITY_INDEX && iPlayer <= gpGlobals->maxClients)
128+
m_Recipients.AddToTail(iPlayer);
141129
}
142130

143131
void MRecipientFilter::RemoveRecipient( int iPlayer )

0 commit comments

Comments
 (0)