* Get the distance from the current unit/structure to the tile. * * Stack: 1 - An encoded tile index. * * @param script The script engine to operate on. * @return Distance to it, where distance is (longest(x,y) + shortest(x,y) / 2). */
| 69 | * @return Distance to it, where distance is (longest(x,y) + shortest(x,y) / 2). |
| 70 | */ |
| 71 | uint16 Script_General_GetDistanceToTile(ScriptEngine *script) |
| 72 | { |
| 73 | Object *o; |
| 74 | uint16 encoded; |
| 75 | |
| 76 | encoded = STACK_PEEK(1); |
| 77 | o = g_scriptCurrentObject; |
| 78 | |
| 79 | if (!Tools_Index_IsValid(encoded)) return 0xFFFF; |
| 80 | |
| 81 | return Tile_GetDistance(o->position, Tools_Index_GetTile(encoded)); |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Do nothing. This function has absolutely no functionality other than |
nothing calls this directly
no test coverage detected