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

Function Script_Unit_Unknown2BD5

src/script/unit.c:1897–1928  ·  view source on GitHub ↗

* Unknown function 2BD5. * * Stack: *none*. * * @param script The script engine to operate on. * @return ??. */

Source from the content-addressed store, hash-verified

1895 * @return ??.
1896 */
1897uint16 Script_Unit_Unknown2BD5(ScriptEngine *script)
1898{
1899 Unit *u;
1900
1901 VARIABLE_NOT_USED(script);
1902
1903 u = g_scriptCurrentUnit;
1904
1905 switch (Tools_Index_GetType(u->o.script.variables[4])) {
1906 case IT_UNIT: {
1907 Unit *u2;
1908
1909 u2 = Tools_Index_GetUnit(u->o.script.variables[4]);
1910
1911 if (Tools_Index_Encode(u->o.index, IT_UNIT) == u2->o.script.variables[4] && u2->o.houseID == u->o.houseID) return 1;
1912
1913 u2->targetMove = 0;
1914 } break;
1915
1916 case IT_STRUCTURE: {
1917 Structure *s;
1918
1919 s = Tools_Index_GetStructure(u->o.script.variables[4]);
1920 if (Tools_Index_Encode(u->o.index, IT_UNIT) == s->o.script.variables[4] && s->o.houseID == u->o.houseID) return 1;
1921 } break;
1922
1923 default: break;
1924 }
1925
1926 Object_Script_Variable4_Clear(&u->o);
1927 return 0;
1928}
1929
1930/**
1931 * Blink the unit for 32 ticks.

Callers

nothing calls this directly

Calls 5

Tools_Index_GetTypeFunction · 0.85
Tools_Index_GetUnitFunction · 0.85
Tools_Index_EncodeFunction · 0.85
Tools_Index_GetStructureFunction · 0.85

Tested by

no test coverage detected