File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1125,7 +1125,36 @@ public void SendViewModelAnim(int sequence) {
11251125 Assert ( vm . ViewModelIndex ( ) == nViewModelIndex ) ;
11261126 vm . SendViewModelMatchingSequence ( sequence ) ;
11271127 }
1128- public virtual void SetActivity ( Activity act , float duration ) => throw new NotImplementedException ( ) ;
1128+ public virtual void SetActivity ( Activity act , float duration ) {
1129+ #if ! CLIENT_DLL && ( HL2MP || PORTAL )
1130+ if ( GetOwner ( ) != null && GetOwner ( ) ! . IsPlayer ( ) )
1131+ SetModel ( GetWorldModel ( ) ) ;
1132+ #endif
1133+
1134+ int sequence = SelectWeightedSequence ( act ) ;
1135+
1136+ if ( sequence == StudioHdr . ACTIVITY_NOT_AVAILABLE )
1137+ sequence = SelectWeightedSequence ( Activity . ACT_VM_IDLE ) ;
1138+
1139+ #if ! CLIENT_DLL && ( HL2MP || PORTAL )
1140+ if ( GetOwner ( ) != null && GetOwner ( ) ! . IsPlayer ( ) )
1141+ SetModel ( GetViewModel ( ) ) ;
1142+ #endif
1143+
1144+ if ( sequence != StudioHdr . ACTIVITY_NOT_AVAILABLE ) {
1145+ SetSequence ( sequence ) ;
1146+ SetActivity ( act ) ;
1147+ SetCycle ( 0 ) ;
1148+ ResetSequenceInfo ( ) ;
1149+
1150+ if ( duration > 0 ) {
1151+ TimeUnit_t playbackRate = SequenceDuration ( sequence ) / duration ;
1152+ SetPlaybackRate ( Math . Min ( playbackRate , 12.0 ) ) ;
1153+ }
1154+ else
1155+ SetPlaybackRate ( 1.0 ) ;
1156+ }
1157+ }
11291158 public void SetActivity ( Activity activity ) => Activity = activity ;
11301159 public bool SendWeaponAnim ( Activity act ) {
11311160 return SetIdealActivity ( ( Activity ) act ) ;
You can’t perform that action at this time.
0 commit comments