Merge branch 'master' into jgrpp

# Conflicts:
#	src/lang/simplified_chinese.txt
#	src/network/core/tcp_content.cpp
#	src/network/core/udp.cpp
#	src/network/network_server.cpp
#	src/saveload/linkgraph_sl.cpp
#	src/table/gameopt_settings.ini
This commit is contained in:
Jonathan G Rennison
2021-04-25 01:23:38 +01:00
96 changed files with 250 additions and 2653 deletions

View File

@@ -110,8 +110,11 @@ static void Load_GLOG_common(LoggedAction *&gamelog_action, uint &gamelog_action
assert(gamelog_action == nullptr);
assert(gamelog_actions == 0);
GamelogActionType at;
while ((at = (GamelogActionType)SlReadByte()) != GLAT_NONE) {
byte type;
while ((type = SlReadByte()) != GLAT_NONE) {
if (type >= GLAT_END) SlErrorCorrupt("Invalid gamelog action type");
GamelogActionType at = (GamelogActionType)type;
gamelog_action = ReallocT(gamelog_action, gamelog_actions + 1);
LoggedAction *la = &gamelog_action[gamelog_actions++];
@@ -121,8 +124,10 @@ static void Load_GLOG_common(LoggedAction *&gamelog_action, uint &gamelog_action
la->change = nullptr;
la->changes = 0;
GamelogChangeType ct;
while ((ct = (GamelogChangeType)SlReadByte()) != GLCT_NONE) {
while ((type = SlReadByte()) != GLCT_NONE) {
if (type >= GLCT_END) SlErrorCorrupt("Invalid gamelog change type");
GamelogChangeType ct = (GamelogChangeType)type;
la->change = ReallocT(la->change, la->changes + 1);
LoggedChange *lc = &la->change[la->changes++];
@@ -130,8 +135,6 @@ static void Load_GLOG_common(LoggedAction *&gamelog_action, uint &gamelog_action
memset(lc, 0, sizeof(*lc));
lc->ct = ct;
assert((uint)ct < GLCT_END);
SlObject(lc, _glog_desc[ct]);
if (ct == GLCT_REVISION && SlXvIsFeatureMissing(XSLFI_EXTENDED_GAMELOG)) {
lc->revision.text = stredup(old_revision_text, lastof(old_revision_text));

View File

@@ -183,6 +183,7 @@ void Load_LinkGraph(LinkGraph &lg)
} else {
/* ... but as that wasted a lot of space we save a sparse matrix now. */
for (NodeID to = from; to != INVALID_NODE; to = lg.edges[from][to].next_edge) {
if (to >= size) SlErrorCorrupt("Link graph structure overflow");
SlObjectLoadFiltered(&lg.edges[from][to], _filtered_edge_desc.data());
}
}