* Get the score to enter this tile from a direction. * * @param packed The packed tile. * @param direction The direction we move on this tile. * @return 256 if tile is not accessable, or a score for entering otherwise. */
| 986 | * @return 256 if tile is not accessable, or a score for entering otherwise. |
| 987 | */ |
| 988 | static int16 Script_Unit_Pathfind_GetScore(uint16 packed, uint8 orient8) |
| 989 | { |
| 990 | int16 res; |
| 991 | Unit *u; |
| 992 | |
| 993 | if (g_scriptCurrentUnit == NULL) return 0; |
| 994 | |
| 995 | u = g_scriptCurrentUnit; |
| 996 | |
| 997 | if (g_dune2_enhanced) { |
| 998 | res = Unit_GetTileEnterScore(u, packed, orient8); |
| 999 | } else { |
| 1000 | res = Unit_GetTileEnterScore(u, packed, orient8 << 5); |
| 1001 | } |
| 1002 | |
| 1003 | if (res == -1) res = 256; |
| 1004 | |
| 1005 | return res; |
| 1006 | } |
| 1007 | |
| 1008 | /** |
| 1009 | * Smoothen the route found by the pathfinder. |
no test coverage detected