From c150f9d737031afd9584a0baba1ab58facc99aac Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 26 Feb 2017 11:37:43 +0200 Subject: [PATCH] Fixed incorrect pointers for Actor.Used() https://mantis.zdoom.org/view.php?id=340 --- src/p_map.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index 789a07076..13f566b1f 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -5276,20 +5276,22 @@ bool P_UseTraverse(AActor *usething, const DVector2 &start, const DVector2 &end, // [RH] Check for things to talk with or use a puzzle item on if (!in->isaline) { - if (usething == in->d.thing) + AActor * const mobj = in->d.thing; + + if (mobj == usething) continue; // Check thing // Check for puzzle item use or USESPECIAL flag // Extended to use the same activationtype mechanism as BUMPSPECIAL does - if (in->d.thing->flags5 & MF5_USESPECIAL || in->d.thing->special == UsePuzzleItem) + if (mobj->flags5 & MF5_USESPECIAL || mobj->special == UsePuzzleItem) { - if (P_ActivateThingSpecial(in->d.thing, usething)) + if (P_ActivateThingSpecial(mobj, usething)) return true; } - IFVIRTUALPTR(usething, AActor, Used) + IFVIRTUALPTR(mobj, AActor, Used) { - VMValue params[] = { usething, in->d.thing }; + VMValue params[] = { mobj, usething }; int ret; VMReturn vret(&ret); GlobalVMStack.Call(func, params, 2, &vret, 1);