- Timestamp:
- Aug 7, 2022, 3:02:24 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/7dtd-server-fixes/src/FileCache/MapTileCache.cs
r351 r391 36 36 lock (cache) { 37 37 CurrentZoomFile cacheEntry = cache [_zoomlevel]; 38 39 if (cacheEntry.filename == null || !cacheEntry.filename.Equals (_filename)) {40 cacheEntry.filename = _filename;41 38 42 if (!File.Exists (_filename)) { 43 cacheEntry.pngData = null; 44 return null; 45 } 39 if (cacheEntry.filename != null && cacheEntry.filename.Equals (_filename)) { 40 return cacheEntry.pngData; 41 } 46 42 47 Profiler.BeginSample ("ReadPng"); 48 cacheEntry.pngData = ReadAllBytes (_filename); 49 Profiler.EndSample (); 43 cacheEntry.filename = _filename; 44 45 if (!File.Exists (_filename)) { 46 cacheEntry.pngData = null; 47 return null; 50 48 } 49 50 Profiler.BeginSample ("ReadPng"); 51 cacheEntry.pngData = ReadAllBytes (_filename); 52 Profiler.EndSample (); 51 53 52 54 return cacheEntry.pngData; … … 103 105 } 104 106 105 if (!File.Exists (_filename)) { 106 return transparentTile; 107 } 108 109 return ReadAllBytes (_filename); 107 return !File.Exists (_filename) ? transparentTile : ReadAllBytes (_filename); 110 108 } 111 109 } catch (Exception e) {
Note:
See TracChangeset
for help on using the changeset viewer.