diff options
author | glx <glx@openttd.org> | 2008-03-27 21:36:16 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2008-03-27 21:36:16 +0000 |
commit | bbdb831301bcb1f090e578f36d94d80460f8e7a7 (patch) | |
tree | 34162967a065797d3c669ce564b884065fe86878 /src/newgrf.cpp | |
parent | 5ddb78af9fdaee3edc40b30eee6e2ccad4864f67 (diff) | |
download | openttd-bbdb831301bcb1f090e578f36d94d80460f8e7a7.tar.xz |
(svn r12452) -Feature: [NewGRF] Add random action 2 type 84. For vehicles only.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r-- | src/newgrf.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 5d405b483..23cf67c14 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -2584,13 +2584,19 @@ static void NewSpriteGroup(byte *buf, int len) /* Randomized Sprite Group */ case 0x80: // Self scope case 0x83: // Parent scope + case 0x84: // Relative scope { - if (!check_length(bufend - buf, 7, "NewSpriteGroup (Randomized) (1)")) return; + if (!check_length(bufend - buf, HasBit(type, 2) ? 8 : 7, "NewSpriteGroup (Randomized) (1)")) return; group = AllocateSpriteGroup(); group->type = SGT_RANDOMIZED; group->g.random.var_scope = HasBit(type, 1) ? VSG_SCOPE_PARENT : VSG_SCOPE_SELF; + if (HasBit(type, 2) && feature <= GSF_AIRCRAFT) { + group->g.random.var_scope = VSG_SCOPE_RELATIVE; + group->g.random.count = grf_load_byte(&buf); + } + uint8 triggers = grf_load_byte(&buf); group->g.random.triggers = GB(triggers, 0, 7); group->g.random.cmp_mode = HasBit(triggers, 7) ? RSG_CMP_ALL : RSG_CMP_ANY; |