- fixed invocation of RunState.

This commit is contained in:
Christoph Oelckers 2023-04-30 10:05:21 +02:00
parent 83c401574c
commit b55d39e58d
2 changed files with 2 additions and 10 deletions

View file

@ -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.

View file

@ -110,10 +110,6 @@ public:
TObjPtr<DDukeActor*> temp_actor, seek_actor;
TArray<GameVarValue> 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;