Compatibility issue: Doors and lifts in the same sector

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Compatibility issue: Doors and lifts in the same sector

Post by Graf Zahl »

An excellent level to test this is Map04 of Hell To Pay (from Wraith Software.) There is one section in this map with 2 sectors that can both open as door and lift. But it is extremely easy to mess this up by first activating the door part and then the lift part. After that the level becomes unplayable because one major passage is blocked.

So there should be either a compatibility option or a workaround. I prefer this:

- If a door is opened in a sector with an active floor mover it will only close to its previous lower height.
- If the floor height changes while the door is open the new floor height is only used if there is no active floor mover present in this sector. Otherwise it will only close to its previous lower height.

I think that should prevent all bad possibilities and keep old maps playable with such a setup while allowing both floor and ceiling to be active at the same time.

Here's the necessary changes:

1. Change the first 'if' in DDoor::Tick to

Code: Select all

	if (m_Sector->floorplane.d != m_OldFloorDist)
	{
		if (!m_Sector->floordata || !m_Sector->floordata->IsKindOf(RUNTIME_CLASS(DPlat)) ||
			!((DPlat*)m_Sector->floordata)->isLift())
		{
			m_OldFloorDist = m_Sector->floorplane.d;
			m_BotDist = m_Sector->ceilingplane.PointToDist (m_BotSpot,
				m_Sector->floorplane.ZatPoint (m_BotSpot));
		}
	}
2. Change the last 3 lines in DDoor::DDoor to

Code: Select all

	if (!m_Sector->floordata || !m_Sector->floordata->IsKindOf(RUNTIME_CLASS(DPlat)) ||
		!((DPlat*)m_Sector->floordata)->isLift())
	{
		height = sec->FindHighestFloorPoint (&m_BotSpot);
		m_BotDist = sec->ceilingplane.PointToDist (m_BotSpot, height);
	}
	else
	{
		height = sec->FindLowestCeilingPoint(&m_BotSpot);
		m_BotDist = sec->ceilingplane.PointToDist (m_BotSpot, height);
	}
	m_OldFloorDist = sec->floorplane.d;
3. Add to DPlat:

Code: Select all

	bool isLift() const { return m_Type == platDownWaitUpStay || m_Type == platDownWaitUpStayStone; }
Last edited by Graf Zahl on Sat Jun 04, 2005 11:07 am, edited 1 time in total.
User avatar
Phobus
Posts: 5984
Joined: Thu May 05, 2005 10:56 am
Location: London
Contact:

Post by Phobus »

Now that could be a serious issue if it got into several levels...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

So far I know of at least 3 levels where I managed to screw up such a setup. The one I mentioned is by far the easiest - and I haven't really looked for levels with this.

Hell To Pay seems particularly affected because 2 of the 3 levels are in there. The third is in Cleimos 2.
User avatar
Phobus
Posts: 5984
Joined: Thu May 05, 2005 10:56 am
Location: London
Contact:

Post by Phobus »

O.K, so you can sort this out?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

It's not that hard. All you have to do is to prevent the door from fully closing if there is a lift present in that sector. See my code for a way to do that.
User avatar
Phobus
Posts: 5984
Joined: Thu May 05, 2005 10:56 am
Location: London
Contact:

Post by Phobus »

Shouldn't that be made part of the actual game coding?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Randy will know how to integrate it. But this is not important enough for the inofficial builds - unless Grubber thinks differently. ;)
User avatar
Anakin S.
Posts: 1067
Joined: Fri Nov 28, 2003 9:39 pm
Location: A long time ago in a galaxy far, far away...

Post by Anakin S. »

Graf Zahl wrote:So far I know of at least 3 levels where I managed to screw up such a setup. The one I mentioned is by far the easiest - and I haven't really looked for levels with this.

Hell To Pay seems particularly affected because 2 of the 3 levels are in there. The third is in Cleimos 2.
One of my levels has that problem too. It's great that you're fixing this.
User avatar
Grubber
Posts: 1031
Joined: Wed Oct 15, 2003 12:19 am
Location: Czech Republic
Contact:

Post by Grubber »

@Graf: Even small (but useful) bugfixes are important ;). (IMO)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

fixed
Post Reply

Return to “Closed Bugs [GZDoom]”