Fixed Pre(Un)Morph being called out of order.
- This had broken several mods that relied on the inventory being in place before the switch, which was the intended way to begin with.
This commit is contained in:
parent
5fc3d44ba5
commit
3e91d38582
3 changed files with 37 additions and 6 deletions
|
|
@ -5345,6 +5345,42 @@ int MorphPointerSubstitution(AActor* from, AActor* to)
|
|||
return false;
|
||||
}
|
||||
|
||||
// [MC] Had to move this here since ObtainInventory was also moved as well. Should be called
|
||||
// before any transference of items since that's what was intended when introduced.
|
||||
if (!from->alternative) // Morphing into
|
||||
{
|
||||
{
|
||||
IFVIRTUALPTR(from, AActor, PreMorph)
|
||||
{
|
||||
VMValue params[] = { from, to, false };
|
||||
VMCall(func, params, 3, nullptr, 0);
|
||||
}
|
||||
}
|
||||
{
|
||||
IFVIRTUALPTR(to, AActor, PreMorph)
|
||||
{
|
||||
VMValue params[] = { to, from, true };
|
||||
VMCall(func, params, 3, nullptr, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else // Unmorphing back
|
||||
{
|
||||
{
|
||||
IFVIRTUALPTR(from, AActor, PreUnmorph)
|
||||
{
|
||||
VMValue params[] = { from, to, false };
|
||||
VMCall(func, params, 3, nullptr, 0);
|
||||
}
|
||||
}
|
||||
{
|
||||
IFVIRTUALPTR(to, AActor, PreUnmorph)
|
||||
{
|
||||
VMValue params[] = { to, from, true };
|
||||
VMCall(func, params, 3, nullptr, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Since the check is good, move the inventory items over. This should always be done when
|
||||
// morphing to emulate Heretic/Hexen's behavior since those stored the inventory in their
|
||||
// player structs.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue