| 229 | uint16 Script_Stack_Peek(ScriptEngine *script, int position, const char *filename, int lineno) |
| 230 | #else |
| 231 | uint16 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, |
nothing calls this directly
no test coverage detected