1 | /* |
1 | /* |
2 | * static char *rcsid_main_c = |
2 | * static char *rcsid_main_c = |
3 | * "$Id: main.c,v 1.12 2006/07/19 22:51:40 root Exp $"; |
3 | * "$Id: main.c,v 1.15 2006/08/11 12:21:35 elmex Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
943 | */ |
943 | */ |
944 | // if (get_map_flags(pl->ob->map, NULL, pl->ob->x, pl->ob->y, NULL, NULL) & P_NO_CLERIC) { |
944 | // if (get_map_flags(pl->ob->map, NULL, pl->ob->x, pl->ob->y, NULL, NULL) & P_NO_CLERIC) { |
945 | // pl->last_save_tick += 100; |
945 | // pl->last_save_tick += 100; |
946 | // } else { |
946 | // } else { |
947 | save_player(pl->ob,1); |
947 | save_player(pl->ob,1); |
948 | // pl->last_save_tick = pticks; |
948 | pl->last_save_tick = pticks; |
949 | // } |
949 | // } |
950 | } |
950 | } |
951 | #endif |
951 | #endif |
952 | } /* end of for loop for all the players */ |
952 | } /* end of for loop for all the players */ |
953 | } /* for flag */ |
953 | } /* for flag */ |
… | |
… | |
1089 | continue; |
1089 | continue; |
1090 | |
1090 | |
1091 | /* Animate the object. Bug of feature that andim_speed |
1091 | /* Animate the object. Bug of feature that andim_speed |
1092 | * is based on ticks, and not the creatures speed? |
1092 | * is based on ticks, and not the creatures speed? |
1093 | */ |
1093 | */ |
1094 | if (op->anim_speed && op->last_anim >= op->anim_speed) { |
1094 | if (op->anim_speed && op->last_anim >= op->anim_speed) |
|
|
1095 | { |
|
|
1096 | if ((op->type==PLAYER)||(op->type==MONSTER)) |
|
|
1097 | animate_object(op, op->facing); |
|
|
1098 | else |
1095 | animate_object (op, op->direction); |
1099 | animate_object (op, op->direction); |
|
|
1100 | |
1096 | op->last_anim = 1; |
1101 | op->last_anim = 1; |
1097 | } else { |
1102 | } |
|
|
1103 | else |
1098 | op->last_anim++; |
1104 | op->last_anim++; |
1099 | } |
|
|
1100 | |
1105 | |
1101 | if (op->speed_left > 0) { |
1106 | if (op->speed_left > 0) { |
1102 | #if 0 |
1107 | #if 0 |
1103 | /* I've seen occasional crashes in move_symptom() with it |
1108 | /* I've seen occasional crashes in move_symptom() with it |
1104 | * crashing because op is removed - add some debugging to |
1109 | * crashing because op is removed - add some debugging to |
… | |
… | |
1210 | { |
1215 | { |
1211 | char buf[MAX_BUF]; |
1216 | char buf[MAX_BUF]; |
1212 | sprintf (buf, "%s left the game.", pl->ob->name); |
1217 | sprintf (buf, "%s left the game.", pl->ob->name); |
1213 | new_draw_info(NDI_UNIQUE | NDI_ALL | NDI_DK_ORANGE, 5, NULL, buf); |
1218 | new_draw_info(NDI_UNIQUE | NDI_ALL | NDI_DK_ORANGE, 5, NULL, buf); |
1214 | } |
1219 | } |
|
|
1220 | |
|
|
1221 | if (!QUERY_FLAG (pl->ob, FLAG_REMOVED)) |
|
|
1222 | leave_map (pl->ob); |
|
|
1223 | |
|
|
1224 | pl->ob->type = DEAD_OBJECT; /* To avoid problems with inventory window */ |
1215 | } |
1225 | } |
1216 | |
|
|
1217 | if (pl->ob->map) { |
|
|
1218 | if (pl->ob->map->in_memory==MAP_IN_MEMORY) |
|
|
1219 | pl->ob->map->timeout = MAP_TIMEOUT(pl->ob->map); |
|
|
1220 | pl->ob->map->players--; |
|
|
1221 | pl->ob->map=NULL; |
|
|
1222 | } |
|
|
1223 | |
|
|
1224 | pl->ob->type = DEAD_OBJECT; /* To avoid problems with inventory window */ |
|
|
1225 | } |
1226 | } |
1226 | } |
1227 | } |
1227 | |
1228 | |
1228 | int forbid_play(void) |
1229 | int forbid_play(void) |
1229 | { |
1230 | { |