MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / Script_Unit_Sandworm_GetBestTarget

Function Script_Unit_Sandworm_GetBestTarget

src/script/unit.c:1874–1887  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

1872 * @return An encoded unit index, or 0.
1873 */
1874uint16 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.

Callers

nothing calls this directly

Calls 2

Tools_Index_EncodeFunction · 0.85

Tested by

no test coverage detected