mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r4707) - NewGRF: minor code duffage; return early and less indentation.
This commit is contained in:
parent
744e917c34
commit
a364ec2397
@ -264,7 +264,8 @@ int AllocateSpecToStation(const StationSpec *statspec, Station *st, bool exec)
|
|||||||
if (st->speclist[i].spec == NULL && st->speclist[i].grfid == 0) break;
|
if (st->speclist[i].spec == NULL && st->speclist[i].grfid == 0) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i < 256) {
|
if (i == 256) return -1;
|
||||||
|
|
||||||
if (exec) {
|
if (exec) {
|
||||||
if (i >= st->num_specs) {
|
if (i >= st->num_specs) {
|
||||||
st->num_specs = i + 1;
|
st->num_specs = i + 1;
|
||||||
@ -282,10 +283,8 @@ int AllocateSpecToStation(const StationSpec *statspec, Station *st, bool exec)
|
|||||||
st->speclist[i].grfid = statspec->grfid;
|
st->speclist[i].grfid = statspec->grfid;
|
||||||
st->speclist[i].localidx = statspec->localidx;
|
st->speclist[i].localidx = statspec->localidx;
|
||||||
}
|
}
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user