diff options
author | smatz <smatz@openttd.org> | 2009-05-18 16:21:28 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-05-18 16:21:28 +0000 |
commit | 8808f3beea881af5652716c883a21c8031b5e390 (patch) | |
tree | bc14c65d1e66c407b72d254fc926d105eea2f1e4 /src/group.h | |
parent | 5fe906e14992f7a301ae94c357e80af076ab7a63 (diff) | |
download | openttd-8808f3beea881af5652716c883a21c8031b5e390.tar.xz |
(svn r16352) -Codechange: use PoolItem::GetIfValid() instead of PoolItem::IsValidID() and PoolItem::Get()
Diffstat (limited to 'src/group.h')
-rw-r--r-- | src/group.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/group.h b/src/group.h index 445e3a66f..b09da0a17 100644 --- a/src/group.h +++ b/src/group.h @@ -72,12 +72,14 @@ uint GetGroupNumEngines(CompanyID company, GroupID id_g, EngineID id_e); static inline void IncreaseGroupNumVehicle(GroupID id_g) { - if (Group::IsValidID(id_g)) Group::Get(id_g)->num_vehicle++; + Group *g = Group::GetIfValid(id_g); + if (g != NULL) g->num_vehicle++; } static inline void DecreaseGroupNumVehicle(GroupID id_g) { - if (Group::IsValidID(id_g)) Group::Get(id_g)->num_vehicle--; + Group *g = Group::GetIfValid(id_g); + if (g != NULL) g->num_vehicle--; } |