summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_engine.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp
index ff22015dc..fcb4c764c 100644
--- a/src/newgrf_engine.cpp
+++ b/src/newgrf_engine.cpp
@@ -374,6 +374,7 @@ static inline const Vehicle *GRV(const ResolverObject *object)
case VSG_SCOPE_SELF: return object->u.vehicle.self;
case VSG_SCOPE_PARENT: return object->u.vehicle.parent;
case VSG_SCOPE_RELATIVE: {
+ if (object->u.vehicle.self == NULL) return NULL;
const Vehicle *v = NULL;
switch (GB(object->count, 6, 2)) {
default: NOT_REACHED();