src/newgrf_config.cpp
branchnoai
changeset 10829 8a0ec0f0f928
parent 10513 33cb70ff2f5d
child 11126 72d4c9314c72
equal deleted inserted replaced
10804:a02ab0ca5ae9 10829:8a0ec0f0f928
     6 #include "openttd.h"
     6 #include "openttd.h"
     7 #include "debug.h"
     7 #include "debug.h"
     8 #include "variables.h"
     8 #include "variables.h"
     9 #include "saveload.h"
     9 #include "saveload.h"
    10 #include "md5.h"
    10 #include "md5.h"
    11 #include "network/network_data.h"
       
    12 #include "newgrf.h"
    11 #include "newgrf.h"
    13 #include "newgrf_config.h"
    12 #include "newgrf_config.h"
    14 #include "core/alloc_func.hpp"
    13 #include "core/alloc_func.hpp"
    15 #include "string_func.h"
    14 #include "string_func.h"
       
    15 #include "gamelog.h"
       
    16 #include "network/network_type.h"
    16 
    17 
    17 #include "fileio.h"
    18 #include "fileio.h"
    18 #include "fios.h"
    19 #include "fios.h"
    19 #include <sys/stat.h>
    20 #include <sys/stat.h>
    20 
    21 
   229 				DEBUG(grf, 1, "NewGRF %08X (%s) not found; checksum %s. Compatibility mode on", BSWAP32(c->grfid), c->filename, buf);
   230 				DEBUG(grf, 1, "NewGRF %08X (%s) not found; checksum %s. Compatibility mode on", BSWAP32(c->grfid), c->filename, buf);
   230 				SetBit(c->flags, GCF_COMPATIBLE);
   231 				SetBit(c->flags, GCF_COMPATIBLE);
   231 
   232 
   232 				/* Non-found has precedence over compatibility load */
   233 				/* Non-found has precedence over compatibility load */
   233 				if (res != GLC_NOT_FOUND) res = GLC_COMPATIBLE;
   234 				if (res != GLC_NOT_FOUND) res = GLC_COMPATIBLE;
       
   235 				GamelogGRFCompatible(f);
   234 				goto compatible_grf;
   236 				goto compatible_grf;
   235 			}
   237 			}
   236 
   238 
   237 			/* No compatible grf was found, mark it as disabled */
   239 			/* No compatible grf was found, mark it as disabled */
   238 			md5sumToString(buf, lastof(buf), c->md5sum);
   240 			md5sumToString(buf, lastof(buf), c->md5sum);
   239 			DEBUG(grf, 0, "NewGRF %08X (%s) not found; checksum %s", BSWAP32(c->grfid), c->filename, buf);
   241 			DEBUG(grf, 0, "NewGRF %08X (%s) not found; checksum %s", BSWAP32(c->grfid), c->filename, buf);
       
   242 
       
   243 			GamelogGRFRemove(c->grfid);
   240 
   244 
   241 			c->status = GCS_NOT_FOUND;
   245 			c->status = GCS_NOT_FOUND;
   242 			res = GLC_NOT_FOUND;
   246 			res = GLC_NOT_FOUND;
   243 		} else {
   247 		} else {
   244 compatible_grf:
   248 compatible_grf: