(miss): Use new get_empobj_mob_max().
extern char *obj_nameof(struct empobj *gp);
extern int put_empobj(struct empobj *gp);
extern void *get_empobj_chr(struct empobj *gp);
+extern int get_empobj_mob_max(int ef_type);
#endif
desired_radius = 9999;
}
- switch (type) {
- case EF_SHIP:
- mobmax = ship_mob_max;
- break;
- case EF_LAND:
- mobmax = land_mob_max;
- break;
- case EF_PLANE:
- mobmax = plane_mob_max;
- break;
- default:
- CANT_HAPPEN("bad TYPE");
+ if ((mobmax = get_empobj_mob_max(type)) == -1)
return RET_FAIL;
- }
mobused = ldround(mission_mob_cost * (double)mobmax, 1);
#include "empobj.h"
#include "file.h"
+#include "optlist.h"
#include "prototypes.h"
char *
}
return cp;
}
+
+int
+get_empobj_mob_max(int ef_type)
+{
+ switch (ef_type) {
+ case EF_SHIP:
+ return ship_mob_max;
+ case EF_LAND:
+ return land_mob_max;
+ case EF_PLANE:
+ return plane_mob_max;
+ case EF_SECTOR:
+ return sect_mob_max;
+ default:
+ CANT_REACH();
+ return -1;
+ }
+}