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

Function Script_General_GetOrientation

src/script/general.c:202–211  ·  view source on GitHub ↗

* Get orientation of a unit. * * Stack: 1 - An encoded index. * * @param script The script engine to operate on. * @return The orientation of the unit. */

Source from the content-addressed store, hash-verified

200 * @return The orientation of the unit.
201 */
202uint16 Script_General_GetOrientation(ScriptEngine *script)
203{
204 Unit *u;
205
206 u = Tools_Index_GetUnit(STACK_PEEK(1));
207
208 if (u == NULL) return 128;
209
210 return u->orientation[0].current;
211}
212
213/**
214 * Counts how many unit of the given type are owned by current object's owner.

Callers

nothing calls this directly

Calls 1

Tools_Index_GetUnitFunction · 0.85

Tested by

no test coverage detected