[Fix inside]Camera + Morph = Crash

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.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Camera + Morph = Crash

Post by Major Cooke »

Graf Zahl wrote:Correct. Since it's no longer safe to use tracer for this, a different variable is needed.
Is there a particular property or flag that's set on a morphed actor to safely check, to transition them into a MorphedTarget/Master/Tracer?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Camera + Morph = Crash

Post by Graf Zahl »

No. There's only a flag on the unmorphed version, but you need tracer to get there. My solution here would be simple:

Add a new variable and set the unmorphed monster both as that and as tracer. I think that will solve all potential issues.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Camera + Morph = Crash

Post by Major Cooke »

I believe target and master should also do the same thing because I could have been using SXF_ISTARGET as well.

Alright. I'll work on it, if edward isn't.
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: Camera + Morph = Crash

Post by Edward-san »

Yeah, you can go ahead.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Camera + Morph = Crash

Post by Major Cooke »

Bugfix PR. Things turned out to be a tad bit different -- but for good reason.

Tracer is not a safe pointer at all anymore, for storing players and their morphed counterparts. Why? A_RearrangePointers just to name one. The easiest thing to do for players is to introduce the 'alternative' pointer into the mix. I've thus removed all form of storing (un)morphed tracers in the players and morphs involving the morph swappage, and is now done through the alternative pointer.

Monsters remain unchanged: they have an (Un)MorphedMe pointer and aren't of concern.

This fixes several things, and does me a bonus favor:
  • Fixes the crash experienced here.
  • Fixes a long outstanding bug that only I was able to reproduce a long time ago involving morphs failing to unmorph due to the player tracer pointer being manipulated (Do an A_RadiusGive to all playerpawns which causes them to forget their tracers... That unmorph is never coming!)
  • The original target and tracer are now transferred forth for maintained consistency and better tracking of pointers. When the morph expires, it transfers the target and tracer back which may or may not have changed over time, again for consistency.
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: [Fix inside]Camera + Morph = Crash

Post by Edward-san »

I'm not convinced about the variable name, but dunno about any other 'alternative' ones. I wonder if it would be better to condense all the morph data into a struct or class...
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: [Fix inside]Camera + Morph = Crash

Post by Major Cooke »

I'm gonna stick with Graf's route and not fix what isn't broken. As for the name... :shrug:
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: [Fix inside]Camera + Morph = Crash

Post by Major Cooke »

Thanks for applying this. This can be closed.
Post Reply

Return to “Closed Bugs [GZDoom]”