… | |
… | |
234 | |
234 | |
235 | if (oldmap) |
235 | if (oldmap) |
236 | { |
236 | { |
237 | if (!op->contr->hidden) |
237 | if (!op->contr->hidden) |
238 | oldmap->players--; |
238 | oldmap->players--; |
|
|
239 | |
239 | if (oldmap->players <= 0) |
240 | if (oldmap->players <= 0) |
240 | { /* can be less than zero due to errors in tracking this */ |
241 | /* can be less than zero due to errors in tracking this */ |
241 | set_map_timeout (oldmap); |
242 | set_map_timeout (oldmap); |
242 | } |
|
|
243 | } |
243 | } |
244 | } |
244 | } |
245 | |
245 | |
246 | /* |
246 | /* |
247 | * enter_map(): Moves the player and pets from current map (if any) to |
247 | * enter_map(): Moves the player and pets from current map (if any) to |
… | |
… | |
305 | return; |
305 | return; |
306 | |
306 | |
307 | if (INVOKE_PLAYER (MAP_CHANGE, op->contr, ARG_MAP (newmap), ARG_INT (x), ARG_INT (y))) |
307 | if (INVOKE_PLAYER (MAP_CHANGE, op->contr, ARG_MAP (newmap), ARG_INT (x), ARG_INT (y))) |
308 | return; |
308 | return; |
309 | |
309 | |
310 | if (INVOKE_MAP (ENTER, op->map, ARG_PLAYER (op->contr), ARG_INT (x), ARG_INT (y))) |
310 | if (INVOKE_MAP (ENTER, newmap, ARG_PLAYER (op->contr), ARG_INT (x), ARG_INT (y))) |
311 | return; |
311 | return; |
312 | |
312 | |
313 | /* If it is a player login, he has yet to be inserted anyplace. |
313 | /* If it is a player login, he has yet to be inserted anyplace. |
314 | * otherwise, we need to deal with removing the player here. |
314 | * otherwise, we need to deal with removing the player here. |
315 | */ |
315 | */ |
… | |
… | |
785 | return; |
785 | return; |
786 | |
786 | |
787 | /* First, lets figure out what map the player is going to go to */ |
787 | /* First, lets figure out what map the player is going to go to */ |
788 | if (exit_ob) |
788 | if (exit_ob) |
789 | { |
789 | { |
790 | |
|
|
791 | /* check to see if we make a template map */ |
790 | /* check to see if we make a template map */ |
792 | if (EXIT_PATH (exit_ob) && EXIT_PATH (exit_ob)[1] == '@') |
791 | if (EXIT_PATH (exit_ob) && EXIT_PATH (exit_ob)[1] == '@') |
793 | { |
792 | { |
794 | if (EXIT_PATH (exit_ob)[2] == '!') |
793 | if (EXIT_PATH (exit_ob)[2] == '!') |
795 | { |
794 | { |
… | |
… | |
917 | else |
916 | else |
918 | { |
917 | { |
919 | int flags = 0; |
918 | int flags = 0; |
920 | maptile *newmap; |
919 | maptile *newmap; |
921 | |
920 | |
922 | |
|
|
923 | /* Hypothetically, I guess its possible that a standard map matches |
921 | /* Hypothetically, I guess its possible that a standard map matches |
924 | * the localdir, but that seems pretty unlikely - unlikely enough that |
922 | * the localdir, but that seems pretty unlikely - unlikely enough that |
925 | * I'm not going to attempt to try to deal with that possibility. |
923 | * I'm not going to attempt to try to deal with that possibility. |
926 | * We use the fact that when a player saves on a unique map, it prepends |
924 | * We use the fact that when a player saves on a unique map, it prepends |
927 | * the localdir to that name. So its an easy way to see of the map is |
925 | * the localdir to that name. So its an easy way to see of the map is |
… | |
… | |
947 | { |
945 | { |
948 | LOG (llevError, "enter_exit: could not load emergency map? Fatal error\n"); |
946 | LOG (llevError, "enter_exit: could not load emergency map? Fatal error\n"); |
949 | abort (); |
947 | abort (); |
950 | } |
948 | } |
951 | } |
949 | } |
|
|
950 | |
952 | enter_map (op, newmap, op->x, op->y); |
951 | enter_map (op, newmap, op->x, op->y); |
953 | } |
952 | } |
954 | } |
953 | } |
955 | |
954 | |
956 | /* |
955 | /* |
… | |
… | |
1453 | main (int argc, char **argv) |
1452 | main (int argc, char **argv) |
1454 | { |
1453 | { |
1455 | settings.argc = argc; |
1454 | settings.argc = argc; |
1456 | settings.argv = argv; |
1455 | settings.argv = argv; |
1457 | |
1456 | |
1458 | cfperl_init (); |
|
|
1459 | |
|
|
1460 | init (argc, argv); |
1457 | init (argc, argv); |
1461 | |
1458 | |
1462 | initPlugins (); |
1459 | initPlugins (); |
1463 | |
1460 | |
1464 | for (;;) |
1461 | for (;;) |