+ *trace = SV_TraceBox(start, mins, maxs, end, type, ent, SV_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value);
+ // abort move if we're stuck in the world (and didn't make it out)
+ if (trace->worldstartsolid && trace->allsolid && trace->startdepth < 0 && checkstuck)
+ {
+ // checking startdepth eliminates many false positives on Q1BSP with mod_q1bsp_polygoncollisions 0
+ // but it's still not guaranteed that we're stuck in a bmodel at this point
+ if (sv_gameplayfix_nudgeoutofsolid.integer && sv_gameplayfix_nudgeoutofsolid_separation.value >= 0)
+ {
+ switch (PHYS_NudgeOutOfSolid(prog, ent))
+ {
+ case 0:
+ Con_Printf(CON_WARN "NudgeOutOfSolid couldn't fix stuck entity %i (classname \"%s\").\n", (int)PRVM_EDICT_TO_PROG(ent), PRVM_GetString(prog, PRVM_serveredictstring(ent, classname)));
+ return true; // definitely stuck in a bmodel
+ case 1:
+ Con_DPrintf("NudgeOutOfSolid fixed stuck entity %i (classname \"%s\") with offset %f %f %f.\n", (int)PRVM_EDICT_TO_PROG(ent), PRVM_GetString(prog, PRVM_serveredictstring(ent, classname)), PRVM_serveredictvector(ent, origin)[0] - start[0], PRVM_serveredictvector(ent, origin)[1] - start[1], PRVM_serveredictvector(ent, origin)[2] - start[2]);
+ VectorCopy(PRVM_serveredictvector(ent, origin), start);
+ VectorAdd(start, push, end);
+ *trace = SV_TraceBox(start, mins, maxs, end, type, ent, SV_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value);
+
+ // definitely not stuck in a bmodel, move may proceed
+ }
+ }
+ else if (sv_gameplayfix_unstickentities.integer && SV_UnstickEntity(ent))
+ {
+ // bones_was_here: pretty sure we can deprecate sv_gameplayfix_unstickentities, sv_gameplayfix_nudgeoutofsolid is much nicer
+ VectorCopy(PRVM_serveredictvector(ent, origin), start);
+ VectorAdd(start, push, end);
+ *trace = SV_TraceBox(start, mins, maxs, end, type, ent, SV_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value);
+ }
+ else
+ return true; // assuming stuck, bones_was_here TODO: always use PHYS_NudgeOutOfSolid (remove sv_gameplayfix_nudgeoutofsolid)?
+ }