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

Function Script_Load

src/script/script.c:277–289  ·  view source on GitHub ↗

* Load a script in an engine. As script->scriptInfo already defines most * of the information needed to load such script, all it needs is the type * it needs to load the script for. * * @param script The script engine to load a script for. * @param typeID The typeID for which we want to load a script. */

Source from the content-addressed store, hash-verified

275 * @param typeID The typeID for which we want to load a script.
276 */
277void Script_Load(ScriptEngine *script, uint8 typeID)
278{
279 ScriptInfo *scriptInfo;
280
281 if (script == NULL) return;
282
283 if (script->scriptInfo == NULL) return;
284 scriptInfo = script->scriptInfo;
285
286 Script_Reset(script, scriptInfo);
287
288 script->script = scriptInfo->start + scriptInfo->offsets[typeID];
289}
290
291/**
292 * Check if a script is loaded in an engine. If returning true it means that

Callers 8

GameLoop_StructureFunction · 0.85
Structure_PlaceFunction · 0.85
Structure_DestroyFunction · 0.85
Team_CreateFunction · 0.85
Unit_SetActionFunction · 0.85
Game_PrepareFunction · 0.85
Script_Team_LoadFunction · 0.85
Script_Team_Load2Function · 0.85

Calls 1

Script_ResetFunction · 0.85

Tested by

no test coverage detected