1 | /* |
1 | /* |
2 | * static char *rcsid_player_c = |
2 | * static char *rcsid_player_c = |
3 | * "$Id: player.c,v 1.20 2006/06/06 02:45:28 root Exp $"; |
3 | * "$Id: player.c,v 1.21 2006/08/11 23:04:50 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 | |
… | |
… | |
489 | |
489 | |
490 | mflags = get_map_flags(m, &m, x, y, &x, &y); |
490 | mflags = get_map_flags(m, &m, x, y, &x, &y); |
491 | blocked = (mflags & P_OUT_OF_MAP) ? MOVE_ALL : GET_MAP_MOVE_BLOCK(m, x, y); |
491 | blocked = (mflags & P_OUT_OF_MAP) ? MOVE_ALL : GET_MAP_MOVE_BLOCK(m, x, y); |
492 | |
492 | |
493 | /* Space is blocked - try changing direction a little */ |
493 | /* Space is blocked - try changing direction a little */ |
494 | if ((mflags & P_OUT_OF_MAP) || ((OB_TYPE_MOVE_BLOCK(mon, blocked)) |
494 | if ((mflags & P_OUT_OF_MAP) || ((OB_TYPE_MOVE_BLOCK(mon, blocked) || (mflags&P_BLOCKSVIEW)) |
495 | && (m == mon->map && blocked_link(mon, m, x, y)))) { |
495 | && (m == mon->map && blocked_link(mon, m, x, y)))) { |
496 | /* recalculate direction from last good location. Possible |
496 | /* recalculate direction from last good location. Possible |
497 | * we were not traversing ideal location before. |
497 | * we were not traversing ideal location before. |
498 | */ |
498 | */ |
499 | get_rangevector_from_mapcoord(lastmap, lastx, lasty, pl, &rv, 0); |
499 | get_rangevector_from_mapcoord(lastmap, lastx, lasty, pl, &rv, 0); |
… | |
… | |
533 | m = lastmap; |
533 | m = lastmap; |
534 | mflags = get_map_flags(m, &m, x, y, &x, &y); |
534 | mflags = get_map_flags(m, &m, x, y, &x, &y); |
535 | if (mflags & P_OUT_OF_MAP) continue; |
535 | if (mflags & P_OUT_OF_MAP) continue; |
536 | blocked = GET_MAP_MOVE_BLOCK(m, x, y); |
536 | blocked = GET_MAP_MOVE_BLOCK(m, x, y); |
537 | if (OB_TYPE_MOVE_BLOCK(mon, blocked)) continue; |
537 | if (OB_TYPE_MOVE_BLOCK(mon, blocked)) continue; |
|
|
538 | if (mflags & P_BLOCKSVIEW) continue; |
538 | |
539 | |
539 | if (m == mon->map && blocked_link(mon, m, x, y)) break; |
540 | if (m == mon->map && blocked_link(mon, m, x, y)) break; |
540 | } |
541 | } |
541 | /* go through entire loop without finding a valid |
542 | /* go through entire loop without finding a valid |
542 | * sidestep to take - thus, no valid path. |
543 | * sidestep to take - thus, no valid path. |