So what's the reason for this:
Code: Select all
player_t* pPlayer = players[consoleplayer].camera->player;
if (pPlayer && pPlayer->mo)
You are essentially disabling the feature for non-player cameras entirely. You alre also not comparing the angle toward the actual camera but to the player actor attached to the camera, which is not necessarily the same. Why do you require
players[consoleplayer].camera->player->mo
and not just
players[consoleplayer].camera
?
Last but not least - this does not consider chasecam etc. Since this is a RENDERER feature you cannot do comparisons against PLAYSIM values, you have to use the renderer's ViewPos to determine where the camera is, not the camera actor's position.
Too bad I only noticed this after committing, it should be easy to fix, though.