# define TAG_VIEWLOC_NAME tag_networkviewloc
# define TAG_VIEWLOC_TYPE int
.float tag_networkviewloc;
+
+# define MOVETYPE_NAME move_movetype
#else
# define TAG_ENTITY_NAME tag_entity
# define TAG_ENTITY_TYPE entity
# define TAG_VIEWLOC_NAME viewloc
# define TAG_VIEWLOC_TYPE entity
+
+# define MOVETYPE_NAME movetype
#endif
// new fields
CSQCMODEL_PROPERTY_SCALED(BIT(12), float, ReadByte, WriteByte, scale, 16, 0, 255) \
CSQCMODEL_PROPERTY(BIT(13), int, ReadInt24_t, WriteInt24_t, dphitcontentsmask) \
CSQCMODEL_PROPERTY(BIT(14), TAG_VIEWLOC_TYPE, ReadShort, WriteEntity, TAG_VIEWLOC_NAME) \
- CSQCMODEL_PROPERTY(BIT(15), int, ReadByte, WriteByte, multijump_count)
+ CSQCMODEL_PROPERTY(BIT(15), int, ReadByte, WriteByte, multijump_count) \
+ CSQCMODEL_PROPERTY(BIT(16), int, ReadByte, WriteByte, MOVETYPE_NAME)
// TODO get rid of colormod/glowmod here, find good solution for vortex charge glowmod hack; also get rid of some useless properties on non-players that only exist for CopyBody
// add hook function calls here
for (entity e = findradius(0.5 * (this.absmin + this.absmax), 0.5 * vlen(this.absmax - this.absmin)); e; e = e.chain)
{
+ if(e.move_nomonsters != MOVE_NOMONSTERS && e.move_nomonsters != MOVE_WORLDONLY)
if(e.move_touch && boxesoverlap(e.absmin, e.absmax, this.absmin, this.absmax))
{
other = this;
int cont = this.dphitcontentsmask;
this.dphitcontentsmask = DPCONTENTS_SOLID;
- tracebox(this.move_origin, this.mins, this.maxs, this.move_origin, MOVE_NOMONSTERS, this);
+ tracebox(this.move_origin, this.mins, this.maxs, this.move_origin, ((this.move_movetype == MOVETYPE_FLY_WORLDONLY) ? MOVE_WORLDONLY : MOVE_NOMONSTERS), this);
this.dphitcontentsmask = cont;
if(trace_startsolid)
type = max(0, this.move_nomonsters);
else if(this.move_movetype == MOVETYPE_FLYMISSILE)
type = MOVE_MISSILE;
+ else if(this.move_movetype == MOVETYPE_FLY_WORLDONLY)
+ type = MOVE_WORLDONLY;
else if(this.solid == SOLID_TRIGGER || this.solid == SOLID_NOT)
type = MOVE_NOMONSTERS;
else
case MOVETYPE_BOUNCEMISSILE:
case MOVETYPE_FLYMISSILE:
case MOVETYPE_FLY:
+ case MOVETYPE_FLY_WORLDONLY:
_Movetype_Physics_Toss(this, movedt);
break;
}
}
+void _Movetype_Physics_ClientFrame(entity this, float movedt)
+{
+ this.move_didgravity = -1;
+ switch (this.move_movetype)
+ {
+ case MOVETYPE_PUSH:
+ case MOVETYPE_FAKEPUSH:
+ _Movetype_Physics_Pusher(this, movedt);
+ break;
+ case MOVETYPE_NONE:
+ break;
+ case MOVETYPE_FOLLOW:
+ _Movetype_Physics_Follow(this);
+ break;
+ case MOVETYPE_NOCLIP:
+ _Movetype_CheckWater(this);
+ this.move_origin = this.move_origin + TICRATE * this.move_velocity;
+ this.move_angles = this.move_angles + TICRATE * this.move_avelocity;
+ _Movetype_LinkEdict(this, false);
+ break;
+ case MOVETYPE_STEP:
+ _Movetype_Physics_Step(this, movedt);
+ break;
+ case MOVETYPE_WALK:
+ case MOVETYPE_FLY:
+ case MOVETYPE_FLY_WORLDONLY:
+ _Movetype_Physics_Walk(this, movedt);
+ break;
+ case MOVETYPE_TOSS:
+ case MOVETYPE_BOUNCE:
+ case MOVETYPE_BOUNCEMISSILE:
+ case MOVETYPE_FLYMISSILE:
+ _Movetype_Physics_Toss(this, movedt);
+ break;
+ case MOVETYPE_PHYSICS:
+ break;
+ }
+}
+
void Movetype_Physics_NoMatchServer(entity this) // optimized
{
float movedt = time - this.move_time;
const int MOVETYPE_BOUNCE = 10;
const int MOVETYPE_BOUNCEMISSILE = 11; // Like bounce but doesn't lose speed on bouncing
const int MOVETYPE_FOLLOW = 12;
+const int MOVETYPE_PHYSICS = 32;
const int MOVETYPE_FLY_WORLDONLY = 33;
const int FL_ITEM = 256;
else if (MUTATOR_CALLHOOK(PM_Physics, this, maxspeed_mod))
{ }
+#ifdef SVQC
else if (this.movetype == MOVETYPE_NOCLIP || this.movetype == MOVETYPE_FLY || this.movetype == MOVETYPE_FLY_WORLDONLY || MUTATOR_CALLHOOK(IsFlying, this))
+#elif defined(CSQC)
+ else if (this.move_movetype == MOVETYPE_NOCLIP || this.move_movetype == MOVETYPE_FLY || this.move_movetype == MOVETYPE_FLY_WORLDONLY || MUTATOR_CALLHOOK(IsFlying, this))
+#endif
PM_fly(this, maxspeed_mod);
else if (this.waterlevel >= WATERLEVEL_SWIMMING)
}
#ifdef SVQC
-float trigger_push_send(entity to, float sf)
-{SELFPARAM();
+float trigger_push_send(entity this, entity to, float sf)
+{
WriteHeader(MSG_ENTITY, ENT_CLIENT_TRIGGER_PUSH);
WriteByte(MSG_ENTITY, sf);
void trigger_push_link()
{
- //Net_LinkEntity(self, false, 0, trigger_push_send);
+ Net_LinkEntity(self, false, 0, trigger_push_send);
}
#endif
#ifdef SVQC
void target_push_link()
{SELFPARAM();
- //Net_LinkEntity(self, false, 0, target_push_send);
+ Net_LinkEntity(self, false, 0, target_push_send);
//self.SendFlags |= 1; // update
}
self.entremove = trigger_remove_generic;
self.solid = SOLID_TRIGGER;
- self.draw = trigger_draw_generic;
- self.trigger_touch = trigger_push_touch;
+ //self.draw = trigger_draw_generic;
+ self.move_touch = trigger_push_touch;
self.drawmask = MASK_NORMAL;
self.move_time = time;
trigger_push_findtarget();
self.classname = "trigger_swamp";
self.solid = SOLID_TRIGGER;
- self.draw = trigger_draw_generic;
- self.trigger_touch = swamp_touch;
+ self.move_touch = swamp_touch;
self.drawmask = MASK_NORMAL;
self.move_time = time;
self.entremove = trigger_remove_generic;
}
void CSQC_ClientMovement_PlayerMove_Frame(entity this);
-void _Movetype_Physics_Frame(entity this, float movedt);
+void _Movetype_Physics_ClientFrame(entity this, float movedt);
void Movetype_Physics_Spam(entity this) // optimized
{
- _Movetype_Physics_Frame(this, PHYS_INPUT_TIMELENGTH);
+ _Movetype_Physics_ClientFrame(this, PHYS_INPUT_TIMELENGTH);
if(wasfreed(this))
return;
{
this.move_origin = this.origin;
this.move_angles = this.angles;
- this.move_movetype = MOVETYPE_WALK; // temp
+ //this.move_movetype = MOVETYPE_WALK; // temp
this.move_velocity = this.velocity;
this.move_avelocity = this.avelocity;
this.move_flags = BITSET(this.move_flags, FL_ONGROUND, boolean(this.flags & FL_ONGROUND));