@@ -798,14 +798,12 @@ void EWItemInstance::Pickup(int slot)
798798 if (bShouldSetClantag)
799799 {
800800 bHasThisClantag = true ;
801- pController->m_szClan (sClantag );
801+ pController->SetClanTag (sClantag );
802802 if (g_cvarItemHolderScore.Get () > -1 )
803803 {
804804 int score = pController->m_iScore + g_cvarItemHolderScore.Get ();
805805 pController->m_iScore = score;
806806 }
807-
808- EW_UpdateClientClanTags ();
809807 }
810808 }
811809
@@ -840,7 +838,7 @@ void EWItemInstance::Drop(EWDropReason reason, CCSPlayerController* pController)
840838 {
841839 // Player IS holding another item, score doesnt need adjusting
842840
843- pController->m_szClan (g_pEWHandler->vecItems [otherItem]->sClantag );
841+ pController->SetClanTag (g_pEWHandler->vecItems [otherItem]->sClantag );
844842 g_pEWHandler->vecItems [otherItem]->bHasThisClantag = true ;
845843 bSetAnotherClantag = true ;
846844 break ;
@@ -857,10 +855,8 @@ void EWItemInstance::Drop(EWDropReason reason, CCSPlayerController* pController)
857855 pController->m_iScore = score;
858856 }
859857
860- pController->m_szClan (" " );
858+ pController->SetClanTag (" " );
861859 }
862-
863- EW_UpdateClientClanTags ();
864860 }
865861
866862 char sPlayerInfo [64 ];
@@ -1504,10 +1500,8 @@ void CEWHandler::ResetAllClantags()
15041500 pController->m_iScore = score;
15051501 }
15061502
1507- pController->m_szClan (" " );
1503+ pController->SetClanTag (" " );
15081504 }
1509-
1510- EW_UpdateClientClanTags ();
15111505}
15121506
15131507int CEWHandler::RegisterItem (CBasePlayerWeapon* pWeapon)
@@ -2259,49 +2253,6 @@ void EW_PlayerDisconnect(int slot)
22592253 g_pEWHandler->PlayerDrop (EWDropReason::Disconnect, -1 , pController);
22602254}
22612255
2262- // An event needs to be sent to force clients to see up to date clantags
2263- void EW_UpdateClientClanTags ()
2264- {
2265- // Cannot send this event during map vote, as it breaks voting client side
2266- if (!GetGlobals () || !g_pMapVoteSystem->IsIntermissionAllowed ())
2267- return ;
2268-
2269- static IGameEvent* pEvent = nullptr ;
2270-
2271- if (!pEvent)
2272- pEvent = g_gameEventManager->CreateEvent (" nextlevel_changed" );
2273-
2274- if (!pEvent)
2275- {
2276- Panic (" Failed to create nextlevel_changed event\n " );
2277- return ;
2278- }
2279-
2280- INetworkMessageInternal* pMsg = g_pNetworkMessages->FindNetworkMessageById (GE_Source1LegacyGameEvent);
2281- if (!pMsg)
2282- {
2283- Panic (" Failed to create Source1LegacyGameEvent\n " );
2284- return ;
2285- }
2286- CNetMessagePB<CMsgSource1LegacyGameEvent>* data = pMsg->AllocateMessage ()->ToPB <CMsgSource1LegacyGameEvent>();
2287- g_gameEventManager->SerializeEvent (pEvent, data);
2288-
2289- CRecipientFilter filter;
2290- for (int i = 0 ; i < GetGlobals ()->maxClients ; i++)
2291- {
2292- ZEPlayer* pPlayer = g_playerManager->GetPlayer (i);
2293-
2294- if (!pPlayer || pPlayer->IsFakeClient () || !pPlayer->IsAuthenticated ())
2295- continue ;
2296-
2297- if (pPlayer->GetEntwatchClangtags ())
2298- filter.AddRecipient (pPlayer->GetPlayerSlot ());
2299- }
2300-
2301- g_gameEventSystem->PostEventAbstract (-1 , false , &filter, pMsg, data, 0 );
2302- delete data;
2303- }
2304-
23052256bool EW_IsFireOutputHooked ()
23062257{
23072258 return std::any_of (mapIOFunctions.begin (), mapIOFunctions.end (), [](const auto & p) { return p.first == " entwatch" ; });
@@ -2650,34 +2601,6 @@ CON_COMMAND_CHAT(ew_dump, "- Prints the currently loaded config to console")
26502601 g_pEWHandler->PrintLoadedConfig (player->GetPlayerSlot ());
26512602}
26522603
2653- CON_COMMAND_CHAT (etag, " - Toggle EntWatch clantags on the scoreboard" )
2654- {
2655- if (!g_cvarEnableEntWatch.Get ())
2656- return ;
2657-
2658- if (!player)
2659- {
2660- ClientPrint (player, HUD_PRINTTALK, EW_PREFIX " Only usable in game." );
2661- return ;
2662- }
2663-
2664- ZEPlayer* zpPlayer = g_playerManager->GetPlayer (player->GetPlayerSlot ());
2665- if (!zpPlayer)
2666- {
2667- ClientPrint (player, HUD_PRINTTALK, EW_PREFIX " Something went wrong, try again later." );
2668- return ;
2669- }
2670-
2671- bool bCurrentStatus = zpPlayer->GetEntwatchClangtags ();
2672- bCurrentStatus = !bCurrentStatus;
2673- zpPlayer->SetEntwatchClangtags (bCurrentStatus);
2674-
2675- if (bCurrentStatus)
2676- ClientPrint (player, HUD_PRINTTALK, EW_PREFIX " You have\x04 Enabled\x01 EntWatch clantag updates" );
2677- else
2678- ClientPrint (player, HUD_PRINTTALK, EW_PREFIX " You have\x07 Disabled\x01 EntWatch clantag updates" );
2679- }
2680-
26812604CON_COMMAND_CHAT (hud, " - Toggle EntWatch HUD" )
26822605{
26832606 if (!g_cvarEnableEntWatch.Get ())
0 commit comments