| version 1.9 | | version 1.10 |
|---|
| | |
| /* | | /* |
| * static char *rcsid_swap_c = | | * static char *rcsid_swap_c = |
| * "$Id: swap.c,v 1.9 2002/04/21 05:23:20 mwedel Exp $"; | | * "$Id: swap.c,v 1.10 2002/09/28 07:19:40 mwedel Exp $"; |
| */ | | */ |
| | | |
| /* | | /* |
| | |
| /* | | /* |
| * players_on_map(): will be replaced by map->players when I'm satisfied | | * players_on_map(): will be replaced by map->players when I'm satisfied |
| * that the variable is always correct. | | * that the variable is always correct. |
| | | * If show_all is true, we show everyone. If not, we don't show hidden |
| | | * players (dms) |
| */ | | */ |
| | | |
| int players_on_map(mapstruct *m) { | | int players_on_map(mapstruct *m, int show_all) { |
| player *pl; | | player *pl; |
| int nr=0; | | int nr=0; |
| for(pl=first_player;pl!=NULL;pl=pl->next) | | for(pl=first_player;pl!=NULL;pl=pl->next) |
| if(pl->ob != NULL && !QUERY_FLAG(pl->ob,FLAG_REMOVED) && pl->ob->map==m) | | if(pl->ob != NULL && !QUERY_FLAG(pl->ob,FLAG_REMOVED) && pl->ob->map==m && |
| | | (show_all || !pl->hidden)) |
| nr++; | | nr++; |
| return nr; | | return nr; |
| } | | } |
| | |
| * is not set so it isn't swapped out. | | * is not set so it isn't swapped out. |
| */ | | */ |
| if ((m->in_memory == MAP_IN_MEMORY) && (m->timeout==0) && | | if ((m->in_memory == MAP_IN_MEMORY) && (m->timeout==0) && |
| !players_on_map(m)) { | | !players_on_map(m,TRUE)) { |
| set_map_timeout(m); | | set_map_timeout(m); |
| } | | } |
| | | |