From a4b0afba5103781e1e1151de9b582e6cf05d4a06 Mon Sep 17 00:00:00 2001 From: Artyom Trityak Date: Tue, 1 Oct 2019 18:45:03 -0700 Subject: [PATCH] Prevent sailing towards null hex --- object.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/object.cpp b/object.cpp index eae3c6ec..60325ab8 100644 --- a/object.cpp +++ b/object.cpp @@ -617,8 +617,8 @@ int Object::SailThroughCheck(int dir) // fleet is not flying and it is in a land region. Check that it // doesn's sail inland - if (TerrainDefs[region->neighbors[dir]->type].similar_type != R_OCEAN) { - // sailing inland + if (!region->neighbors[dir] || TerrainDefs[region->neighbors[dir]->type].similar_type != R_OCEAN) { + // sailing inland or towards null hex return 0; }