also support bouncefactor for MOVETYPE_BOUNCEMISSILE
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 17 Oct 2009 19:08:26 +0000 (19:08 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 17 Oct 2009 19:08:26 +0000 (19:08 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9347 d7cf8633-e32d-0410-b094-e92efae38249

sv_phys.c

index 15355fd..df72445 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -2432,7 +2432,13 @@ void SV_Physics_Toss (prvm_edict_t *ent)
                movetime *= 1 - min(1, trace.fraction);
                if (ent->fields.server->movetype == MOVETYPE_BOUNCEMISSILE)
                {
-                       ClipVelocity (ent->fields.server->velocity, trace.plane.normal, ent->fields.server->velocity, 2.0);
+                       prvm_eval_t *val;
+                       float bouncefactor = 1.0f;
+                       val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.bouncefactor);
+                       if (val!=0 && val->_float)
+                               bouncefactor = val->_float;
+
+                       ClipVelocity (ent->fields.server->velocity, trace.plane.normal, ent->fields.server->velocity, 1 + bouncefactor);
                        ent->fields.server->flags = (int)ent->fields.server->flags & ~FL_ONGROUND;
                }
                else if (ent->fields.server->movetype == MOVETYPE_BOUNCE)