Lines Matching refs:pp

73           PLANE     *pp, *p1, *p2;  in update()  local
87 for (pp = ground.head; pp != NULL; pp = pp->next) { in update()
88 if (pp->new_altitude > 0) { in update()
89 delete(&ground, pp); in update()
90 append(&air, pp); in update()
98 for (pp = air.head; pp != NULL; pp = pp->next) { in update()
100 if (pp->plane_type == 0 && clck & 1) in update()
103 pp->fuel--; in update()
104 if (pp->fuel < 0) in update()
105 loser(pp, "ran out of fuel."); in update()
107 pp->altitude += SGN(pp->new_altitude - pp->altitude); in update()
109 if (!pp->delayd) { in update()
110 dir_diff = pp->new_dir - pp->dir; in update()
114 if (pp->new_dir >= 0 && pp->new_dir < MAXDIR) { in update()
124 pp->dir += dir_diff; in update()
125 if (pp->dir >= MAXDIR) in update()
126 pp->dir -= MAXDIR; in update()
127 else if (pp->dir < 0) in update()
128 pp->dir += MAXDIR; in update()
130 pp->xpos += displacement[pp->dir].dx; in update()
131 pp->ypos += displacement[pp->dir].dy; in update()
133 if (pp->delayd && pp->xpos == sp->beacon[pp->delayd_no].x && in update()
134 pp->ypos == sp->beacon[pp->delayd_no].y) { in update()
135 pp->delayd = false; in update()
136 if (pp->status == S_UNMARKED) in update()
137 pp->status = S_MARKED; in update()
140 switch (pp->dest_type) { in update()
142 if (pp->xpos == sp->airport[pp->dest_no].x && in update()
143 pp->ypos == sp->airport[pp->dest_no].y && in update()
144 pp->altitude == 0) { in update()
145 if (pp->dir != sp->airport[pp->dest_no].dir) in update()
146 loser(pp, "landed in the wrong direction."); in update()
148 pp->status = S_GONE; in update()
154 if (pp->xpos == sp->exit[pp->dest_no].x && in update()
155 pp->ypos == sp->exit[pp->dest_no].y) { in update()
156 if (pp->altitude != 9) in update()
157 loser(pp, "exited at the wrong altitude."); in update()
159 pp->status = S_GONE; in update()
165 loser(pp, "has a bizarre destination, get help!"); in update()
167 if (pp->altitude > 9) in update()
169 loser(pp, "exceeded flight ceiling."); in update()
170 if (pp->altitude <= 0) { in update()
172 if (pp->xpos == sp->airport[i].x && in update()
173 pp->ypos == sp->airport[i].y) { in update()
174 if (pp->dest_type == T_AIRPORT) in update()
175 loser(pp, in update()
178 loser(pp, in update()
181 loser(pp, "crashed on the ground."); in update()
183 if (pp->xpos < 1 || pp->xpos >= sp->width - 1 || in update()
184 pp->ypos < 1 || pp->ypos >= sp->height - 1) { in update()
186 if (pp->xpos == sp->exit[i].x && in update()
187 pp->ypos == sp->exit[i].y) { in update()
188 if (pp->dest_type == T_EXIT) in update()
189 loser(pp, in update()
192 loser(pp, in update()
195 loser(pp, "illegally left the flight arena."); in update()
202 for (pp = air.head; pp != NULL; pp = p2) { in update()
203 p2 = pp->next; in update()
204 if (pp->status == S_GONE) { in update()
206 delete(&air, pp); in update()
262 command(const PLANE *pp) in command() argument
270 (void)snprintf(bp, bpsize, "%c%d%c%c%u: ", name(pp), pp->altitude, in command()
271 (pp->fuel < LOWFUEL) ? '*' : ' ', in command()
272 (pp->dest_type == T_AIRPORT) ? 'A' : 'E', pp->dest_no); in command()
276 if (pp->altitude == 0) in command()
277 (void)snprintf(bp, bpsize, "Holding @ A%u", pp->orig_no); in command()
278 else if (pp->new_dir >= MAXDIR || pp->new_dir < 0) in command()
280 else if (pp->new_dir != pp->dir) in command()
281 (void)snprintf(bp, bpsize, "%d", dir_deg(pp->new_dir)); in command()
285 if (pp->delayd) in command()
286 (void)snprintf(bp, bpsize, " @ B%u", pp->delayd_no); in command()
291 (pp->status == S_UNMARKED || pp->status == S_IGNORED)) in command()
320 PLANE *pp; in next_plane() local
328 for (pp = air.head; pp != NULL; pp = pp->next) in next_plane()
329 if (pp->plane_no == last_plane) { in next_plane()
334 for (pp = ground.head; pp != NULL; pp = pp->next) in next_plane()
335 if (pp->plane_no == last_plane) { in next_plane()
348 PLANE p, *pp, *p1; in addplane() local
406 pp = newplane(); in addplane()
407 if (pp == NULL) in addplane()
409 (void)memcpy(pp, &p, sizeof (p)); in addplane()
411 if (pp->orig_type == T_AIRPORT) in addplane()
412 append(&ground, pp); in addplane()
414 append(&air, pp); in addplane()
420 PLANE *pp; in findplane() local
422 for (pp = air.head; pp != NULL; pp = pp->next) in findplane()
423 if (pp->plane_no == n) in findplane()
424 return (pp); in findplane()
425 for (pp = ground.head; pp != NULL; pp = pp->next) in findplane()
426 if (pp->plane_no == n) in findplane()
427 return (pp); in findplane()