allocates and initializes the scripts for an object. robots, powerups, doors, etc.
| 197 | // allocates and initializes the scripts for an object. |
| 198 | // robots, powerups, doors, etc. |
| 199 | void InitObjectScripts(object *objp, bool do_evt_created) { |
| 200 | // Bind scripts to the object |
| 201 | Osiris_BindScriptsToObject(objp); |
| 202 | |
| 203 | if (do_evt_created) { |
| 204 | tOSIRISEventInfo ei; |
| 205 | if (objp->control_type == CT_AI) { |
| 206 | Osiris_CallEvent(objp, EVT_AI_INIT, &ei); |
| 207 | } |
| 208 | |
| 209 | Osiris_CallEvent(objp, EVT_CREATED, &ei); |
| 210 | |
| 211 | /* |
| 212 | if (Game_mode & GM_MULTI && Netgame.local_role==LR_CLIENT) |
| 213 | D3XExecScript(objp, EVT_CLIENT_CREATED, objp); |
| 214 | else |
| 215 | { |
| 216 | D3XExecScript(objp, EVT_CREATED, objp); |
| 217 | if(objp->control_type == CT_AI) |
| 218 | { |
| 219 | D3XExecScript(objp, EVT_AI_INIT, NULL, REF_OBJTYPE, NULL); |
| 220 | } |
| 221 | } |
| 222 | */ |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | // frees all scripts for an object. |
| 227 | void FreeObjectScripts(object *objp, bool level_end) { |
no test coverage detected