aboutsummaryrefslogtreecommitdiff
path: root/src/operate.cc
diff options
context:
space:
mode:
authorfusion32 <marcopuzziello@gmail.com>2025-06-19 03:13:48 -0300
committerfusion32 <marcopuzziello@gmail.com>2025-06-19 03:13:48 -0300
commitbd3a6a04601749cbde007eaabf803fb602ee2783 (patch)
tree476b89932627aa73ad88de22d37e4617bbdb1795 /src/operate.cc
parente5b8aadd493b8b5df4ed661f2491de33d634b001 (diff)
downloadgame-bd3a6a04601749cbde007eaabf803fb602ee2783.tar.gz
game-bd3a6a04601749cbde007eaabf803fb602ee2783.zip
beginning of `communication.cc`
Diffstat (limited to 'src/operate.cc')
-rw-r--r--src/operate.cc13
1 files changed, 2 insertions, 11 deletions
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);
}