From 53df7dd7131f4e3cafefa3e900df1c86aca1b50e Mon Sep 17 00:00:00 2001 From: divverent Date: Sat, 17 Oct 2009 19:08:26 +0000 Subject: [PATCH] also support bouncefactor for MOVETYPE_BOUNCEMISSILE git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9347 d7cf8633-e32d-0410-b094-e92efae38249 --- sv_phys.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sv_phys.c b/sv_phys.c index 15355fd4..df72445c 100644 --- 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) -- 2.39.2