mirror of https://github.com/OpenTTD/OpenTTD
(svn r9888) -Codechange: [NewGRF] allow non-spec cargo action2s to work, and using the goods sprite if really nothing is returned.
parent
44fc08391d
commit
c28cffdf67
|
@ -39,10 +39,12 @@ static uint32 CargoGetVariable(const ResolverObject *object, byte variable, byte
|
||||||
|
|
||||||
static const SpriteGroup *CargoResolveReal(const ResolverObject *object, const SpriteGroup *group)
|
static const SpriteGroup *CargoResolveReal(const ResolverObject *object, const SpriteGroup *group)
|
||||||
{
|
{
|
||||||
/* Cargo action 2s should always have only 1 "loaded" state */
|
/* Cargo action 2s should always have only 1 "loaded" state, but some
|
||||||
if (group->g.real.num_loaded == 0) return NULL;
|
* times things don't follow the spec... */
|
||||||
|
if (group->g.real.num_loaded > 0) return group->g.real.loaded[0];
|
||||||
|
if (group->g.real.num_loading > 0) return group->g.real.loading[0];
|
||||||
|
|
||||||
return group->g.real.loaded[0];
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -686,7 +686,7 @@ static void DrawCargoIcons(CargoID i, uint waiting, int x, int y)
|
||||||
sprite = cs->sprite;
|
sprite = cs->sprite;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sprite == 0) return;
|
if (sprite == 0) sprite = SPR_CARGO_GOODS;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
DrawSprite(sprite, PAL_NONE, x, y);
|
DrawSprite(sprite, PAL_NONE, x, y);
|
||||||
|
|
Loading…
Reference in New Issue