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

Function Script_General_DecodeIndex

src/script/general.c:247–256  ·  view source on GitHub ↗

* Decodes the given encoded index. * * Stack: 1 - An encoded index. * * @param script The script engine to operate on. * @return The decoded index, or 0xFFFF if invalid. */

Source from the content-addressed store, hash-verified

245 * @return The decoded index, or 0xFFFF if invalid.
246 */
247uint16 Script_General_DecodeIndex(ScriptEngine *script)
248{
249 uint16 index;
250
251 index = STACK_PEEK(1);
252
253 if (!Tools_Index_IsValid(index)) return 0xFFFF;
254
255 return Tools_Index_Decode(index);
256}
257
258/**
259 * Gets the type of the given encoded index.

Callers

nothing calls this directly

Calls 2

Tools_Index_IsValidFunction · 0.85
Tools_Index_DecodeFunction · 0.85

Tested by

no test coverage detected