aboutsummaryrefslogtreecommitdiff
path: root/src/main.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/main.cc
parente5b8aadd493b8b5df4ed661f2491de33d634b001 (diff)
downloadgame-bd3a6a04601749cbde007eaabf803fb602ee2783.tar.gz
game-bd3a6a04601749cbde007eaabf803fb602ee2783.zip
beginning of `communication.cc`
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/main.cc b/src/main.cc
index c0180c2..8d5fcf5 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -1,4 +1,5 @@
#include "common.hh"
+#include "communication.hh"
#include "config.hh"
#include "info.hh"
#include "map.hh"
@@ -327,23 +328,7 @@ static void AdvanceGame(int Delay){
OldAmbiente = Brightness;
TConnection *Connection = GetFirstConnection();
while(Connection != NULL){
- // TODO(fusion): This is probably an inlined function that checks
- // whether the connection is still going. The exact decompiled condition
- // was `Connection->State - CONDITION_LOGIN < 4` but I think that's
- // just a compiler optimization that wouldn't work properly on the
- // decompiled version. That comparison in the disassembly is unsigned
- // (`JBE`) but the enum is signed which would probably generate an
- // invalid signed comparison (`JLE`).
- //
- // MOV EAX, dword ptr [Connection + Connection->State]
- // SUB EAX, 0x3
- // CMP EAX, 0x3
- // JBE ... -> SendAmbiente(Connection)
- //
- if(Connection->State == CONNECTION_LOGIN
- || Connection->State == CONNECTION_GAME
- || Connection->State == CONNECTION_DEAD
- || Connection->State == CONNECTION_LOGOUT){
+ if(Connection->Live()){
SendAmbiente(Connection);
}
Connection = GetNextConnection();