Skip to content

Taking control of Juggernaut should not fail studio assertions #1381

@Rainyan

Description

@Rainyan

Build Info

ed5a266

Description

In JGR mode maps, if you take control of the JGR whilst you also have a primary weapon out, the studiomdl code throws on several assertions (and likely the model sequence numbers go out of whack, also).

To Reproduce

  • Load map ntre_terminal_jgr
  • Join a team
  • Wait for match to start
  • Choose a weapon and spawn in the map
  • Go to the JGR
  • Make sure your primary weapon is equipped
  • Take control of the JGR
    • Recommended to use +use via console instead of holding a key, because it's easy to accidentally dismiss the debugger break otherwise

Expected behavior

No assertions throw

Actual behavior

Two studiomdl assertions fail sequentially:

studio.cpp (934) : Assertion Failed: ( i >= 0 && i < GetNumSeq() ) || ( i == 1 && GetNumSeq() <= 1 )
studio.h (1783) : Assertion Failed: 0

along with the side effects of the sequence number being incorrect (could lead to animation bugs, although I couldn't immediately spot any).

Full assertion details:

studio.cpp (934) : Assertion Failed: ( i >= 0 && i < GetNumSeq() ) || ( i == 1 && GetNumSeq() <= 1 )

`i` was `125`, `CStudioHdr::GetNumSeq` returned `21`

Call stack:
>	server.dll!CStudioHdr::pSeqdesc(int i) Line 934	C++
 	server.dll!CBoneSetup::AccumulatePose(Vector * pos, Quaternion * q, int sequence, float cycle, float flWeight, float flTime, CIKContext * pIKContext) Line 2421	C++
 	server.dll!IBoneSetup::AccumulatePose(Vector * pos, Quaternion * q, int sequence, float cycle, float flWeight, float flTime, CIKContext * pIKContext) Line 2312	C++
 	server.dll!CBaseAnimatingOverlay::GetSkeleton(CStudioHdr * pStudioHdr, Vector * pos, Quaternion * q, int boneMask) Line 478	C++
 	server.dll!CHL2MP_Player::SetupBones(matrix3x4_t * pBoneToWorld, int boneMask) Line 1890	C++
 	server.dll!CBaseAnimating::GetBoneCache() Line 2789	C++
 	server.dll!CBaseAnimating::GetBoneTransform(int iBone, matrix3x4_t & pBoneToWorld) Line 1568	C++
 	server.dll!CBaseAnimating::GetAttachment(int iAttachment, matrix3x4_t & attachmentToWorld) Line 2132	C++
 	server.dll!CBaseEntity::GetParentToWorldTransform(matrix3x4_t & tempMatrix) Line 6581	C++
 	server.dll!CBaseEntity::CalcAbsolutePosition() Line 6456	C++
 	server.dll!CBaseEntity::GetAbsOrigin() Line 2359	C++
 	server.dll!UnlinkFromParent(CBaseEntity * pRemove) Line 103	C++
 	server.dll!CBaseEntity::SetParent(CBaseEntity * pParentEntity, int iAttachment) Line 1227	C++
 	server.dll!CBaseEntity::SetParentAttachment(const char * szInputName, const char * szAttachment, bool bMaintainOffset) Line 4732	C++
 	server.dll!CNEOBaseCombatWeapon::Equip(CBaseCombatCharacter * pOwner) Line 363	C++
 	server.dll!CNEO_Player::Weapon_Equip(CBaseCombatWeapon * pWeapon) Line 2156	C++
 	server.dll!CHL2MP_Player::BumpWeapon(CBaseCombatWeapon * pWeapon) Line 1029	C++
 	server.dll!CNEO_Player::BumpWeapon(CBaseCombatWeapon * pWeapon) Line 2239	C++
 	server.dll!CBasePlayer::GiveNamedItem(const char * pszName, int iSubType) Line 6118	C++
 	server.dll!CNEO_Player::GiveDefaultItems() Line 2898	C++
 	server.dll!CNEO_Player::BecomeJuggernaut() Line 3339	C++
 	server.dll!CNEO_Juggernaut::Think() Line 177	C++
 	server.dll!CBaseEntity::PhysicsDispatchThink(void(CBaseEntity::*)() thinkFunc) Line 946	C++
 	server.dll!CBaseEntity::PhysicsRunSpecificThink(int nContextIndex, void(CBaseEntity::*)() thinkFunc) Line 2104	C++
 	server.dll!CBaseEntity::PhysicsRunThink(CBaseEntity::thinkmethods_t thinkMethod) Line 1901	C++
 	server.dll!CBaseEntity::StepSimulationThink(float dt) Line 1641	C++
 	server.dll!CBaseEntity::PhysicsStep() Line 1785	C++
 	server.dll!CBaseEntity::PhysicsSimulate() Line 1858	C++
 	server.dll!Physics_SimulateEntity(CBaseEntity * pEntity) Line 2019	C++
 	server.dll!Physics_RunThinkFunctions(bool simulating) Line 2075	C++
 	server.dll!CServerGameDLL::GameFrame(bool simulating) Line 1281	C++
 	[External Code]	

And for the second assertion:

studio.h (1783) : Assertion Failed: 0

`sequence` was `125`, `m_seq.Count()` returned `21`

Call stack:
>	server.dll!virtualmodel_t::pSeqGroup(int sequence) Line 1783	C++
 	server.dll!SlerpBones(const CStudioHdr * pStudioHdr, Quaternion * q1, Vector * pos1, mstudioseqdesc_t & seqdesc, int sequence, const QuaternionAligned * q2, const Vector * pos2, float s, int boneMask) Line 1402	C++
 	server.dll!CBoneSetup::AccumulatePose(Vector * pos, Quaternion * q, int sequence, float cycle, float flWeight, float flTime, CIKContext * pIKContext) Line 2440	C++
 	server.dll!IBoneSetup::AccumulatePose(Vector * pos, Quaternion * q, int sequence, float cycle, float flWeight, float flTime, CIKContext * pIKContext) Line 2312	C++
 	server.dll!CBaseAnimatingOverlay::GetSkeleton(CStudioHdr * pStudioHdr, Vector * pos, Quaternion * q, int boneMask) Line 478	C++
 	server.dll!CHL2MP_Player::SetupBones(matrix3x4_t * pBoneToWorld, int boneMask) Line 1890	C++
 	server.dll!CBaseAnimating::GetBoneCache() Line 2789	C++
 	server.dll!CBaseAnimating::GetBoneTransform(int iBone, matrix3x4_t & pBoneToWorld) Line 1568	C++
 	server.dll!CBaseAnimating::GetAttachment(int iAttachment, matrix3x4_t & attachmentToWorld) Line 2132	C++
 	server.dll!CBaseEntity::GetParentToWorldTransform(matrix3x4_t & tempMatrix) Line 6581	C++
 	server.dll!CBaseEntity::CalcAbsolutePosition() Line 6456	C++
 	server.dll!CBaseEntity::GetAbsOrigin() Line 2359	C++
 	server.dll!UnlinkFromParent(CBaseEntity * pRemove) Line 103	C++
 	server.dll!CBaseEntity::SetParent(CBaseEntity * pParentEntity, int iAttachment) Line 1227	C++
 	server.dll!CBaseEntity::SetParentAttachment(const char * szInputName, const char * szAttachment, bool bMaintainOffset) Line 4732	C++
 	server.dll!CNEOBaseCombatWeapon::Equip(CBaseCombatCharacter * pOwner) Line 363	C++
 	server.dll!CNEO_Player::Weapon_Equip(CBaseCombatWeapon * pWeapon) Line 2156	C++
 	server.dll!CHL2MP_Player::BumpWeapon(CBaseCombatWeapon * pWeapon) Line 1029	C++
 	server.dll!CNEO_Player::BumpWeapon(CBaseCombatWeapon * pWeapon) Line 2239	C++
 	server.dll!CBasePlayer::GiveNamedItem(const char * pszName, int iSubType) Line 6118	C++
 	server.dll!CNEO_Player::GiveDefaultItems() Line 2898	C++
 	server.dll!CNEO_Player::BecomeJuggernaut() Line 3339	C++
 	server.dll!CNEO_Juggernaut::Think() Line 177	C++
 	server.dll!CBaseEntity::PhysicsDispatchThink(void(CBaseEntity::*)() thinkFunc) Line 946	C++
 	server.dll!CBaseEntity::PhysicsRunSpecificThink(int nContextIndex, void(CBaseEntity::*)() thinkFunc) Line 2104	C++
 	server.dll!CBaseEntity::PhysicsRunThink(CBaseEntity::thinkmethods_t thinkMethod) Line 1901	C++
 	server.dll!CBaseEntity::StepSimulationThink(float dt) Line 1641	C++
 	server.dll!CBaseEntity::PhysicsStep() Line 1785	C++
 	server.dll!CBaseEntity::PhysicsSimulate() Line 1858	C++
 	server.dll!Physics_SimulateEntity(CBaseEntity * pEntity) Line 2019	C++
 	server.dll!Physics_RunThinkFunctions(bool simulating) Line 2075	C++
 	server.dll!CServerGameDLL::GameFrame(bool simulating) Line 1281	C++
 	[External Code]	

Operating System

  • Windows
  • Linux

Version/Distro

11

Machine's CPU

No response

Machine's GPU

No response

GPU's driver

No response

Build's compiler

No response

Additional context and Screenshots

Based on the assertion call stack, this is likely some kind of logic bug in BecomeJuggernaut related to stripping/equipping the guns

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug ReportBug Reports made through the "Report Issue" interface in GitHub.

    Type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions