version 1.5 | | version 1.6 |
---|
| | |
/* | | /* |
* static char *rcsid_main_c = | | * static char *rcsid_main_c = |
* "$Id: main.c,v 1.5 1999/08/14 13:35:12 damn Exp $"; | | * "$Id: main.c,v 1.6 1999/09/17 18:49:25 damn Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
return; | | return; |
} | | } |
} else | | } else |
newpath = op->contr->maplevel; | | if(op->contr) newpath = op->contr->maplevel; |
| | |
/* If no map path has been found yet, just keep the player on the | | /* If no map path has been found yet, just keep the player on the |
* map he is on right now | | * map he is on right now |
| | |
if (check_path(newpath, 0) != - 1) { | | if (check_path(newpath, 0) != - 1) { |
unique=1; | | unique=1; |
} else if (!unique && !has_been_loaded(newpath) && (check_path(newpath,1)==-1)) { | | } else if (!unique && !has_been_loaded(newpath) && (check_path(newpath,1)==-1)) { |
| | if(op->type == PLAYER) |
new_draw_info_format(NDI_UNIQUE, 0,op, "The %s is closed.", newpath); | | new_draw_info_format(NDI_UNIQUE, 0,op, "The %s is closed.", newpath); |
return; | | return; |
} | | } |
| | |
/* Clear the player's count, and reset direction */ | | /* Clear the player's count, and reset direction */ |
| | if(op->type == PLAYER) { |
op->direction=0; | | op->direction=0; |
op->contr->count=0; | | op->contr->count=0; |
op->contr->count_left=0; | | op->contr->count_left=0; |
| | } |
/* For exits that cause damages (like pits) */ | | /* For exits that cause damages (like pits) */ |
if(exit_ob && exit_ob->stats.dam && op->type==PLAYER) | | if(exit_ob && exit_ob->stats.dam && op->type==PLAYER) |
hit_player(op,exit_ob->stats.dam,exit_ob,exit_ob->attacktype); | | hit_player(op,exit_ob->stats.dam,exit_ob,exit_ob->attacktype); |
| | |
*/ | | */ |
if(strcmp (newpath, oldmap->path)) { | | if(strcmp (newpath, oldmap->path)) { |
/* Remove any golems */ | | /* Remove any golems */ |
if(op->contr->golem) { | | if(op->type == PLAYER && op->contr->golem != NULL) { |
remove_friendly_object(op->contr->golem); | | remove_friendly_object(op->contr->golem); |
remove_ob(op->contr->golem); | | remove_ob(op->contr->golem); |
free_object(op->contr->golem); | | free_object(op->contr->golem); |
| | |
obl->next = dummy_map.pending; | | obl->next = dummy_map.pending; |
} | | } |
| | |
| | if (op->type == PLAYER) { |
op->contr->loading = op->map; | | op->contr->loading = op->map; |
op->contr->new_x = x; | | op->contr->new_x = x; |
op->contr->new_y = y; | | op->contr->new_y = y; |
op->contr->removed = removed; | | op->contr->removed = removed; |
| | } |
op->map->timeout = 0; | | op->map->timeout = 0; |
| | |
#ifdef USE_LIGHTING | | #ifdef USE_LIGHTING |