Took a while to find it, and I still don't fully understand it, but I
think I located the bug.

In C_BaseCombatWeapon::OnDataChanged( ... )

there's a piece of code along the lines of :

if ( bIsLocalPlayer && !ShouldDrawLocalPlayer() )
{
...
}
else // weapon carried by other player or not at all
{
// BRJ 10/14/02
// FIXME: Remove when Yahn's client-side prediction is done
// It's a hacky workaround for the model indices fighting
// (GetRenderBounds uses the model index, which is for the view model)

SetModelIndex( GetWorldModelIndex() );
}

which sets a weapon's model index clientside to the world model whenever
it detects the played is not the local player and invisible.
Unfortunately, the modelindex is never set back to the view model index. A
fix that works for me is just add a SetModelIndex( GetViewModelIndex() );
to the if clause of the statement ( I added an accessor for the view model
index ). I hope this is not an sdk code merge gone bad on my part, if not
it's at least an inconsistency in the code or a piece of obsolete code
that needs to be removed. I'd love to understand why this bug did not
reproduce for weapons with multiple shoot animations, but I assume it's a
side-effect of having a class with inconsistent members.

Thanks for listening to my rant - maybe this helps someone someday.

-- Maarten

> Hey all,
>
> I'm trying to track down a very weird bug we're experience in Off Limits.
> I realize it's probably too unspecific to get a clear diagnosis, but maybe
> someone here has encountered a similar bug.
>
> The bug is related to viewmodel animations after we've switched to
> thirdperson and back to firstperson. We have implemented a third person
> for our vehicles based on the one posted on the Wavelength. Whenever you
> switch to thirdperson and back to first, for certain weapons when you
> shoot, there's only one fire anim played anymore. After that the weapon
> goes static (probably the idle animation). The shot still happens, the
> ACT_VM_PRIMARYATTACK still gets sent to the weapon, and the animation
> events still fire ( muzzle flash, shell eject, etc ); it's just the
> animation itself that does not get played anymore.
>
> Weird thing is, this is also related to the number of shoot animations the
> weapon has. Weapons that have only one shoot animation have this bug,
> weapons that have multiple shoot sequences (weighted, where there's a
> random choice) do not have this bug ( or, probably, it does not show since
> the engine plays a different shoot sequence every time ). If I add a
> (copied) second animation to the other weapons the bug disappears too, so
> I can use that as a "fix"; but I'd like to understand where this comes
> from.
>
> Any ideas on how to debug this are welcome too, I'm running out of ideas
> :)
>
> -- Maarten
>
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
>



_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to