prop_physics_multiplayer: Actively check if players are clipping inside TouchThink() and apply some velocity to wake the entity up
This commit is contained in:
parent
8e15f04c38
commit
8781494822
1 changed files with 35 additions and 2 deletions
|
@ -54,8 +54,41 @@ class prop_physics_multiplayer:NSPhysicsEntity
|
|||
void
|
||||
prop_physics_multiplayer::TouchThink(void)
|
||||
{
|
||||
//super::TouchThink();
|
||||
|
||||
{
|
||||
float oldsolid, oldmovetype;
|
||||
/* let players collide */
|
||||
dimension_solid = 255;
|
||||
dimension_hit = 255;
|
||||
oldsolid = solid;
|
||||
oldmovetype = movetype;
|
||||
movetype = MOVETYPE_NONE;
|
||||
solid = SOLID_TRIGGER;
|
||||
tracebox(origin, mins, maxs, origin, MOVE_NORMAL, this);
|
||||
solid = oldsolid;
|
||||
movetype = oldmovetype;
|
||||
dimension_solid = 1;
|
||||
dimension_hit = 1;
|
||||
|
||||
if (trace_ent.flags & FL_CLIENT) {
|
||||
//print(sprintf("%s %f\n", trace_ent.classname, trace_fraction));
|
||||
PhysicsEnable();
|
||||
super::TouchThink();
|
||||
makevectors(origin - trace_ent.origin);
|
||||
ApplyForceCenter(v_forward * 64);
|
||||
velocity = v_forward * 64;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_iPhysicsMode == 3) {
|
||||
} else {
|
||||
if (vlen(velocity) < 2) {
|
||||
velocity = [0,0,0];
|
||||
PhysicsDisable();
|
||||
}
|
||||
}
|
||||
|
||||
nextthink = time;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue