Fixed very old swinging polydoor issue
Moderator: GZDoom Developers
-
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
Fixed very old swinging polydoor issue
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...
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...
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49230
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Fixed very old swinging polydoor issue
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 ();
}
}
-
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
Re: Fixed very old swinging polydoor issue
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...
[edit]Although, which wad uses a perpetual swinging polyobj door? Sounds weird to me...
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49230
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Fixed very old swinging polydoor issue
No idea, I just pointed out something that clearly was overlooked.
-
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
Re: Fixed very old swinging polydoor issue
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.
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.
-
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
Re: Fixed very old swinging polydoor issue
Argh! Now you merged the first and wrong version...
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49230
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Fixed very old swinging polydoor issue
Was this part of something else? I can't remember merging this.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49230
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Fixed very old swinging polydoor issue
As a general rule, if you don't want to have a pull request merged, then *close it*!
-
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
Re: Fixed very old swinging polydoor issue
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.
-
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
Re: Fixed very old swinging polydoor issue
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.
I assume the solution to this is the second one, so I'll make a new pull request which removes the 'perpetual' code.
-
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
-
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
Re: Fixed very old swinging polydoor issue
I suppose this can be closed as [Added] ...