================ idWeapon::UpdateScript ================ */
| 2078 | ================ |
| 2079 | */ |
| 2080 | void idWeapon::UpdateScript( void ) { |
| 2081 | int count; |
| 2082 | |
| 2083 | if ( !isLinked ) { |
| 2084 | return; |
| 2085 | } |
| 2086 | |
| 2087 | // only update the script on new frames |
| 2088 | if ( !gameLocal.isNewFrame ) { |
| 2089 | return; |
| 2090 | } |
| 2091 | |
| 2092 | if ( idealState.Length() ) { |
| 2093 | SetState( idealState, animBlendFrames ); |
| 2094 | } |
| 2095 | |
| 2096 | // update script state, which may call Event_LaunchProjectiles, among other things |
| 2097 | count = 10; |
| 2098 | while( ( thread->Execute() || idealState.Length() ) && count-- ) { |
| 2099 | // happens for weapons with no clip (like grenades) |
| 2100 | if ( idealState.Length() ) { |
| 2101 | SetState( idealState, animBlendFrames ); |
| 2102 | } |
| 2103 | } |
| 2104 | |
| 2105 | WEAPON_RELOAD = false; |
| 2106 | } |
| 2107 | |
| 2108 | /* |
| 2109 | ================ |