Merge branch 'master' into jgrpp

This commit is contained in:
Jonathan G Rennison
2021-02-21 19:51:00 +00:00
7 changed files with 36 additions and 47 deletions

View File

@@ -4135,6 +4135,7 @@ static ChangeInfoResult ObjectChangeInfo(uint id, int numinfo, int prop, const G
if (*ospec == nullptr) {
*ospec = CallocT<ObjectSpec>(1);
(*ospec)->views = 1; // Default for NewGRFs that don't set it.
(*ospec)->size = 0x11; // Default for NewGRFs that manage to not set it (1x1)
}
/* Swap classid because we read it in BE. */
@@ -4160,6 +4161,10 @@ static ChangeInfoResult ObjectChangeInfo(uint id, int numinfo, int prop, const G
case 0x0C: // Size
spec->size = buf->ReadByte();
if ((spec->size & 0xF0) == 0 || (spec->size & 0x0F) == 0) {
grfmsg(1, "ObjectChangeInfo: Invalid object size requested (%u) for object id %u. Ignoring.", spec->size, id + i);
spec->size = 0x11; // 1x1
}
break;
case 0x0D: // Build cost multipler