* Get the best target around you. Only considers units on sand. * * Stack: *none*. * * @param script The script engine to operate on. * @return An encoded unit index, or 0. */
| 1872 | * @return An encoded unit index, or 0. |
| 1873 | */ |
| 1874 | uint16 Script_Unit_Sandworm_GetBestTarget(ScriptEngine *script) |
| 1875 | { |
| 1876 | Unit *u; |
| 1877 | Unit *u2; |
| 1878 | |
| 1879 | VARIABLE_NOT_USED(script); |
| 1880 | |
| 1881 | u = g_scriptCurrentUnit; |
| 1882 | |
| 1883 | u2 = Unit_Sandworm_FindBestTarget(u); |
| 1884 | if (u2 == NULL) return 0; |
| 1885 | |
| 1886 | return Tools_Index_Encode(u2->o.index, IT_UNIT); |
| 1887 | } |
| 1888 | |
| 1889 | /** |
| 1890 | * Unknown function 2BD5. |
nothing calls this directly
no test coverage detected