summaryrefslogtreecommitdiff
path: root/src/newgrf_town.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-11-24 14:41:19 +0000
committerfrosch <frosch@openttd.org>2013-11-24 14:41:19 +0000
commitdb894b0b3fa13413cdb76989cfcd2bb789243b77 (patch)
treefd61e4df264893e0c41b0d989f3294c3b4909b63 /src/newgrf_town.cpp
parent45a5aba8d55c68f54885c1de27684e8544e111d9 (diff)
downloadopenttd-db894b0b3fa13413cdb76989cfcd2bb789243b77.tar.xz
(svn r26085) -Codechange: Pass ResolverObjects as reference instead of pointer since they are never NULL.
Diffstat (limited to 'src/newgrf_town.cpp')
-rw-r--r--src/newgrf_town.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/newgrf_town.cpp b/src/newgrf_town.cpp
index 95cab9643..b6693d9ae 100644
--- a/src/newgrf_town.cpp
+++ b/src/newgrf_town.cpp
@@ -20,7 +20,7 @@
* @param t %Town of the scope.
* @param readonly Scope may change persistent storage of the town.
*/
-TownScopeResolver::TownScopeResolver(ResolverObject *ro, Town *t, bool readonly) : ScopeResolver(ro)
+TownScopeResolver::TownScopeResolver(ResolverObject &ro, Town *t, bool readonly) : ScopeResolver(ro)
{
this->t = t;
this->readonly = readonly;
@@ -43,8 +43,8 @@ TownScopeResolver::TownScopeResolver(ResolverObject *ro, Town *t, bool readonly)
/* Check the persistent storage for the GrfID stored in register 100h. */
uint32 grfid = GetRegister(0x100);
if (grfid == 0xFFFFFFFF) {
- if (this->ro->grffile == NULL) return 0;
- grfid = this->ro->grffile->grfid;
+ if (this->ro.grffile == NULL) return 0;
+ grfid = this->ro.grffile->grfid;
}
std::list<PersistentStorage *>::iterator iter;
@@ -135,14 +135,14 @@ TownScopeResolver::TownScopeResolver(ResolverObject *ro, Town *t, bool readonly)
assert(this->t != NULL);
/* We can't store anything if the caller has no #GRFFile. */
- if (this->ro->grffile == NULL) return;
+ if (this->ro.grffile == NULL) return;
/* Check the persistent storage for the GrfID stored in register 100h. */
uint32 grfid = GetRegister(0x100);
/* A NewGRF can only write in the persistent storage associated to its own GRFID. */
- if (grfid == 0xFFFFFFFF) grfid = this->ro->grffile->grfid;
- if (grfid != this->ro->grffile->grfid) return;
+ if (grfid == 0xFFFFFFFF) grfid = this->ro.grffile->grfid;
+ if (grfid != this->ro.grffile->grfid) return;
/* Check if the storage exists. */
std::list<PersistentStorage *>::iterator iter;
@@ -167,7 +167,7 @@ TownScopeResolver::TownScopeResolver(ResolverObject *ro, Town *t, bool readonly)
* @param readonly Scope may change persistent storage of the town.
*/
TownResolverObject::TownResolverObject(const struct GRFFile *grffile, Town *t, bool readonly)
- : ResolverObject(grffile), town_scope(this, t, readonly)
+ : ResolverObject(grffile), town_scope(*this, t, readonly)
{
}