Skip to content

Commit

Permalink
let passengers eject from vehicles
Browse files Browse the repository at this point in the history
  • Loading branch information
videoP committed Feb 25, 2024
1 parent ca17eb4 commit 057e259
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions codemp/game/g_vehicles.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,10 +532,15 @@ qboolean VEH_TryEject( Vehicle_t *pVeh,
// Check to see if this new position is a valid place for our entity to go.
VectorSet(vEntMins, -15.0f, -15.0f, DEFAULT_MINS_2);
VectorSet(vEntMaxs, 15.0f, 15.0f, DEFAULT_MAXS_2);
oldOwner = ent->r.ownerNum;
ent->r.ownerNum = ENTITYNUM_NONE;
G_VehicleTrace( &m_ExitTrace, ent->r.currentOrigin, vEntMins, vEntMaxs, vExitPos, ent->s.number, ent->clipmask );
ent->r.ownerNum = oldOwner;

//fix from LMD to let passengers eject
//oldOwner = ent->r.ownerNum;
oldOwner = parent->r.ownerNum;
//ent->r.ownerNum = ENTITYNUM_NONE;
parent->r.ownerNum = ent->s.number;
G_VehicleTrace(&m_ExitTrace, ent->r.currentOrigin, vEntMins, vEntMaxs, vExitPos, ent->s.number, ent->clipmask);
//ent->r.ownerNum = oldOwner;
parent->r.ownerNum = oldOwner;

if ( m_ExitTrace.allsolid//in solid
|| m_ExitTrace.startsolid)
Expand Down

0 comments on commit 057e259

Please sign in to comment.