ValveSoftware / source-sdk-2013

The 2013 edition of the Source SDK
https://developer.valvesoftware.com/wiki/SDK2013_GettingStarted
Other
3.73k stars 1.99k forks source link

Combine Dropship Gun Doesn't Rotate (appeared in 2007) #385

Open ihonnyboy opened 8 years ago

ihonnyboy commented 8 years ago

In npc_combinedropship.cpp, the gun no longer rotates during game play. This completely breaks the dropship holdout in d2_coast_10: it makes it much easier for players to camp the spawn location of the soldiers. It's also frustrating to design levels around.

This bug actually appeared back during the orange box update, so this bug is probably a much deeper issue. The gun rotates just fine in the Source SDK 2006 base, and the code for the gun doesn't look that different. The code seems to checkout, it looks just like the code for vehicles. The .mdl might be the issue (even though it hasn't changed either), so I hooked up a func_tank to the model. The rotation up and down is reversed, but I don't think that would cause the gun to not move period. I can't make sure of this, however, without the source .smd files.

DimasDSF commented 7 years ago

I also believe the container model has animations for opening/closing the container door, but ingame the door just moves instanteniously

SamVanheer commented 7 years ago

The cause of this is that the dropship looks up the pose parameter indices for the weapon using the dropship's own model. It should be using the container model. I fixed this by adding this:

m_poseWeapon_Pitch      = m_hContainer->LookupPoseParameter( "weapon_pitch" );
m_poseWeapon_Yaw        = m_hContainer->LookupPoseParameter( "weapon_yaw" );

To CNPC_CombineDropship::Spawn in the if( m_hContainer ) check.

A proper fix should be done here: https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/game/server/hl2/npc_combinedropship.cpp#L392-L393

I'm guessing that at one point the container was part of the dropship model, which is why this wasn't a problem before. That, or somebody changed it and used the wrong entity to get the parameters.