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

Function Script_Unit_FindBestTarget

src/script/unit.c:79–86  ·  view source on GitHub ↗

* Gets the best target for the current unit. * * Stack: 1 - How to determine the best target. * * @param script The script engine to operate on. * @return The encoded index of the best target or 0 if none found. */

Source from the content-addressed store, hash-verified

77 * @return The encoded index of the best target or 0 if none found.
78 */
79uint16 Script_Unit_FindBestTarget(ScriptEngine *script)
80{
81 Unit *u;
82
83 u = g_scriptCurrentUnit;
84
85 return Unit_FindBestTargetEncoded(u, STACK_PEEK(1));
86}
87
88/**
89 * Get the priority a target has for the current unit.

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected