================ idWeapon::UpdateScript ================ */
| 1808 | ================ |
| 1809 | */ |
| 1810 | void 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 | ================ |