@@ -3797,61 +3797,58 @@ namespace ReactiveDropInventory
37973797 {
37983798#ifdef CLIENT_DLL
37993799 if ( engine->IsPlayingDemo () )
3800- {
38013800 return ;
3802- }
38033801#endif
3804-
3805- CASW_Game_Resource *pGameResource = ASWGameResource ();
3806- if ( !pGameResource )
3802+ if ( ! ASWGameResource ()
3803+ || !pAttacker
3804+ || !pTarget )
38073805 return ;
38083806
38093807 if ( !ASWDeathmatchMode () )
38103808 {
3811- if ( pTarget && pTarget->IsInhabitableNPC () && bKilled )
3809+ if ( bKilled && pWeapon
3810+ && pAttacker->IsInhabitableNPC ()
3811+ && pTarget->IsAlien () )
38123812 {
3813- s_RD_Inventory_Manager.IncrementStrangePropertyOnEquippedItems ( assert_cast< CASW_Inhabitable_NPC * >( pTarget ), 5007 , 0 , 0 , false ); // Alien Kill Streak
3813+ CASW_Inhabitable_NPC* pInhabitableAttacker = assert_cast<CASW_Inhabitable_NPC*>( pAttacker );
3814+ if ( pInhabitableAttacker->IsInhabited () )
3815+ {
3816+ s_RD_Inventory_Manager.IncrementStrangePropertiesForWeapon ( pInhabitableAttacker, pWeapon, 5002 , 1 ); // Aliens Killed
3817+ s_RD_Inventory_Manager.IncrementStrangePropertiesForWeapon ( pInhabitableAttacker, pWeapon, 5007 , 1 ); // Alien Kill Streak
3818+ s_RD_Inventory_Manager.IncrementStrangePropertiesForWeapon ( pInhabitableAttacker, pWeapon, 5010 , 1 ); // Aliens Killed (Twitch)
3819+ }
38143820 }
38153821
3816- if ( !pAttacker || !pAttacker->IsInhabitableNPC () )
3822+ if ( !V_stricmp ( IGameSystem::MapName (), " rd-reduction2" )
3823+ && !pAttacker->IsInhabitableNPC ()
3824+ && !V_strcmp ( STRING ( pAttacker->GetEntityName () ), " trigger_pitworm_hitbox" )
3825+ && pTarget->IsInhabitableNPC () )
38173826 {
3818- if ( pAttacker && pTarget && pTarget->IsInhabitableNPC () && !V_stricmp ( IGameSystem::MapName (), " rd-reduction2" ) && !V_strcmp ( STRING ( pAttacker->GetEntityName () ), " trigger_pitworm_hitbox" ) )
3827+ CASW_Inhabitable_NPC *pTargetNPC = assert_cast< CASW_Inhabitable_NPC * >( pTarget );
3828+ if ( pTargetNPC->IsInhabited () )
38193829 {
3820- CASW_Inhabitable_NPC *pTargetNPC = assert_cast< CASW_Inhabitable_NPC * >( pTarget );
3821-
3830+ s_RD_Inventory_Manager.IncrementStrangePropertyOnEquippedItems ( pTargetNPC, 42 , 1 );
38223831#ifdef CLIENT_DLL
38233832 static bool s_bRequestedWormToucherMedal = false ;
3824- if ( !s_bRequestedWormToucherMedal && pTargetNPC->IsInhabited () && pTargetNPC-> GetCommander () && pTargetNPC->GetCommander ()->IsLocalPlayer () )
3833+ if ( !s_bRequestedWormToucherMedal && pTargetNPC->GetCommander () && pTargetNPC->GetCommander ()->IsLocalPlayer () )
38253834 {
38263835 AddPromoItem ( 42 );
38273836 s_bRequestedWormToucherMedal = true ;
38283837 }
38293838#endif
3830-
3831- s_RD_Inventory_Manager.IncrementStrangePropertyOnEquippedItems ( pTargetNPC, 42 , 1 );
38323839 }
3833-
3834- return ;
3835- }
3836-
3837- CASW_Inhabitable_NPC *pInhabitableAttacker = assert_cast< CASW_Inhabitable_NPC * >( pAttacker );
3838- if ( pTarget && pTarget->IsAlien () && bKilled )
3839- {
3840- s_RD_Inventory_Manager.IncrementStrangePropertiesForWeapon ( pInhabitableAttacker, pWeapon, 5002 , 1 ); // Aliens Killed
3841- s_RD_Inventory_Manager.IncrementStrangePropertiesForWeapon ( pInhabitableAttacker, pWeapon, 5007 , 1 ); // Alien Kill Streak
3842- s_RD_Inventory_Manager.IncrementStrangePropertiesForWeapon ( pInhabitableAttacker, pWeapon, 5010 , 1 ); // Aliens Killed (Twitch)
38433840 }
38443841 }
38453842 else
38463843 {
3847- if ( pAttacker->IsInhabitableNPC () )
3844+ if ( bKilled && pWeapon
3845+ && pAttacker != pTarget
3846+ && pAttacker->IsInhabitableNPC ()
3847+ && pTarget->Classify () == (Class_T)CLASS_ASW_MARINE )
38483848 {
38493849 CASW_Inhabitable_NPC *pInhabitableAttacker = assert_cast<CASW_Inhabitable_NPC *>( pAttacker );
3850- if ( pTarget && pTarget->Classify () == (Class_T)CLASS_ASW_MARINE && bKilled && pTarget != pInhabitableAttacker )
3851- {
3852- s_RD_Inventory_Manager.IncrementStrangePropertiesForWeapon ( pInhabitableAttacker, pWeapon, 5009 , 1 ); // Deathmatch Kills
3853- s_RD_Inventory_Manager.IncrementStrangePropertiesForWeapon ( pInhabitableAttacker, pWeapon, 5011 , 1 ); // Deathmatch Kills (Twitch)
3854- }
3850+ s_RD_Inventory_Manager.IncrementStrangePropertiesForWeapon ( pInhabitableAttacker, pWeapon, 5009 , 1 ); // Deathmatch Kills
3851+ s_RD_Inventory_Manager.IncrementStrangePropertiesForWeapon ( pInhabitableAttacker, pWeapon, 5011 , 1 ); // Deathmatch Kills (Twitch)
38553852 }
38563853 }
38573854 }
0 commit comments