* 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. */
| 275 | * @param typeID The typeID for which we want to load a script. |
| 276 | */ |
| 277 | void 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 |
no test coverage detected