mirror of https://github.com/OpenTTD/OpenTTD
(svn r22447) [1.1] -Backport from trunk:
- Fix: Git revision detection would return too much when tags are involved (r22435) - Fix: [NewGRF] When action14 specified different values for the palette, the values were OR-ed. Use the last set value instead (r22416) - Fix: [Network] Kicking yourself via remote console crashes the server [FS#4606] (r22414) - Fix: [NewGRF] Make sure the action2 ID of a generic feature callback is valid (r22409)release/1.1
parent
eb4c66a4fb
commit
bde2fec339
|
@ -99,7 +99,7 @@ elif [ -d "$ROOT_DIR/.git" ]; then
|
|||
# No rev? Maybe it is a custom git-svn clone
|
||||
REV_NR=`LC_ALL=C git log --pretty=format:%b --grep="git-svn-id:.*@[0-9]*" -1 | sed "s@.*\@\([0-9]*\).*@\1@"`
|
||||
fi
|
||||
TAG="`git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null`"
|
||||
TAG="`git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null | sed 's@\^0$@@'`"
|
||||
if [ -n "$TAG" ]; then
|
||||
BRANCH=""
|
||||
REV="$TAG"
|
||||
|
|
|
@ -227,6 +227,9 @@ Function DetermineSVNVersion()
|
|||
Loop
|
||||
If oExec.ExitCode = 0 Then
|
||||
version = oExec.StdOut.ReadLine()
|
||||
If Right(version, 2) = "^0" Then
|
||||
version = Left(version, Len(version) - 2)
|
||||
End If
|
||||
branch = ""
|
||||
End If ' oExec.ExitCode = 0
|
||||
End If ' Err.Number = 0
|
||||
|
|
|
@ -495,7 +495,11 @@ static bool ConKickOrBan(const char *argv, bool ban)
|
|||
if (strchr(argv, '.') == NULL && strchr(argv, ':') == NULL) { // banning with ID
|
||||
ClientID client_id = (ClientID)atoi(argv);
|
||||
|
||||
if (client_id == CLIENT_ID_SERVER) {
|
||||
/* Don't kill the server, or the client doing the rcon. The latter can't be kicked because
|
||||
* kicking frees closes and subsequently free the connection related instances, which we
|
||||
* would be reading from and writing to after returning. So we would read or write data
|
||||
* from freed memory up till the segfault triggers. */
|
||||
if (client_id == CLIENT_ID_SERVER || client_id == _redirect_console_to_client) {
|
||||
IConsolePrintF(CC_ERROR, "ERROR: Silly boy, you can not %s yourself!", ban ? "ban" : "kick");
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -4568,6 +4568,7 @@ static void FeatureMapSpriteGroup(ByteReader *buf)
|
|||
/* Skip number of cargo ids? */
|
||||
buf->ReadByte();
|
||||
uint16 groupid = buf->ReadWord();
|
||||
if (!IsValidGroupID(groupid, "FeatureMapSpriteGroup")) return;
|
||||
|
||||
grfmsg(6, "FeatureMapSpriteGroup: Adding generic feature callback for feature %d", feature);
|
||||
|
||||
|
@ -6530,15 +6531,20 @@ static bool ChangeGRFPalette(size_t len, ByteReader *buf)
|
|||
buf->Skip(len);
|
||||
} else {
|
||||
char data = buf->ReadByte();
|
||||
GRFPalette pal = GRFP_GRF_UNSET;
|
||||
switch (data) {
|
||||
case '*':
|
||||
case 'A': _cur_grfconfig->palette |= GRFP_GRF_ANY; break;
|
||||
case 'W': _cur_grfconfig->palette |= GRFP_GRF_WINDOWS; break;
|
||||
case 'D': _cur_grfconfig->palette |= GRFP_GRF_DOS; break;
|
||||
case 'A': pal = GRFP_GRF_ANY; break;
|
||||
case 'W': pal = GRFP_GRF_WINDOWS; break;
|
||||
case 'D': pal = GRFP_GRF_DOS; break;
|
||||
default:
|
||||
grfmsg(2, "StaticGRFInfo: unexpected value '%02x' for 'INFO'->'PALS', ignoring this field", data);
|
||||
break;
|
||||
}
|
||||
if (pal != GRFP_GRF_UNSET) {
|
||||
_cur_grfconfig->palette &= ~GRFP_GRF_MASK;
|
||||
_cur_grfconfig->palette |= pal;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue