Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

momentary_door restarts movement sound repeatedly when moving back to starting position #3265

Open
SamVanheer opened this issue Mar 28, 2022 · 0 comments

Comments

@SamVanheer
Copy link

SamVanheer commented Mar 28, 2022

When a momentary_door moves back to its starting position its movement sound is constantly restarted.
Note that momentary doors don't move back by themselves. They move back because an associated momentary_rot_button is set to auto return.

See this video for an example in c2a3a: https://www.youtube.com/watch?v=hxPLKSjcWZA

This bug was fixed in Source with this fix: https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/game/server/func_movelinear.cpp#L253-L256

The same can be done for GoldSource.

After this line:

void EXPORT DoorMoveDone( void );

Add this:

void EXPORT StopMoveSound();

Modify this:

halflife/dlls/doors.cpp

Lines 1048 to 1052 in c7240b9

void CMomentaryDoor::DoorMoveDone( void )
{
STOP_SOUND(ENT(pev), CHAN_STATIC, (char*)STRING(pev->noiseMoving) );
EMIT_SOUND(ENT(pev), CHAN_STATIC, (char*)STRING(pev->noiseArrived), 1, ATTN_NORM);
}

To become this:

void CMomentaryDoor::DoorMoveDone()
{
	// Stop sounds at the next think, rather than here as another
	// Use call might immediately follow the end of this move
	//This think function will be replaced by LinearMove if that happens.
	SetThink(&CMomentaryDoor::StopMoveSound);
	pev->nextthink = pev->ltime + 0.1f;
}

void CMomentaryDoor::StopMoveSound()
{
	STOP_SOUND(ENT(pev), CHAN_STATIC, (char*)STRING(pev->noiseMoving));
	EMIT_SOUND(ENT(pev), CHAN_STATIC, (char*)STRING(pev->noiseArrived), 1, ATTN_NORM);
	SetThink(nullptr);
}

Not the same as #1235.

SamVanheer added a commit to twhl-community/halflife-unified-sdk that referenced this issue Mar 28, 2022
SamVanheer added a commit to twhl-community/halflife-updated that referenced this issue Mar 28, 2022
hammermaps added a commit to sohl-modders/Updated-SOHL-1.2 that referenced this issue Apr 25, 2023
hammermaps added a commit to sohl-modders/Updated-SOHL-1.2 that referenced this issue Apr 25, 2023
@SamVanheer SamVanheer reopened this May 23, 2023
SaintWish added a commit to MSRevive/MasterSwordRebirth that referenced this issue Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants