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

Function Script_Stack_Peek

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

Source from the content-addressed store, hash-verified

229uint16 Script_Stack_Peek(ScriptEngine *script, int position, const char *filename, int lineno)
230#else
231uint16 Script_Stack_Peek(ScriptEngine *script, int position)
232#endif
233{
234 assert(position > 0);
235
236 if (script->stackPointer >= 16 - position) {
237#ifdef _DEBUG
238 Script_Error("Stack Overflow at %s:%d", filename, lineno);
239#else
240 Script_Error("Stack Overflow");
241#endif
242 script->script = NULL;
243 return 0;
244 }
245
246 return script->stack[script->stackPointer + position - 1];
247}
248
249/**
250 * Reset a script engine. It forgets the correct script it was executing,

Callers

nothing calls this directly

Calls 1

Script_ErrorFunction · 0.85

Tested by

no test coverage detected