From 4cf3a4a1cf97342f2ba0f7339846a55e669ba0e1 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 28 Mar 2013 01:01:19 +0000 Subject: [PATCH] - Always spawn RocketSmokeTrail and GrenadeSmokeTrail actors, and make them invisible for players who don't want to see them. This is needed for multiplayer sync between players with different settings for cl_rockettrails. SVN r4206 (trunk) --- src/p_mobj.cpp | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 5cc5ecfe1..e0dc45adc 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -3054,37 +3054,36 @@ void AActor::Tick () } - if (cl_rockettrails & 2) + if (effects & FX_ROCKET) { - if (effects & FX_ROCKET) + if (++smokecounter == 4) { - if (++smokecounter==4) + // add some smoke behind the rocket + smokecounter = 0; + AActor *th = Spawn("RocketSmokeTrail", x-velx, y-vely, z-velz, ALLOW_REPLACE); + if (th) { - // add some smoke behind the rocket - smokecounter = 0; - AActor * th = Spawn("RocketSmokeTrail", x-velx, y-vely, z-velz, ALLOW_REPLACE); - if (th) - { - th->tics -= pr_rockettrail()&3; - if (th->tics < 1) th->tics = 1; - } + th->tics -= pr_rockettrail()&3; + if (th->tics < 1) th->tics = 1; + if (!(cl_rockettrails & 2)) th->renderflags |= RF_INVISIBLE; } } - else if (effects & FX_GRENADE) + } + else if (effects & FX_GRENADE) + { + if (++smokecounter == 8) { - if (++smokecounter==8) + smokecounter = 0; + angle_t moveangle = R_PointToAngle2(0,0,velx,vely); + AActor * th = Spawn("GrenadeSmokeTrail", + x - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], radius*2) + (pr_rockettrail()<<10), + y - FixedMul (finesine[(moveangle)>>ANGLETOFINESHIFT], radius*2) + (pr_rockettrail()<<10), + z - (height>>3) * (velz>>16) + (2*height)/3, ALLOW_REPLACE); + if (th) { - smokecounter = 0; - angle_t moveangle = R_PointToAngle2(0,0,velx,vely); - AActor * th = Spawn("GrenadeSmokeTrail", - x - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], radius*2) + (pr_rockettrail()<<10), - y - FixedMul (finesine[(moveangle)>>ANGLETOFINESHIFT], radius*2) + (pr_rockettrail()<<10), - z - (height>>3) * (velz>>16) + (2*height)/3, ALLOW_REPLACE); - if (th) - { - th->tics -= pr_rockettrail()&3; - if (th->tics < 1) th->tics = 1; - } + th->tics -= pr_rockettrail()&3; + if (th->tics < 1) th->tics = 1; + if (!(cl_rockettrails & 2)) th->renderflags |= RF_INVISIBLE; } } }