* Get the distance from the current unit/structure to the unit/structure. * * Stack: 1 - An encoded unit/structure index. * * @param script The script engine to operate on. * @return Distance to it, where distance is (longest(x,y) + shortest(x,y) / 2). */
| 160 | * @return Distance to it, where distance is (longest(x,y) + shortest(x,y) / 2). |
| 161 | */ |
| 162 | uint16 Script_General_GetDistanceToObject(ScriptEngine *script) |
| 163 | { |
| 164 | uint16 index; |
| 165 | |
| 166 | index = STACK_PEEK(1); |
| 167 | |
| 168 | if (!Tools_Index_IsValid(index)) return 0xFFFF; |
| 169 | |
| 170 | return Object_GetDistanceToEncoded(g_scriptCurrentObject, index); |
| 171 | } |
| 172 | |
| 173 | /** |
| 174 | * Unknown function 0288. |
nothing calls this directly
no test coverage detected