3737#include " boost/shared_array.hpp"
3838#include " sp_main.h"
3939#include " modules/listeners/listeners_manager.h"
40- #include " utilities/conversions.h"
4140#include " convar.h"
4241
4342// -----------------------------------------------------------------------------
@@ -222,9 +221,6 @@ void SayConCommand::Dispatch( const CCommand& command )
222221 // Get the index of the player that used the command
223222 int iIndex = GetCommandIndex ();
224223
225- // Get the IPlayerInfo instance of the player
226- IPlayerInfo* pPlayerInfo = PlayerInfoFromIndex (iIndex);
227-
228224 // Get whether the command was say or say_team
229225 bool bTeamOnly = strcmp (command.Arg (0 ), " say_team" ) == 0 ;
230226
@@ -244,7 +240,7 @@ void SayConCommand::Dispatch( const CCommand& command )
244240 PyObject* pCallable = s_SayFilters.m_vecCallables [i].ptr ();
245241
246242 // Call the callable and store its return value
247- object returnValue = CALL_PY_FUNC (pCallable, ptr (pPlayerInfo), bTeamOnly, boost::ref (stripped_command));
243+ object returnValue = CALL_PY_FUNC (pCallable, boost::ref (stripped_command), iIndex, bTeamOnly );
248244
249245 // Does the current Say Filter wish to block the command?
250246 if ( !returnValue.is_none () && extract<int >(returnValue) == (int ) BLOCK)
@@ -283,7 +279,7 @@ void SayConCommand::Dispatch( const CCommand& command )
283279 CSayCommandManager* pCSayCommandManager = commandMapIter->second ;
284280
285281 // Call the command and see it wants to block the command
286- if ( pCSayCommandManager->Dispatch (pPlayerInfo, bTeamOnly, stripped_command ) == BLOCK)
282+ if ( pCSayCommandManager->Dispatch (stripped_command, iIndex, bTeamOnly ) == BLOCK)
287283 {
288284 // Block the command
289285 return ;
@@ -353,7 +349,7 @@ void CSayCommandManager::RemoveCallback( PyObject* pCallable )
353349// -----------------------------------------------------------------------------
354350// Dispatches the say command.
355351// -----------------------------------------------------------------------------
356- CommandReturn CSayCommandManager::Dispatch ( IPlayerInfo* pPlayerInfo, bool bTeamOnly, const CCommand& command )
352+ CommandReturn CSayCommandManager::Dispatch ( const CCommand& command, int iIndex, bool bTeamOnly )
357353{
358354 // Loop through all callables registered for the CSayCommandManager instance
359355 for (int i = 0 ; i < m_vecCallables.Count (); i++)
@@ -364,7 +360,7 @@ CommandReturn CSayCommandManager::Dispatch( IPlayerInfo* pPlayerInfo, bool bTeam
364360 PyObject* pCallable = m_vecCallables[i].ptr ();
365361
366362 // Call the callable and store its return value
367- object returnValue = CALL_PY_FUNC (pCallable, ptr (pPlayerInfo), bTeamOnly, boost::ref (command));
363+ object returnValue = CALL_PY_FUNC (pCallable, boost::ref (command), iIndex, bTeamOnly );
368364
369365 // Does the callable wish to block the command?
370366 if ( !returnValue.is_none () && extract<int >(returnValue) == (int ) BLOCK)
0 commit comments