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

Method UpdateScript

neo/d3xp/Weapon.cpp:2080–2106  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2078================
2079*/
2080void 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================

Callers

nothing calls this directly

Calls 2

LengthMethod · 0.45
ExecuteMethod · 0.45

Tested by

no test coverage detected