diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index a6537de9d..02d26f838 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -135,15 +135,13 @@ void TickActor(DDukeActor* self) bool conres = execute(self, p, pdist); if (!conres && (self->flags4 & SFLAG4_CONOVERRIDE)) { - self->state_player = &ps[p]; - self->state_dist = pdist; self->flags4 |= SFLAG4_INRUNSTATE; IFVIRTUALPTR(self, DDukeActor, RunState) { - VMValue val[] = { self }; + VMValue val[] = { self, &ps[p], pdist}; try { - VMCall(func, val, 1, nullptr, 0); + VMCall(func, val, 3, nullptr, 0); } catch(const CDukeKillEvent& ev) { @@ -155,8 +153,6 @@ void TickActor(DDukeActor* self) } } self->flags4 &= ~SFLAG4_INRUNSTATE; - self->state_player = nullptr; - self->state_dist = -1; conres = true; } // moveactor gets only called for actors with a scripted runner. diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index 6d1333429..f9da0fa6a 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -110,10 +110,6 @@ public: TObjPtr temp_actor, seek_actor; TArray uservars; - // these two variables are only valid while RunState is executed. They are explicitly nulled right afterward and only accessible throgh the CON emulation interface. - struct player_struct* state_player; - double state_dist; - DDukeActor() = default; size_t PropagateMark() override; const ActorInfo* conInfo() const;