From aef23aa03b689127a0f598ee8b70ff576ea2c24e Mon Sep 17 00:00:00 2001 From: djes Date: Fri, 2 Jun 2017 12:50:54 +0200 Subject: [PATCH] Little tile loading bugfix --- PBMap.pb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/PBMap.pb b/PBMap.pb index 2dfe868..cd05231 100644 --- a/PBMap.pb +++ b/PBMap.pb @@ -1025,7 +1025,7 @@ Module PBMap Procedure.i GetTileFromHDD(CacheFile.s) Protected nImage.i, LifeTime.i, MaxLifeTime.i = PBMap\Options\TileLifetime - If FileSize(CacheFile) <> -1 + If FileSize(CacheFile) > 0 ;Manage tile file lifetime If MaxLifeTime <> -1 LifeTime = Date() - GetFileDate(CacheFile, #PB_Date_Modified) ;There's a bug with #PB_Date_Created @@ -1054,9 +1054,8 @@ Module PBMap Procedure.i GetTileFromWeb(TileURL.s, CacheFile.s) Protected *Buffer Protected nImage.i = -1 - Protected FileSize.i, timg - FileSize = ReceiveHTTPFile(TileURL, CacheFile) - If FileSize > 0 + Protected timg + If ReceiveHTTPFile(TileURL, CacheFile) MyDebug("Loaded from web " + TileURL + " as CacheFile " + CacheFile, 3) nImage = GetTileFromHDD(CacheFile) Else @@ -2737,8 +2736,8 @@ CompilerIf #PB_Compiler_IsMainFile CompilerEndIf ; IDE Options = PureBasic 5.60 (Windows - x64) -; CursorPosition = 2691 -; FirstLine = 2684 +; CursorPosition = 1037 +; FirstLine = 1020 ; Folding = ------------------- ; EnableThread ; EnableXP \ No newline at end of file