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

Function Script_Reset

src/script/script.c:257–267  ·  view source on GitHub ↗

* Reset a script engine. It forgets the correct script it was executing, * and resets stack and frame pointer. It also loads in the scriptInfo given * by the parameter. * * @param script The script engine to reset. * @param scriptInfo The scriptInfo to load in the script. Can be NULL. */

Source from the content-addressed store, hash-verified

255 * @param scriptInfo The scriptInfo to load in the script. Can be NULL.
256 */
257void Script_Reset(ScriptEngine *script, ScriptInfo *scriptInfo)
258{
259 if (script == NULL) return;
260 if (scriptInfo == NULL) return;
261
262 script->script = NULL;
263 script->scriptInfo = scriptInfo;
264 script->isSubroutine = 0;
265 script->framePointer = 17;
266 script->stackPointer = 15;
267}
268
269/**
270 * Load a script in an engine. As script->scriptInfo already defines most

Callers 13

GameLoop_StructureFunction · 0.85
Structure_PlaceFunction · 0.85
Structure_DestroyFunction · 0.85
Team_CreateFunction · 0.85
Unit_CreateFunction · 0.85
Unit_SetActionFunction · 0.85
Unit_RemoveFunction · 0.85
Unit_HideFunction · 0.85
Script_Team_LoadFunction · 0.85
Script_Team_Load2Function · 0.85
Script_LoadFunction · 0.85
Structure_FreeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected