X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_map.pas;h=bbf39cb5efb7bad44613c76d9352e0cb2655b37b;hb=768ae6d7aaa02bd5076a5034dd08fc8f425ad604;hp=50b0d2669ae576f4647c599664b6d7c38dc094d2;hpb=a7daeef3855f07c8302a60ab31cb20ab74aefc45;p=d2df-sdl.git diff --git a/src/game/g_map.pas b/src/game/g_map.pas index 50b0d26..bbf39cb 100644 --- a/src/game/g_map.pas +++ b/src/game/g_map.pas @@ -373,7 +373,7 @@ begin result := dfmapdef.parseMap(pr); except on e: Exception do begin - if (pr <> nil) then e_LogWritefln('ERROR at (%s,%s): %s', [pr.line, pr.col, e.message]) + if (pr <> nil) then e_LogWritefln('ERROR at (%s,%s): %s', [pr.tokLine, pr.tokCol, e.message]) else e_LogWritefln('ERROR: %s', [e.message]); pr.Free(); // will free `wst` result := nil; @@ -1677,6 +1677,12 @@ begin FreeMem(Data); + if (mapReader = nil) then + begin + e_LogWritefln('invalid map file: ''%s''', [mapResName]); + exit; + end; + generateExternalResourcesList(mapReader); mapTextureList := mapReader['texture']; // get all other lists here too @@ -2224,6 +2230,8 @@ begin FreeMem(Data); + if (mapReader = nil) then exit; + if (mapReader.Width > 0) and (mapReader.Height > 0) then begin Result.Name := mapReader.MapName;