mirror of https://github.com/OpenTTD/OpenTTD
(svn r24908) -Fix [FS#5419]: Allow GSs to pass negative integer string parameters (frosch123)
parent
5c242c64a3
commit
07ffc90bf4
|
@ -183,7 +183,7 @@ char *ScriptText::_GetEncodedText(char *p, char *lastofp)
|
||||||
p = this->paramt[i]->_GetEncodedText(p, lastofp);
|
p = this->paramt[i]->_GetEncodedText(p, lastofp);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
p += seprintf(p, lastofp,":%X", this->parami[i]);
|
p += seprintf(p, lastofp,":%X", (uint32)this->parami[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
|
|
|
@ -867,7 +867,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||||
bool lookup = (l == SCC_ENCODED);
|
bool lookup = (l == SCC_ENCODED);
|
||||||
if (lookup) s += len;
|
if (lookup) s += len;
|
||||||
|
|
||||||
param = strtol(s, &p, 16);
|
param = (int32)strtoul(s, &p, 16);
|
||||||
|
|
||||||
if (lookup) {
|
if (lookup) {
|
||||||
if (param >= TAB_SIZE) {
|
if (param >= TAB_SIZE) {
|
||||||
|
|
Loading…
Reference in New Issue