(put_empobj): New. Put generic empobj into the appropriate data file.

(get_empobj_chr): New.  Get characteristics for empobj.
(mission, build_mission_list_type): Switch to use new
functions put_empobj() and get_empobj_chr().
This commit is contained in:
Ron Koenderink 2006-07-20 14:12:35 +00:00
parent 8e7199c338
commit a62989d4a3
4 changed files with 50 additions and 22 deletions

View file

@ -362,17 +362,7 @@ build_mission_list_type(struct genlist *mi, coord x, coord y, int mission,
glp = malloc(sizeof(struct genlist));
memset(glp, 0, sizeof(struct genlist));
glp->type = type;
switch (type) {
case EF_LAND:
glp->cp = &lchr[(int)gp->type];
break;
case EF_SHIP:
glp->cp = &mchr[(int)gp->type];
break;
case EF_PLANE:
glp->cp = &plchr[(int)gp->type];
break;
}
glp->cp = get_empobj_chr(gp);
glp->thing = malloc(sizeof(item));
memcpy(glp->thing, &item, sizeof(item));
emp_insque(&glp->queue, &mi[gp->own].queue);