]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fixed bug where items would not fall if pushed off a ledge by a
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 22 Apr 2007 09:02:23 +0000 (09:02 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 22 Apr 2007 09:02:23 +0000 (09:02 +0000)
MOVETYPE_PUSH entity

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7150 d7cf8633-e32d-0410-b094-e92efae38249

sv_phys.c

index 60ab8f24cb13f5b2ed97c627129853057e3d0726..2948f2c9210e640aed513ed7c21525ac59be9fd8 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -1191,9 +1191,10 @@ void SV_PushMove (prvm_edict_t *pusher, float movetime)
                pusher->fields.server->solid = savesolid; // was SOLID_BSP
                //Con_Printf("%s:%d frac %f startsolid %d bmodelstartsolid %d allsolid %d\n", __FILE__, __LINE__, trace.fraction, trace.startsolid, trace.bmodelstartsolid, trace.allsolid);
 
-               // this check is for items riding platforms that are passing under (or
-               // through) walls intended to knock the items off
-               if (trace.fraction < 1 && check->fields.server->movetype != MOVETYPE_WALK)
+               // this trace.fraction < 1 check causes items to fall off of pushers
+               // if they pass under or through a wall
+               // the groundentity check causes items to fall off of ledges
+               if (check->fields.server->movetype != MOVETYPE_WALK && (trace.fraction < 1 || PRVM_PROG_TO_EDICT(check->fields.server->groundentity) != pusher))
                        check->fields.server->flags = (int)check->fields.server->flags & ~FL_ONGROUND;
 
                // if it is still inside the pusher, block