MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / ConstructScriptObject

Method ConstructScriptObject

neo/game/Weapon.cpp:1750–1767  ·  view source on GitHub ↗

================ 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. ================ */

Source from the content-addressed store, hash-verified

1748================
1749*/
1750idThread *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================

Callers

nothing calls this directly

Calls 7

EndThreadMethod · 0.45
GetConstructorMethod · 0.45
ErrorMethod · 0.45
GetTypeNameMethod · 0.45
ClearObjectMethod · 0.45
CallFunctionMethod · 0.45
ExecuteMethod · 0.45

Tested by

no test coverage detected