diff --git a/src/playsim/fragglescript/t_func.cpp b/src/playsim/fragglescript/t_func.cpp index c479e9015c..ee1a94cc6f 100644 --- a/src/playsim/fragglescript/t_func.cpp +++ b/src/playsim/fragglescript/t_func.cpp @@ -1273,7 +1273,7 @@ void FParser::SF_MobjTarget(void) } t_return.type = svt_mobj; - t_return.value.mobj = mo ? mo->target : nullptr; + t_return.value.mobj = mo ? mo->target.Get() : nullptr; } } diff --git a/src/playsim/p_actionfunctions.cpp b/src/playsim/p_actionfunctions.cpp index 10d8abb9d8..a0407e028e 100644 --- a/src/playsim/p_actionfunctions.cpp +++ b/src/playsim/p_actionfunctions.cpp @@ -1201,7 +1201,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CustomRailgun) { self->Angles.Yaw = self->AngleTo(self->target); } - self->Angles.Pitch = P_AimLineAttack (self, self->Angles.Yaw, MISSILERANGE, &t, 60., 0, aim ? self->target : nullptr); + self->Angles.Pitch = P_AimLineAttack (self, self->Angles.Yaw, MISSILERANGE, &t, 60., 0, aim ? self->target.Get() : nullptr); if (t.linetarget == NULL && aim) { // We probably won't hit the target, but aim at it anyway so we don't look stupid.