mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-01-12 23:07:55 +03:00
Add extra trace to npc_create for NPCs which should use bbox instead of hull (e.g. npc_rollermine)
This commit is contained in:
parent
e7cdb69c58
commit
424fcf0792
@ -477,6 +477,20 @@ public:
|
|||||||
|
|
||||||
AI_TraceHull( baseNPC->GetAbsOrigin(), vUpBit, baseNPC->GetHullMins(), baseNPC->GetHullMaxs(),
|
AI_TraceHull( baseNPC->GetAbsOrigin(), vUpBit, baseNPC->GetHullMins(), baseNPC->GetHullMaxs(),
|
||||||
MASK_NPCSOLID, baseNPC, COLLISION_GROUP_NONE, &tr );
|
MASK_NPCSOLID, baseNPC, COLLISION_GROUP_NONE, &tr );
|
||||||
|
|
||||||
|
// NEW: For vphysics/flying entities, do a second attempt which teleports based on bounding box
|
||||||
|
if ( (baseNPC->GetMoveType() == MOVETYPE_VPHYSICS || baseNPC->CapabilitiesGet() & bits_CAP_MOVE_FLY) && (tr.startsolid || tr.fraction < 1.0) )
|
||||||
|
{
|
||||||
|
vUpBit.z += baseNPC->BoundingRadius();
|
||||||
|
baseNPC->Teleport( &vUpBit, NULL, NULL );
|
||||||
|
UTIL_DropToFloor( baseNPC, MASK_NPCSOLID );
|
||||||
|
|
||||||
|
Vector vUpBit2 = vUpBit;
|
||||||
|
vUpBit2.z += 1;
|
||||||
|
AI_TraceHull( vUpBit, vUpBit2, baseNPC->CollisionProp()->OBBMins(), baseNPC->CollisionProp()->OBBMaxs(),
|
||||||
|
MASK_NPCSOLID, baseNPC, COLLISION_GROUP_NONE, &tr );
|
||||||
|
}
|
||||||
|
|
||||||
if ( tr.startsolid || (tr.fraction < 1.0) )
|
if ( tr.startsolid || (tr.fraction < 1.0) )
|
||||||
{
|
{
|
||||||
baseNPC->SUB_Remove();
|
baseNPC->SUB_Remove();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user