1010//Define version number in a needlessly complex way
1111#define MAJOR " 1"
1212#define MINOR " 0"
13- #define PATCH " 0 "
13+ #define PATCH " 1 "
1414#define PLUGIN_VERSION MAJOR ..." ." ...MINOR ..." ." ...PATCH
1515
1616//Debug "Mode"
@@ -323,7 +323,7 @@ public void ObjectDestroyed(Event event, const char[] name, bool dontBroadcast)
323323
324324 int iObjParti = EntRefToEntIndex (g_iObjectParticle [iObj ]);
325325 if (IsValidEntity (iObjParti ))
326- AcceptEntityInput (iObjParti , " Kill " );
326+ RemoveEntity (iObjParti );
327327 g_iObjectParticle [iObj ] = - 1 ;
328328
329329 #if defined DEBUG
@@ -352,16 +352,19 @@ public Action HookSound(int clients[MAXPLAYERS], int &numClients, char sample[PL
352352 int &entity , int &channel , float &volume , int &level , int &pitch , int &flags ,
353353 char soundEntry [PLATFORM_MAX_PATH ], int &seed )
354354{
355- char className [64 ];
356- GetEntityClassname (entity , className , sizeof (className ));
357-
358- if (StrEqual (className , " obj_attachment_sapper" ) && TF2_GetObjectType (entity ) == TFObject_Sapper && channel == SNDCHAN_STATIC )
355+ if (IsValidEntity (entity ))
359356 {
360- if (GetEntPropEnt (entity , Prop_Send , " m_hBuiltOnEntity" ) == - 1 )
357+ char className [64 ];
358+ GetEntityClassname (entity , className , sizeof (className ));
359+
360+ if (StrEqual (className , " obj_attachment_sapper" ) && TF2_GetObjectType (entity ) == TFObject_Sapper && channel == SNDCHAN_STATIC )
361361 {
362- if (StrEqual ( sample , " weapons/sapper_timer.wav " ) || StrContains ( sample , " spy_tape " ) ! = - 1 )
362+ if (GetEntPropEnt ( entity , Prop_Send , " m_hBuiltOnEntity " ) = = - 1 )
363363 {
364- return Plugin_Handled ; //I need to block the duplicate sapping sound otherwise it'll loop forever.
364+ if (StrEqual (sample , " weapons/sapper_timer.wav" ) || StrContains (sample , " spy_tape" ) != - 1 )
365+ {
366+ return Plugin_Handled ; //I need to block the duplicate sapping sound otherwise it'll loop forever.
367+ }
365368 }
366369 }
367370 }
@@ -778,7 +781,7 @@ void ConvertPadToTeleporter(int iEnt)
778781 int iObjParti = EntRefToEntIndex (g_iObjectParticle [iEnt ]);
779782 if (IsValidEntity (iObjParti ))
780783 {
781- AcceptEntityInput (iObjParti , " Kill " );
784+ RemoveEntity (iObjParti );
782785 }
783786 g_iObjectParticle [iEnt ] = - 1 ;
784787
@@ -874,7 +877,8 @@ void ShowPadMenu(int iClient)
874877 Format (szTranslation , sizeof (szTranslation ), " %T " , " padphrase_menudisable" , iClient );
875878 menu .AddItem (" off" , szTranslation );
876879
877- menu .ExitButton = false ;
880+ menu .ExitButton = true ;
881+
878882 menu .Display (iClient , MENU_TIME_FOREVER );
879883}
880884
@@ -1217,6 +1221,14 @@ stock void ClearTimer(Handle &hTimer)
12171221 }
12181222}
12191223
1224+ stock int FindEntityByClassname2 (int startEnt , char [] classname )
1225+ {
1226+ /* If startEnt isn't valid shifting it back to the nearest valid one */
1227+ while (startEnt > - 1 && ! IsValidEntity (startEnt )) startEnt -- ;
1228+ return FindEntityByClassname (startEnt , classname );
1229+ }
1230+
1231+ #if ! defined _smlib_included
12201232/* SMLIB
12211233 * Precaches the given particle system.
12221234 * It's best to call this OnMapStart().
@@ -1273,10 +1285,4 @@ stock int FindStringIndex2(int tableidx, char[] str)
12731285
12741286 return INVALID_STRING_INDEX ;
12751287}
1276-
1277- stock int FindEntityByClassname2 (int startEnt , char [] classname )
1278- {
1279- /* If startEnt isn't valid shifting it back to the nearest valid one */
1280- while (startEnt > - 1 && ! IsValidEntity (startEnt )) startEnt -- ;
1281- return FindEntityByClassname (startEnt , classname );
1282- }
1288+ #endif
0 commit comments