mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-30 19:08:00 +00:00
(svn r658) Ignore callbackish randomized spritegroups - they would just crash us (pasky)
This commit is contained in:
parent
155f20329b
commit
c4e9896851
@ -1212,6 +1212,13 @@ static void NewSpriteGroup(byte *buf, int len)
|
|||||||
rg->groups = calloc(rg->num_groups, sizeof(*rg->groups));
|
rg->groups = calloc(rg->num_groups, sizeof(*rg->groups));
|
||||||
for (i = 0; i < rg->num_groups; i++) {
|
for (i = 0; i < rg->num_groups; i++) {
|
||||||
uint16 groupid = grf_load_word(&buf);
|
uint16 groupid = grf_load_word(&buf);
|
||||||
|
|
||||||
|
if (groupid & 0x8000 || groupid >= _cur_grffile->spritegroups_count) {
|
||||||
|
/* This doesn't exist for us. */
|
||||||
|
i--;
|
||||||
|
rg->num_groups--;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
/* XXX: If multiple surreal sets attach a surreal
|
/* XXX: If multiple surreal sets attach a surreal
|
||||||
* set this way, we are in trouble. */
|
* set this way, we are in trouble. */
|
||||||
rg->groups[i] = _cur_grffile->spritegroups[groupid];
|
rg->groups[i] = _cur_grffile->spritegroups[groupid];
|
||||||
|
Loading…
Reference in New Issue
Block a user