It can be handy for calling code to know if the entity was initially
stuck (mainly for warnings).
Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
#include "cl_collision.h"
#include "cl_collision.h"
-qbool PHYS_NudgeOutOfSolid(prvm_prog_t *prog, prvm_edict_t *ent)
+int PHYS_NudgeOutOfSolid(prvm_prog_t *prog, prvm_edict_t *ent)
{
int bump, pass;
trace_t stucktrace;
{
int bump, pass;
trace_t stucktrace;
{
// found a good location, use it
VectorCopy(stuckorigin, PRVM_serveredictvector(ent, origin));
{
// found a good location, use it
VectorCopy(stuckorigin, PRVM_serveredictvector(ent, origin));
+ return bump || pass ? 1 : -1; // -1 means it wasn't stuck
}
nudge = -stucktrace.startdepth;
VectorMA(stuckorigin, nudge, stucktrace.startdepthnormal, stuckorigin);
}
}
}
nudge = -stucktrace.startdepth;
VectorMA(stuckorigin, nudge, stucktrace.startdepthnormal, stuckorigin);
}
}
/*! move an entity that is stuck out of the surface it is stuck in (can move large amounts)
/*! move an entity that is stuck out of the surface it is stuck in (can move large amounts)
- * returns true if it found a better place
+ * returns 1 if it found a better place, 0 if it remains stuck, -1 if it wasn't stuck.
-qbool PHYS_NudgeOutOfSolid(prvm_prog_t *prog, prvm_edict_t *ent);
+int PHYS_NudgeOutOfSolid(prvm_prog_t *prog, prvm_edict_t *ent);
extern cvar_t cl_gameplayfix_nudgeoutofsolid_separation;
extern cvar_t cl_gameplayfix_nudgeoutofsolid_separation;