diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 9ee3294b4..504ed9759 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -1287,20 +1287,15 @@ static void movefireext(DDukeActor* actor) static void moveviewscreen(DDukeActor* actor) { + const int VIEWSCR_DIST = 8192; // was originally 2048, was increased to this by EDuke32 and RedNukem. if (actor->s.xrepeat == 0) deletesprite(actor); else { int x; - findplayer(actor, &x); + int p = findplayer(actor, &x); - if (x < 2048) - { -#if 0 - if (actor->s.yvel == 1) - camsprite = actor; -#endif - } - else if (camsprite != nullptr && actor->temp_data[0] == 1) + x = dist(actor, ps[p].GetActor()); // the result from findplayer is not really useful. + if (x >= VIEWSCR_DIST && camsprite == actor) { camsprite = nullptr; actor->s.yvel = 0; diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index 4abc1d1d8..3cbc58d76 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -258,14 +258,14 @@ void animatesprites_d(int x, int y, int a, int smoothratio) continue; case VIEWSCREEN: case VIEWSCREEN2: - if (camsprite != nullptr && h->GetOwner()->temp_data[0] == 1) + if (camsprite != nullptr && h->GetHitOwner()->temp_data[0] == 1) { t->picnum = STATIC; t->cstat |= (rand() & 12); t->xrepeat += 8; t->yrepeat += 8; } - else if (camsprite != nullptr) + else if (camsprite == h->GetHitOwner()) { t->picnum = TILE_VIEWSCR; }