From 6d498fe17dab48cfd8fc8a4da62a573b799e10ba Mon Sep 17 00:00:00 2001 From: fusion32 Date: Wed, 16 Jul 2025 17:22:39 -0300 Subject: fix most init and parsing bugs + critical bug with dynamic strings With an appropriate query manager, the server now starts up and seems to work but won't properly handle connections until we fix the problem with threads and signals described in `TODO.md`. --- src/crplayer.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/crplayer.cc') diff --git a/src/crplayer.cc b/src/crplayer.cc index e5874be..dce7ad2 100644 --- a/src/crplayer.cc +++ b/src/crplayer.cc @@ -2314,7 +2314,7 @@ bool LoadPlayerData(TPlayerData *Slot){ } } - int Position = Script.readNumber(); + int Position = Script.getNumber(); if(Position < INVENTORY_FIRST || Position > INVENTORY_LAST){ Script.error("illegal inventory position"); } @@ -2342,7 +2342,7 @@ bool LoadPlayerData(TPlayerData *Slot){ } } - int DepotNr = Script.readNumber(); + int DepotNr = Script.getNumber(); if(DepotNr < 0 || DepotNr >= NARRAY(Slot->Depot)){ Script.error("illegal depot number"); } @@ -2361,6 +2361,7 @@ bool LoadPlayerData(TPlayerData *Slot){ Script.error("end of file expected"); } + Script.close(); Result = true; }catch(const char *str){ error("LoadPlayerData: Kann Gegenstände des Spielers %u nicht laden.\n", -- cgit v1.2.3