extern struct player *player_next(struct player *);
extern struct player *player_prev(struct player *);
extern struct player *getplayer(natid);
-extern struct player *player_find_other(struct player *, register natid);
extern void player_wakeup_all(natid);
extern void player_wakeup(struct player *);
extern void player_accept(void *);
return NULL;
}
-struct player *
-player_find_other(struct player *us, register natid cnum)
-{
- register struct emp_qelem *qp;
-
- for (qp = Players.q_forw; qp != &Players; qp = qp->q_forw)
- if (((struct player *)qp)->cnum == cnum &&
- ((struct player *)qp != us) &&
- (((struct player *)qp)->state == PS_PLAYING))
- return (struct player *)qp;
-
-
- return 0;
-}
-
void
player_wakeup_all(natid cnum)
{
pr_id(player, C_CMDERR, "need country and password\n");
return RET_FAIL;
}
- if ((other = player_find_other(player, (natid)player->cnum)) != 0) {
+ other = getplayer((natid)player->cnum);
+ if (other) {
natp = getnatp(player->cnum);
if (natp->nat_stat != VIS) {
pr_id(player, C_EXIT, "country in use by %s\n", praddr(other));
pr_id(player, C_CMDERR, "need country and password\n");
return RET_FAIL;
}
- /* XXX find cnum other than us */
- if ((other = player_find_other(player, player->cnum)) == 0) {
+ other = getplayer(player->cnum);
+ if (!other) {
pr_id(player, C_EXIT, "country not in use\n");
return RET_FAIL;
}