Merge branch 'master' into jgrpp

# Conflicts:
#	.github/workflows/commit-checker.yml
#	src/industry_cmd.cpp
#	src/industry_gui.cpp
#	src/landscape.cpp
#	src/linkgraph/linkgraph_gui.cpp
#	src/order_base.h
#	src/order_cmd.cpp
#	src/order_gui.cpp
#	src/saveload/afterload.cpp
#	src/saveload/league_sl.cpp
#	src/saveload/saveload.h
#	src/script/api/script_object.hpp
#	src/script/squirrel_helper.hpp
#	src/settings_table.cpp
#	src/station_cmd.cpp
#	src/table/settings.h.preamble
#	src/tree_cmd.cpp
#	src/tree_map.h
#	src/vehicle.cpp
#	src/waypoint_cmd.cpp
This commit is contained in:
Jonathan G Rennison
2023-03-04 16:44:23 +00:00
94 changed files with 1075 additions and 1558 deletions

View File

@@ -189,11 +189,13 @@ void GamelogPrint(GamelogPrintProc *proc)
switch (lc->ct) {
default: NOT_REACHED();
case GLCT_MODE:
/* Changing landscape, or going from scenario editor to game or back. */
buf += seprintf(buf, lastof(buffer), "New game mode: %u landscape: %u",
(uint)lc->mode.mode, (uint)lc->mode.landscape);
break;
case GLCT_REVISION:
/* The game was loaded in a diffferent version than before. */
buf += seprintf(buf, lastof(buffer), "Revision text changed to %s, savegame version %u, ",
lc->revision.text, lc->revision.slver);
@@ -207,6 +209,7 @@ void GamelogPrint(GamelogPrintProc *proc)
break;
case GLCT_OLDVER:
/* The game was loaded from before 0.7.0-beta1. */
buf += seprintf(buf, lastof(buffer), "Conversion from ");
switch (lc->oldver.type) {
default: NOT_REACHED();
@@ -237,10 +240,12 @@ void GamelogPrint(GamelogPrintProc *proc)
break;
case GLCT_SETTING:
/* A setting with the SF_NO_NETWORK flag got changed; these settings usually affect NewGRFs, such as road side or wagon speed limits. */
buf += seprintf(buf, lastof(buffer), "Setting changed: %s : %d -> %d", lc->setting.name, lc->setting.oldval, lc->setting.newval);
break;
case GLCT_GRFADD: {
/* A NewGRF got added to the game, either at the start of the game (never an issue), or later on when it could be an issue. */
const GRFConfig *gc = FindGRFConfig(lc->grfadd.grfid, FGCM_EXACT, lc->grfadd.md5sum);
buf += seprintf(buf, lastof(buffer), "Added NewGRF: ");
buf = PrintGrfInfo(buf, lastof(buffer), lc->grfadd.grfid, lc->grfadd.md5sum, gc);
@@ -251,6 +256,7 @@ void GamelogPrint(GamelogPrintProc *proc)
}
case GLCT_GRFREM: {
/* A NewGRF got removed from the game, either manually or by it missing when loading the game. */
GrfIDMapping::Pair *gm = grf_names.Find(lc->grfrem.grfid);
buf += seprintf(buf, lastof(buffer), la->at == GLAT_LOAD ? "Missing NewGRF: " : "Removed NewGRF: ");
buf = PrintGrfInfo(buf, lastof(buffer), lc->grfrem.grfid, nullptr, gm != grf_names.End() ? gm->second.gc : nullptr);
@@ -268,6 +274,7 @@ void GamelogPrint(GamelogPrintProc *proc)
}
case GLCT_GRFCOMPAT: {
/* Another version of the same NewGRF got loaded. */
const GRFConfig *gc = FindGRFConfig(lc->grfadd.grfid, FGCM_EXACT, lc->grfadd.md5sum);
buf += seprintf(buf, lastof(buffer), "Compatible NewGRF loaded: ");
buf = PrintGrfInfo(buf, lastof(buffer), lc->grfcompat.grfid, lc->grfcompat.md5sum, gc);
@@ -277,6 +284,7 @@ void GamelogPrint(GamelogPrintProc *proc)
}
case GLCT_GRFPARAM: {
/* A parameter of a NewGRF got changed after the game was started. */
GrfIDMapping::Pair *gm = grf_names.Find(lc->grfrem.grfid);
buf += seprintf(buf, lastof(buffer), "GRF parameter changed: ");
buf = PrintGrfInfo(buf, lastof(buffer), lc->grfparam.grfid, nullptr, gm != grf_names.End() ? gm->second.gc : nullptr);
@@ -285,6 +293,7 @@ void GamelogPrint(GamelogPrintProc *proc)
}
case GLCT_GRFMOVE: {
/* The order of NewGRFs got changed, which might cause some other NewGRFs to behave differently. */
GrfIDMapping::Pair *gm = grf_names.Find(lc->grfrem.grfid);
buf += seprintf(buf, lastof(buffer), "GRF order changed: %08X moved %d places %s",
BSWAP32(lc->grfmove.grfid), abs(lc->grfmove.offset), lc->grfmove.offset >= 0 ? "down" : "up" );
@@ -294,6 +303,7 @@ void GamelogPrint(GamelogPrintProc *proc)
}
case GLCT_GRFBUG: {
/* A specific bug in a NewGRF, that could cause wide spread problems, has been noted during the execution of the game. */
GrfIDMapping::Pair *gm = grf_names.Find(lc->grfrem.grfid);
switch (lc->grfbug.bug) {
default: NOT_REACHED();
@@ -307,6 +317,8 @@ void GamelogPrint(GamelogPrintProc *proc)
}
case GLCT_EMERGENCY:
/* At one point the savegame was made during the handling of a game crash.
* The generic code already mentioned the emergency savegame, and there is no extra information to log. */
break;
}