Fixed very old swinging polydoor issue

Moderator: GZDoom Developers

Post Reply
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Fixed very old swinging polydoor issue

Post by Edward-san »

Pull request.

I noticed this while testing the example wad for this zandronum ticket.

Load the harmless example wad: if a player blocks and tries to push the opened door, when the polyobj tried to close, it managed to rotate backwards wrongly, hence making the door pretty much bad.

It seems to work fine with the other example wads in the same ticket. I wonder why that code in case PODOOR_SWING was a little bit different from case PODOOR_SLIDE for all this time...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Fixed very old swinging polydoor issue

Post by Graf Zahl »

I don't think this is correct. Have a look:

Code: Select all

		if (m_Dist <= 0 || poly->RotatePolyobj (m_Speed)) // <- disables rotation when m_Dist < 0
		{
			absSpeed = abs (m_Speed);
			if (m_Dist == -1)   <- ... so this means that perpetual polyobjs never rotate at all!
			{ // perpetual polyobj
				return;
			}
			m_Dist -= absSpeed;
			if (m_Dist <= 0)
			{
				SN_StopSequence (poly);
				if (!m_Close)
				{
					m_Dist = m_TotalDist;
					m_Close = true;
					m_Tics = m_WaitTics;
					m_Speed = -m_Speed;
				}
				else
				{
					Destroy ();
				}
			}
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: Fixed very old swinging polydoor issue

Post by Edward-san »

Mmm, indeed ... what about if I change the added condition to m_Dist == 0? Apparently this, too, fixes the issue.

[edit]Although, which wad uses a perpetual swinging polyobj door? Sounds weird to me...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Fixed very old swinging polydoor issue

Post by Graf Zahl »

No idea, I just pointed out something that clearly was overlooked.
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: Fixed very old swinging polydoor issue

Post by Edward-san »

Well, I committed two possible solutions to the issue:

Just add 'm_Dist == 0' check;
Add 'm_Dist <= 0' and remove the perpetual code.

I'll wait for some feedback, then I can change the pull request to one or another branch accordingly.
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: Fixed very old swinging polydoor issue

Post by Edward-san »

Argh! Now you merged the first and wrong version...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Fixed very old swinging polydoor issue

Post by Graf Zahl »

Was this part of something else? I can't remember merging this.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Fixed very old swinging polydoor issue

Post by Graf Zahl »

As a general rule, if you don't want to have a pull request merged, then *close it*!
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: Fixed very old swinging polydoor issue

Post by Edward-san »

But I asked some feedback in this thread....
Edward-san wrote:I'll wait for some feedback, then I can change the pull request to one or another branch accordingly.
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: Fixed very old swinging polydoor issue

Post by Edward-san »

Anyways, it seems as if all the pull requests were merged.

I assume the solution to this is the second one, so I'll make a new pull request which removes the 'perpetual' code.
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: Fixed very old swinging polydoor issue

Post by Edward-san »

Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: Fixed very old swinging polydoor issue

Post by Edward-san »

I suppose this can be closed as [Added] ...
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”