PowerMorph no longer properly unmorphs player

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
AFADoomer
Posts: 1342
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

PowerMorph no longer properly unmorphs player

Post by AFADoomer »

After the Morph refactoring (1 March 24 and following commits), PowerMorph items no longer unmorph the player properly.

The PowerMorph item no longer shows up in the morphed player's inventory, so the player can no longer be unmorphed by removing the powerup from inventory.

If morphs are allowed to run to full duration, the player is "unmorphed" and the powerup is destroyed, EndEffect function is called etc., but health, viewheight, etc. are not reset.

If morphs are manually reverted via the 'morphme' cheat, the player is unmorphed properly, but the powerup is not destroyed and stays in the game but not in the player's inventory.

There's also no teleport fog when morphing or unmorphing anymore.

Sample .pk3 attached... Just 'give morphtest' and test as detailed above.
Spoiler: The test actor...
For demo of this being broken in a released mod: You can no longer exit Blade of Agony's driveable tanks.
Attachments
MorphTest.pk3
(525 Bytes) Downloaded 16 times
User avatar
Rachael
Posts: 13955
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: PowerMorph no longer properly unmorphs player

Post by Rachael »

This really sucked to have to do, but I reverted the morph rework for now. Since this is one among many things I have to address, it simply is not timely-feasible for me to address this properly right now.
Boondorl
Posts: 169
Joined: Wed Jul 11, 2018 10:57 pm

Re: PowerMorph no longer properly unmorphs player

Post by Boondorl »

Seems I accidentally missed setting the defaults for the morph and unmorph flashes. As for the owner trickery, I believe this was caused by a much later commit: this one to be exact. What happened here is that previously when I did the rework I removed the outright pointer substitution because it was simply too dangerous to be left as is. Most of it was reimplemented manually. Later though with the help of Ricardo a proper typing system was implemented that makes it safe so it was brought back. How InitEffect() works is by setting the item's own Owner pointer before entering the function and then sending a signal back that said owner was changed during a morph, to which it then updates the item pickup Actor. The problem is that, after substituting was brought back, it was coming across said Owner pointer while going over the Objects and swapping it automatically, and then my manual pointer swapping was changing it right back. Thankfully a fairly simple fix.
User avatar
AFADoomer
Posts: 1342
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Re: PowerMorph no longer properly unmorphs player

Post by AFADoomer »

This is mostly fixed, but now the MRF_LOSEACTUALWEAPON flags doesn't seem to have any effect... At least not in Blade of Agony. You end up stuck using the tank cannon when you leave the tank.

EDIT: OK, so in BoA the weapon is removed, but the normal player weapons aren't given back - and if you 'give all', the only weapon you are given is the tank cannon. I have had a hard time creating a minimal duplicate of this bug outside of BoA - The weapons seem to reset properly with my original test.
Post Reply

Return to “Closed Bugs [GZDoom]”