Line_SetPortalTarget + Hub = LinePortal breaks

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
Batandy
Posts: 1277
Joined: Tue Jul 19, 2011 2:56 am

Line_SetPortalTarget + Hub = LinePortal breaks

Post by Batandy »

I've discovered this bug while making an interactive portal in Golden Souls 2
Image
This portal isn't active at first, you have to press a switch that starts a cutscene, with the portal opening.
The lineportal gets activated by assigning the lineids during the cutscene, and it all goes well... until you go back to the hub

If you exit this map once you've activated the portal, enter the hub and then enter this map again

Image

The lineportal breaks. It only happens with lineportals which have their lineid assigned through acs, regular lineportals work fine.
The temporary solution i have is reassigning the portals each time you re-enter the map, but i believe this is an unintended behavior which should be addressed.

I've replicated it in an example wad i'm providing with this post
Attachments
setlineportalbug.pk3
(6.9 KiB) Downloaded 30 times
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Line_SetPortalTarget + Hub = LinePortal breaks

Post by _mental_ »

The bug is not related to hubs. The same effect can be achieved by saving and loading game on MAP01 from the given sample after activating a portal.
It seems a call to P_CollectLinkedPortals() is not enough at this line. At least, replacing it with P_FinalizePortals() fixes the problem.
However, I'm not 100% sure that everything P_FinalizePortals() that does needs to be done during loading of saved game.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Line_SetPortalTarget + Hub = LinePortal breaks

Post by Graf Zahl »

I don't think that anything in there is harmful and at worst just a bit time consuming because it performs redundant computations, but if it can be cut down to what really is needed here it might be better.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Line_SetPortalTarget + Hub = LinePortal breaks

Post by _mental_ »

There is nothing can be skipped in P_FinalizePortals() function to make portals functional after loading of saved game.
To avoid useless portals and blockmap update I propose the following change.
Now it works correctly with portals activated initially or by scripting, for just loaded and savegame-restored level.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Line_SetPortalTarget + Hub = LinePortal breaks

Post by Graf Zahl »

Looks ok to me. Thinking about it, finalizing portals before having restored their state from a savegame really makes no sense.
Post Reply

Return to “Closed Bugs [GZDoom]”