Skip to content

View model issues after switching back from third person to first person #829

@AdamTadeusz

Description

@AdamTadeusz

Currently some of the the view model animations being played depend on the model of the c_neobasecombatweapon object held active by the local player. When switching to thirdperson and then switching back to first person, C_BaseEntity::RestoreData will convert the models of all weapons held in the users inventory back to their world models, which will break some of the view model animations as SetIdealActivity will query the world model for the ideal sequence, and as far as I know world models only have the one fire sequence (interestingly the fire sequence is the only one thats' noticeably broken).

One workaround is to override RestoreData in c_neobasecombatweapon, and inside call the base function, and then compare the current weapon model against the correct view model counterpart for that weapon model. If the two do not match, and we should currently be drawing the local player's view model, update the model of the currently selected weapon again to its viewmodel.

(Edit)

The easiest way to replicate the problem is to take out the knife and hold down the attack button. The knife should continue to swing repeatedly while the attack button is held.

Next execute the console command "thirdperson" followed by "firstperson", and proceed to continue swinging the knife. Notice that only one swing of the knife is successful, then the viewmodel stops cooperating

(Edit 2)

Firearms will also display both the first and third person muzzleflash when fired in this state, though fixing that is much simpler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions