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

Method UpdateScript

neo/game/Weapon.cpp:1810–1836  ·  view source on GitHub ↗

================ idWeapon::UpdateScript ================ */

Source from the content-addressed store, hash-verified

1808================
1809*/
1810void idWeapon::UpdateScript( void ) {
1811 int count;
1812
1813 if ( !isLinked ) {
1814 return;
1815 }
1816
1817 // only update the script on new frames
1818 if ( !gameLocal.isNewFrame ) {
1819 return;
1820 }
1821
1822 if ( idealState.Length() ) {
1823 SetState( idealState, animBlendFrames );
1824 }
1825
1826 // update script state, which may call Event_LaunchProjectiles, among other things
1827 count = 10;
1828 while( ( thread->Execute() || idealState.Length() ) && count-- ) {
1829 // happens for weapons with no clip (like grenades)
1830 if ( idealState.Length() ) {
1831 SetState( idealState, animBlendFrames );
1832 }
1833 }
1834
1835 WEAPON_RELOAD = false;
1836}
1837
1838/*
1839================

Callers

nothing calls this directly

Calls 2

LengthMethod · 0.45
ExecuteMethod · 0.45

Tested by

no test coverage detected