Lines Matching refs:pp

56           PLANE     *pp, *p1, *p2;  in update()  local
67 for (pp = ground.head; pp != NULL; pp = pp->next) { in update()
68 if (pp->new_altitude > 0) { in update()
69 delete(&ground, pp); in update()
70 append(&air, pp); in update()
78 for (pp = air.head; pp != NULL; pp = pp->next) { in update()
80 if (pp->plane_type == 0 && clck & 1) in update()
83 pp->fuel--; in update()
84 if (pp->fuel < 0) in update()
85 loser(pp, "ran out of fuel."); in update()
87 pp->altitude += SGN(pp->new_altitude - pp->altitude); in update()
89 if (!pp->delayd) { in update()
90 dir_diff = pp->new_dir - pp->dir; in update()
94 if (pp->new_dir >= 0 && pp->new_dir < MAXDIR) { in update()
104 pp->dir += dir_diff; in update()
105 if (pp->dir >= MAXDIR) in update()
106 pp->dir -= MAXDIR; in update()
107 else if (pp->dir < 0) in update()
108 pp->dir += MAXDIR; in update()
110 pp->xpos += displacement[pp->dir].dx; in update()
111 pp->ypos += displacement[pp->dir].dy; in update()
113 if (pp->delayd && pp->xpos == sp->beacon[pp->delayd_no].x && in update()
114 pp->ypos == sp->beacon[pp->delayd_no].y) { in update()
115 pp->delayd = 0; in update()
116 if (pp->status == S_UNMARKED) in update()
117 pp->status = S_MARKED; in update()
120 switch (pp->dest_type) { in update()
122 if (pp->xpos == sp->airport[pp->dest_no].x && in update()
123 pp->ypos == sp->airport[pp->dest_no].y && in update()
124 pp->altitude == 0) { in update()
125 if (pp->dir != sp->airport[pp->dest_no].dir) in update()
126 loser(pp, "landed in the wrong direction."); in update()
128 pp->status = S_GONE; in update()
134 if (pp->xpos == sp->exit[pp->dest_no].x && in update()
135 pp->ypos == sp->exit[pp->dest_no].y) { in update()
136 if (pp->altitude != 9) in update()
137 loser(pp, "exited at the wrong altitude."); in update()
139 pp->status = S_GONE; in update()
145 loser(pp, "has a bizarre destination, get help!"); in update()
147 if (pp->altitude > 9) in update()
149 loser(pp, "exceded flight ceiling."); in update()
150 if (pp->altitude <= 0) { in update()
152 if (pp->xpos == sp->airport[i].x && in update()
153 pp->ypos == sp->airport[i].y) { in update()
154 if (pp->dest_type == T_AIRPORT) in update()
155 loser(pp, in update()
158 loser(pp, in update()
161 loser(pp, "crashed on the ground."); in update()
163 if (pp->xpos < 1 || pp->xpos >= sp->width - 1 || in update()
164 pp->ypos < 1 || pp->ypos >= sp->height - 1) { in update()
166 if (pp->xpos == sp->exit[i].x && in update()
167 pp->ypos == sp->exit[i].y) { in update()
168 if (pp->dest_type == T_EXIT) in update()
169 loser(pp, in update()
172 loser(pp, in update()
175 loser(pp, "illegally left the flight arena."); in update()
182 for (pp = air.head; pp != NULL; pp = p2) { in update()
183 p2 = pp->next; in update()
184 if (pp->status == S_GONE) { in update()
186 delete(&air, pp); in update()
213 command(const PLANE *pp) in command() argument
219 sprintf(bp, "%c%d%c%c%d: ", name(pp), pp->altitude, in command()
220 (pp->fuel < LOWFUEL) ? '*' : ' ', in command()
221 (pp->dest_type == T_AIRPORT) ? 'A' : 'E', pp->dest_no); in command()
224 if (pp->altitude == 0) in command()
225 sprintf(bp, "Holding @ A%d", pp->orig_no); in command()
226 else if (pp->new_dir >= MAXDIR || pp->new_dir < 0) in command()
228 else if (pp->new_dir != pp->dir) in command()
229 sprintf(bp, "%d", dir_deg(pp->new_dir)); in command()
232 if (pp->delayd) in command()
233 sprintf(bp, " @ B%d", pp->delayd_no); in command()
237 (pp->status == S_UNMARKED || pp->status == S_IGNORED)) in command()
267 PLANE *pp; in next_plane() local
275 for (pp = air.head; pp != NULL; pp = pp->next) in next_plane()
276 if (pp->plane_no == last_plane) { in next_plane()
281 for (pp = ground.head; pp != NULL; pp = pp->next) in next_plane()
282 if (pp->plane_no == last_plane) { in next_plane()
295 PLANE p, *pp, *p1; in addplane() local
352 pp = newplane(); in addplane()
353 bcopy(&p, pp, sizeof (p)); in addplane()
355 if (pp->orig_type == T_AIRPORT) in addplane()
356 append(&ground, pp); in addplane()
358 append(&air, pp); in addplane()
360 return (pp->dest_type); in addplane()
366 PLANE *pp; in findplane() local
368 for (pp = air.head; pp != NULL; pp = pp->next) in findplane()
369 if (pp->plane_no == n) in findplane()
370 return (pp); in findplane()
371 for (pp = ground.head; pp != NULL; pp = pp->next) in findplane()
372 if (pp->plane_no == n) in findplane()
373 return (pp); in findplane()