mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r4459) - Newstations: check pointer for NULL before using it.
This commit is contained in:
parent
3a06cbf195
commit
71b530dfe2
@ -117,6 +117,7 @@ const StationSpec *GetCustomStation(StationClassID sclass, uint station)
|
||||
|
||||
static const RealSpriteGroup *ResolveStationSpriteGroup(const SpriteGroup *spg, const Station *st)
|
||||
{
|
||||
if (spg == NULL) return NULL;
|
||||
switch (spg->type) {
|
||||
case SGT_REAL:
|
||||
return &spg->g.real;
|
||||
@ -183,6 +184,7 @@ static const RealSpriteGroup *ResolveStationSpriteGroup(const SpriteGroup *spg,
|
||||
uint32 GetCustomStationRelocation(const StationSpec *spec, const Station *st, byte ctype)
|
||||
{
|
||||
const RealSpriteGroup *rsg = ResolveStationSpriteGroup(spec->spritegroup[ctype], st);
|
||||
if (rsg == NULL) return 0;
|
||||
|
||||
if (rsg->sprites_per_set != 0) {
|
||||
if (rsg->loading_count != 0) return rsg->loading[0]->g.result.result;
|
||||
|
Loading…
Reference in New Issue
Block a user