fix SM_OVERVIEW (issue #395)
This commit is contained in:
@@ -305,7 +305,7 @@ bool collide(physent *d, bool spawn, float drop, float rise)
|
||||
loopv(players) // collide with other players
|
||||
{
|
||||
playerent *o = players[i];
|
||||
if(!o || o==d || (o==player1 && d->type==ENT_CAMERA)) continue;
|
||||
if(!o || o==d) continue;
|
||||
if(plcollide(d, o, headspace, hi, lo)) return true;
|
||||
}
|
||||
if(d!=player1) if(plcollide(d, player1, headspace, hi, lo)) return true;
|
||||
@@ -912,7 +912,7 @@ FVARP(mfilter, 0.0f, 0.0f, 6.0f); // simple lowpass filtering (zer
|
||||
|
||||
void mousemove(int idx, int idy)
|
||||
{
|
||||
if(intermission || ispaused || (player1->isspectating() && player1->spectatemode==SM_FOLLOW1ST)) return;
|
||||
if(intermission || ispaused || (player1->isspectating() && (player1->spectatemode==SM_FOLLOW1ST||player1->spectatemode==SM_OVERVIEW))) return;
|
||||
bool zooming = player1->weaponsel->type == GUN_SNIPER && ((sniperrifle *)player1->weaponsel)->scoped; // check if player uses scope
|
||||
float dx = idx, dy = idy;
|
||||
if(mfilter > 0.0001f)
|
||||
|
||||
@@ -521,12 +521,16 @@ void recomputecamera()
|
||||
break;
|
||||
}
|
||||
case SM_FLY:
|
||||
{
|
||||
resetcamera();
|
||||
camera1->type = ENT_PLAYER;
|
||||
camera1->eyeheight = 1.0f;
|
||||
break;
|
||||
}
|
||||
case SM_OVERVIEW:
|
||||
{
|
||||
// TODO : fix water rendering
|
||||
camera1->type = ENT_CAMERA;
|
||||
camera1->o.x = clmapdims.xm;
|
||||
camera1->o.y = clmapdims.ym;
|
||||
camera1->o.z = clmapdims.maxceil + 1;
|
||||
@@ -539,7 +543,8 @@ void recomputecamera()
|
||||
case SM_FOLLOW1ST:
|
||||
{
|
||||
playerent *f = updatefollowplayer();
|
||||
if(!f) { togglespect(); return; }
|
||||
//if(!f) { togglespect(); return; }//why turn off spectating - better to switch to SM_FLY
|
||||
if(!f){ player1->spectatemode = SM_FLY; recomputecamera(); return; }
|
||||
camera1 = f;
|
||||
break;
|
||||
}
|
||||
@@ -547,7 +552,8 @@ void recomputecamera()
|
||||
case SM_FOLLOW3RD_TRANSPARENT:
|
||||
{
|
||||
playerent *p = updatefollowplayer();
|
||||
if(!p) { togglespect(); return; }
|
||||
//if(!p) { togglespect(); return; }//why turn off spectating - better to switch to SM_FLY
|
||||
if(!p){ player1->spectatemode = SM_FLY; recomputecamera(); return; }
|
||||
static physent followcam;
|
||||
static playerent *lastplayer;
|
||||
if(lastplayer != p || &followcam != camera1)
|
||||
|
||||
@@ -961,7 +961,7 @@ void renderclient(playerent *d, const char *mdlname, const char *vwepname, int t
|
||||
{
|
||||
if(d==player1 && d->allowmove()) return;
|
||||
if(d->nocorpse) return;
|
||||
d->pitch = 0.1f;
|
||||
d->pitch = d->spectatemode == SM_OVERVIEW ? -90 : 0.1f;
|
||||
anim = ANIM_DEATH;
|
||||
basetime = d->lastpain;
|
||||
int t = lastmillis-d->lastpain;
|
||||
|
||||
Reference in New Issue
Block a user