Compute radar range in one place, rad_range()

Before, a part was duplicated in radmap() and rad_map_set(), and
another part in their callers.
This commit is contained in:
Markus Armbruster 2010-06-20 16:19:22 +02:00
parent e49cb13480
commit e41762ca49
5 changed files with 36 additions and 28 deletions

View file

@ -732,7 +732,6 @@ shp_nav_one_sector(struct emp_qelem *list, int dir, natid actor,
coord newy;
int stopping = 0;
double mobcost;
double tech; /* for mapping */
char dp[80];
int navigate;
@ -785,11 +784,10 @@ shp_nav_one_sector(struct emp_qelem *list, int dir, natid actor,
putship(mlp->unit.ship.shp_uid, &mlp->unit.ship);
/* Now update the map for this ship */
tech = techfact(mlp->unit.ship.shp_tech,
((struct mchrstr *)mlp->chrp)->m_vrnge);
rad_map_set(mlp->unit.ship.shp_own,
mlp->unit.ship.shp_x, mlp->unit.ship.shp_y,
mlp->unit.ship.shp_effic, (int)tech);
mlp->unit.ship.shp_effic, mlp->unit.ship.shp_tech,
((struct mchrstr *)mlp->chrp)->m_vrnge);
}
if (QEMPTY(list))
return stopping;