ship: Unbreak MOB_ACCESS real-time mobility update for ships
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 24 Jan 2021 16:11:26 +0000 (17:11 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 6 Feb 2021 15:55:37 +0000 (16:55 +0100)
Ships owned by countries with even country number don't gain mobility
in real-time.  This is due to a classic brown-paperbag typo in the
condition guarding mob_inc_ship() in shp_postread(): & instead of &&.
Fix it.

Fixes: dd9e393b3 "subs: Simplify MOB_ACCESS mobility update", v4.4.0
Reported-by: Phil Miron <Philthy74@hotmail.com>
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/subs/ship.c

index 7b257941a0aa9cf949c4e1ff1cd2d4749cce9c74..fe63e69bc1523b249a69dcf58c7b05dfce3f3f93 100644 (file)
@@ -56,7 +56,7 @@ shp_postread(int n, void *ptr)
 
     player->owner = (player->god || sp->shp_own == player->cnum);
 
-    if (opt_MOB_ACCESS & sp->shp_own && !update_running)
+    if (opt_MOB_ACCESS && sp->shp_own && !update_running)
        mob_inc_ship(sp, game_tick_to_now(&sp->shp_access));
 }