From 76468197d7618e0e354c3199a060f91255a0d8d4 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 12 Jul 2020 20:41:24 +0200 Subject: [PATCH] empty convoys cannot be built on. --- src/kernel/ship.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/kernel/ship.c b/src/kernel/ship.c index 29867ca15..55cddbba8 100644 --- a/src/kernel/ship.c +++ b/src/kernel/ship.c @@ -146,12 +146,14 @@ void sunhash(ship * s) static ship *sfindhash(int i) { - ship *old; + ship *sh; - for (old = shiphash[i % MAXSHIPHASH]; old; old = old->nexthash) - if (old->no == i) - return old; - return 0; + for (sh = shiphash[i % MAXSHIPHASH]; sh; sh = sh->nexthash) { + if (sh->no == i) { + return sh->number > 0 ? sh : NULL; + } + } + return NULL; } struct ship *findship(int i)