================ idWeapon::ConstructScriptObject Called during idEntity::Spawn. Calls the constructor on the script object. Can be overridden by subclasses when a thread doesn't need to be allocated. ================ */
| 1748 | ================ |
| 1749 | */ |
| 1750 | idThread *idWeapon::ConstructScriptObject( void ) { |
| 1751 | const function_t *constructor; |
| 1752 | |
| 1753 | thread->EndThread(); |
| 1754 | |
| 1755 | // call script object's constructor |
| 1756 | constructor = scriptObject.GetConstructor(); |
| 1757 | if ( !constructor ) { |
| 1758 | gameLocal.Error( "Missing constructor on '%s' for weapon", scriptObject.GetTypeName() ); |
| 1759 | } |
| 1760 | |
| 1761 | // init the script object's data |
| 1762 | scriptObject.ClearObject(); |
| 1763 | thread->CallFunction( this, constructor, true ); |
| 1764 | thread->Execute(); |
| 1765 | |
| 1766 | return thread; |
| 1767 | } |
| 1768 | |
| 1769 | /* |
| 1770 | ================ |
nothing calls this directly
no test coverage detected