aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfusion32 <marcopuzziello@gmail.com>2026-02-15 23:13:51 -0300
committerfusion32 <marcopuzziello@gmail.com>2026-02-15 23:13:51 -0300
commit36f1c93665d42c73e06670787647b8f9783890ef (patch)
treef821dbf4b1f440591a0a19a9c50caa454ed3ba42
parent3b42c6116613681abe24c4482ba51b9a3d971c04 (diff)
downloadgame-36f1c93665d42c73e06670787647b8f9783890ef.tar.gz
game-36f1c93665d42c73e06670787647b8f9783890ef.zip
add missing try-catch block in RefreshSector
-rw-r--r--src/map.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/map.cc b/src/map.cc
index 87cd307..72a9f1f 100644
--- a/src/map.cc
+++ b/src/map.cc
@@ -1319,8 +1319,12 @@ void RefreshSector(int SectorX, int SectorY, int SectorZ, TReadStream *Stream){
ASSERT(Sector);
TSector *Sec = *Sector->at(SectorX, SectorY, SectorZ);
- if(Sec && (Sec->MapFlags & 0x01) != 0){
- print(3, "Refreshe Sektor %d/%d/%d ...\n", SectorX, SectorY, SectorZ);
+ if(Sec == NULL || (Sec->MapFlags & 0x01) == 0){
+ return;
+ }
+
+ print(3, "Refreshe Sektor %d/%d/%d ...\n", SectorX, SectorY, SectorZ);
+ try{
while(!Stream->eof()){
uint8 OffsetX = Stream->readByte();
uint8 OffsetY = Stream->readByte();
@@ -1342,6 +1346,8 @@ void RefreshSector(int SectorX, int SectorY, int SectorZ, TReadStream *Stream){
LoadObjects(Stream, Con);
}
}
+ }catch(const char *str){
+ error("RefreshSector: Fehler beim Auslesen der Daten (%s).\n", str);
}
}