delete(this.move_controller);
}
controller = new_pure(SUB_CalcMove_controller);
+ set_movetype(controller, MOVETYPE_NONE); // mark the entity as physics driven so that thinking is handled by QC
controller.owner = this;
this.move_controller = controller;
controller.platmovetype = this.platmovetype;
void set_movetype(entity this, int mt)
{
this.move_movetype = mt;
- if (mt == MOVETYPE_PHYSICS) {
- this.move_qcphysics = false;
- } else if (autocvar_sv_qcphysics == 2) {
- this.move_qcphysics = true;
- }
+ this.move_qcphysics = (mt != MOVETYPE_PHYSICS);
if(!IL_CONTAINS(g_moveables, this))
IL_PUSH(g_moveables, this); // add it to the moveable entities list (even if it doesn't move!) logic: if an object never sets its movetype, we assume it never does anything notable
this.movetype = (this.move_qcphysics) ? MOVETYPE_QCENTITY : mt;
#ifdef SVQC
// undefined on client, engine cvar
bool autocvar_physics_ode;
-
-int autocvar_sv_qcphysics = 1; // TODO this is for testing - remove when qcphysics work
#endif
// water levels
void CSQCPlayer_CalcRefdef(entity this)
{
+ if(use_engine_refdef)
+ {
+ int refdefflags = 0;
+ if (this.csqcmodel_teleported) refdefflags |= REFDEFFLAG_TELEPORTED;
+ if (input_buttons & BIT(1)) refdefflags |= REFDEFFLAG_JUMPING;
+ // note: these two only work in WIP2, but are harmless in WIP1
+ if (PHYS_HEALTH(NULL) <= 0 && PHYS_HEALTH(NULL) != -666 && PHYS_HEALTH(NULL) != -2342) refdefflags |= REFDEFFLAG_DEAD;
+ if (intermission) refdefflags |= REFDEFFLAG_INTERMISSION;
+ V_CalcRefdef(this, refdefflags); // TODO? uses .health stat in the engine when this isn't called here, may be broken!
+ return;
+ }
+
vector vieworg = this.origin;
if(intermission)
{
setproperty(VF_ANGLES, view_angles);
}
-bool autocvar_cl_useenginerefdef = false;
-
/** Called once per CSQC_UpdateView() */
void CSQCPlayer_SetCamera()
{
InterpolateOrigin_Do(view);
view.view_ofs = '0 0 1' * vh;
}
- if(autocvar_cl_useenginerefdef)
- {
- int refdefflags = 0;
- if (view.csqcmodel_teleported) refdefflags |= REFDEFFLAG_TELEPORTED;
- if (input_buttons & BIT(1)) refdefflags |= REFDEFFLAG_JUMPING;
- // note: these two only work in WIP2, but are harmless in WIP1
- if (PHYS_HEALTH(NULL) <= 0 && PHYS_HEALTH(NULL) != -666 && PHYS_HEALTH(NULL) != -2342) refdefflags |= REFDEFFLAG_DEAD;
- if (intermission) refdefflags |= REFDEFFLAG_INTERMISSION;
- V_CalcRefdef(view, refdefflags); // TODO? uses .health stat in the engine when this isn't called here, may be broken!
- }
- else
- {
- CSQCPlayer_CalcRefdef(view);
- }
+ CSQCPlayer_CalcRefdef(view);
}
else
{
const int CSQCPLAYERSTATUS_FROMSERVER = 1;
const int CSQCPLAYERSTATUS_PREDICTED = 2;
+bool use_engine_refdef; // debug option for testing legacy engine code
+
// only ever READ these!
.int pmove_flags;
const int PMF_JUMP_HELD = 1;
if (IS_REAL_CLIENT(this))
sv_notice_join(this);
- this.move_qcphysics = autocvar_sv_qcphysics;
+ this.move_qcphysics = true;
// update physics stats (players can spawn before physics runs)
Physics_UpdateStats(this);
seta cl_showspectators 0 "Show who's spectating you if server has sv_showspectators enabled"
-set cl_useenginerefdef 0
-
set cl_rollkillspeed 10
// Facility for config.cfg use ONLY.
sv_gameplayfix_stepmultipletimes 1
sv_gameplayfix_stepdown 2
// only available in qc physics
-set sv_gameplayfix_stepdown_maxspeed 0 "maximum speed walking entities can be moving for stepping down to apply - requires sv_qcphysics 1"
+set sv_gameplayfix_stepdown_maxspeed 0 "maximum speed walking entities can be moving for stepping down to apply"
// delay for "kill" to prevent abuse
set g_balance_kill_delay 2 "timer before death when using the kill command"