Streamline plist initialization
msl_equip(), find_escorts() and perform_mission() memset() the plist, then assign to all members but load. Just zero load instead, like getilists(), msl_sel() and pln_sel() do.
This commit is contained in:
parent
48f3d1c033
commit
bad2fd5aac
2 changed files with 3 additions and 4 deletions
|
@ -329,7 +329,7 @@ find_escorts(coord x, coord y, natid cn, struct emp_qelem *escorts)
|
|||
if (!in_oparea((struct empobj *)&plane, x, y))
|
||||
continue;
|
||||
plp = malloc(sizeof(struct plist));
|
||||
memset(plp, 0, sizeof(struct plist));
|
||||
plp->load = 0;
|
||||
plp->pcp = &plchr[(int)plane.pln_type];
|
||||
plp->plane = plane;
|
||||
emp_insque(&plp->queue, escorts);
|
||||
|
@ -371,8 +371,7 @@ perform_mission(coord x, coord y, natid victim, struct emp_qelem *list,
|
|||
else {
|
||||
/* save planes for later */
|
||||
plp = malloc(sizeof(struct plist));
|
||||
|
||||
memset(plp, 0, sizeof(struct plist));
|
||||
plp->load = 0;
|
||||
plp->pcp = pcp;
|
||||
memcpy(&plp->plane, glp->thing, sizeof(struct plnstr));
|
||||
if (plp->pcp->pl_flags & P_M)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue