… | |
… | |
952 | int mflags; |
952 | int mflags; |
953 | |
953 | |
954 | if (!dir) |
954 | if (!dir) |
955 | dir = pl->facing; |
955 | dir = pl->facing; |
956 | |
956 | |
957 | tx = freearr_x[dir]; |
957 | tx = DIRX (dir); |
958 | ty = freearr_y[dir]; |
958 | ty = DIRY (dir); |
959 | |
959 | |
960 | /* If we don't yet have an opponent, find if one exists, and attack. |
960 | /* If we don't yet have an opponent, find if one exists, and attack. |
961 | * Legal opponents are the same as outlined in move_player_attack() |
961 | * Legal opponents are the same as outlined in move_player_attack() |
962 | */ |
962 | */ |
963 | if (!tmp) |
963 | if (!tmp) |
964 | { |
964 | { |
965 | m = pl->map; |
965 | m = pl->map; |
966 | tx = pl->x + freearr_x[dir]; |
966 | tx = pl->x + DIRX (dir); |
967 | ty = pl->y + freearr_y[dir]; |
967 | ty = pl->y + DIRY (dir); |
968 | |
968 | |
969 | mflags = get_map_flags (m, &m, tx, ty, &tx, &ty); |
969 | mflags = get_map_flags (m, &m, tx, ty, &tx, &ty); |
970 | if (mflags & P_OUT_OF_MAP) |
970 | if (mflags & P_OUT_OF_MAP) |
971 | return 0; |
971 | return 0; |
972 | |
972 | |