From bd3a6a04601749cbde007eaabf803fb602ee2783 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Thu, 19 Jun 2025 03:13:48 -0300 Subject: beginning of `communication.cc` --- src/operate.cc | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/operate.cc') diff --git a/src/operate.cc b/src/operate.cc index 7dc1fef..aa061a8 100644 --- a/src/operate.cc +++ b/src/operate.cc @@ -2393,12 +2393,7 @@ void Talk(uint32 CreatureID, int Mode, const char *Addressee, const char *Text, uint32 StatementID = LogCommunication(CreatureID, Mode, 0, Text); TConnection *Connection = GetFirstConnection(); while(Connection != NULL){ - // TODO(fusion): Same as `AdvanceGame`. Definitely some inlined - // function to check whether the connection is in a valid state. - if(Connection->State == CONNECTION_LOGIN - || Connection->State == CONNECTION_GAME - || Connection->State == CONNECTION_DEAD - || Connection->State == CONNECTION_LOGOUT){ + if(Connection->Live()){ SendTalk(Connection, LogListener(StatementID, Connection->GetPlayer()), Creature->Name, Mode, Text, 0); @@ -2409,11 +2404,7 @@ void Talk(uint32 CreatureID, int Mode, const char *Addressee, const char *Text, }else if(Mode == TALK_ANONYMOUS_BROADCAST){ TConnection *Connection = GetFirstConnection(); while(Connection != NULL){ - // TODO(fusion): Same as above. - if(Connection->State == CONNECTION_LOGIN - || Connection->State == CONNECTION_GAME - || Connection->State == CONNECTION_DEAD - || Connection->State == CONNECTION_LOGOUT){ + if(Connection->Live()){ SendMessage(Connection, TALK_ADMIN_MESSAGE, Text); } -- cgit v1.2.3