const int MOVE_NORMAL = 0; // same as false
const int MOVE_NOMONSTERS = 1; // same as true
-const int MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
+const int MOVE_MISSILE = 2; // save as movement with .move_movetype == MOVETYPE_FLYMISSILE
const int MOVE_HITMODEL = 4;
const int MOVE_WORLDONLY = 3;
precache_model(this.mdl);
setmodel(this, this.mdl);
this.drawmask = MASK_NORMAL;
- //this.movetype = MOVETYPE_NOCLIP;
+ //this.move_movetype = MOVETYPE_NOCLIP;
//this.draw = Spawn_Draw;
}*/
if(autocvar_cl_spawn_point_particles)
# define TAG_VIEWLOC_NAME viewloc
# define TAG_VIEWLOC_TYPE entity
-# define MOVETYPE_NAME movetype
+# define MOVETYPE_NAME move_movetype
#endif
// new fields
// if (it.entnum) break;
// if (it.drawmask) break;
// if (it.predraw) break;
-// if (it.movetype) break;
+// if (it.move_movetype) break;
if (it.solid) break;
// if (it.origin) break;
// if (it.oldorigin) break;
ball.effects &= ~autocvar_g_nexball_basketball_effects_default;
ball.velocity = '0 0 0';
- ball.movetype = MOVETYPE_NONE;
+ set_movetype(ball, MOVETYPE_NONE);
settouch(ball, func_null);
ball.effects |= EF_NOSHADOW;
ball.scale = 1; // scale down.
setattachment(ball, NULL, "");
setorigin(ball, org);
- ball.movetype = MOVETYPE_BOUNCE;
+ set_movetype(ball, MOVETYPE_BOUNCE);
UNSET_ONGROUND(ball);
ball.scale = ball_scale;
ball.velocity = vel;
{
if(gameover) return;
UNSET_ONGROUND(this);
- this.movetype = MOVETYPE_BOUNCE;
+ set_movetype(this, MOVETYPE_BOUNCE);
if(this.classname == "nexball_basketball")
settouch(this, basketball_touch);
else if(this.classname == "nexball_football")
bprint("The ", Team_ColoredFullName(this.team), " held the ball for too long.\n");
settouch(this, func_null);
- this.movetype = MOVETYPE_NOCLIP;
+ set_movetype(this, MOVETYPE_NOCLIP);
this.velocity = '0 0 0'; // just in case?
if(!this.cnt)
LogNB("resetidle", NULL);
vtos(this.origin - this.spawnorigin), " Velocity: ", vtos(this.velocity), "\n");
this.velocity = '0 0 0';
setorigin(this, this.spawnorigin); // make sure it's positioned correctly anyway
- this.movetype = MOVETYPE_NONE;
+ set_movetype(this, MOVETYPE_NONE);
setthink(this, InitBall);
this.nextthink = max(time, game_starttime) + autocvar_g_nexball_delay_start;
}
this.glow_trail = true;
}
- this.movetype = MOVETYPE_FLY;
+ set_movetype(this, MOVETYPE_FLY);
if(!autocvar_g_nexball_sound_bounce)
this.noise = "";
missile.owner = actor;
- missile.movetype = MOVETYPE_FLY;
+ set_movetype(missile, MOVETYPE_FLY);
PROJECTILE_MAKETRIGGER(missile);
//setmodel(missile, "models/elaser.mdl"); // precision set below
setmodel(this.icon_realmodel, MDL_Null);
setorigin(this.icon_realmodel, this.origin);
setsize(this.icon_realmodel, CPICON_MIN, CPICON_MAX);
- this.icon_realmodel.movetype = MOVETYPE_NOCLIP;
+ this.icon_realmodel.move_movetype = MOVETYPE_NOCLIP;
this.icon_realmodel.solid = SOLID_NOT;
}
this.move_movetype = MOVETYPE_NOCLIP;
this.solid = SOLID_NOT;
- this.movetype = MOVETYPE_NOCLIP;
+ this.move_movetype = MOVETYPE_NOCLIP;
this.move_time = time;
this.drawmask = MASK_NORMAL;
this.alpha = 1;
setmodel(e, MDL_ONS_RAY);
setorigin(e, org);
e.angles = randomvec() * 360;
- e.movetype = MOVETYPE_NONE;
+ e.move_movetype = MOVETYPE_NONE;
e.alpha = 0;
e.scale = random() * 5 + 8;
e.move_time = time + 0.05;
this.move_movetype = MOVETYPE_NOCLIP;
this.solid = SOLID_BBOX;
- this.movetype = MOVETYPE_NOCLIP;
+ this.move_movetype = MOVETYPE_NOCLIP;
this.move_time = time;
this.drawmask = MASK_NORMAL;
this.alpha = 1;
settouch(shield, ons_CaptureShield_Touch);
setcefc(shield, ons_CaptureShield_Customize);
shield.effects = EF_ADDITIVE;
- shield.movetype = MOVETYPE_NOCLIP;
+ set_movetype(shield, MOVETYPE_NOCLIP);
shield.solid = SOLID_TRIGGER;
shield.avelocity = '7 0 11';
shield.scale = 1;
cp.netname = "Control point";
cp.team = 0;
cp.solid = SOLID_BBOX;
- cp.movetype = MOVETYPE_NONE;
+ set_movetype(cp, MOVETYPE_NONE);
settouch(cp, ons_ControlPoint_Touch);
setthink(cp, ons_ControlPoint_Think);
cp.nextthink = time + ONS_CP_THINKRATE;
if((cp.spawnflags & 1) || cp.noalign) // don't drop to floor, just stay at fixed location
{
cp.noalign = true;
- cp.movetype = MOVETYPE_NONE;
+ set_movetype(cp, MOVETYPE_NONE);
}
else // drop to floor, automatically find a platform and set that as spawn origin
{
setorigin(cp, cp.origin + '0 0 20');
cp.noalign = false;
droptofloor(cp);
- cp.movetype = MOVETYPE_TOSS;
+ set_movetype(cp, MOVETYPE_TOSS);
}
// waypointsprites
gen.classname = "onslaught_generator";
gen.solid = SOLID_BBOX;
gen.team_saved = teamnumber;
- gen.movetype = MOVETYPE_NONE;
+ set_movetype(gen, MOVETYPE_NONE);
gen.lasthealth = gen.max_health = gen.health = autocvar_g_onslaught_gen_health;
gen.takedamage = DAMAGE_AIM;
gen.bot_attack = true;
player.active_minigame = NULL;
player.minigame_players = NULL;
if ( IS_PLAYER(player) )
- player.movetype = MOVETYPE_WALK;
+ set_movetype(player, MOVETYPE_WALK);
else
- player.movetype = MOVETYPE_FLY_WORLDONLY;
+ set_movetype(player, MOVETYPE_FLY_WORLDONLY);
player.team_forced = 0;
}
missile.ltime = time + 7;
missile.nextthink = time;
missile.solid = SOLID_BBOX;
- missile.movetype = MOVETYPE_FLYMISSILE;
+ set_movetype(missile, MOVETYPE_FLYMISSILE);
missile.flags = FL_PROJECTILE;
setorigin(missile, this.origin + v_forward * 14 + '0 0 30' + v_right * -14);
setsize(missile, '0 0 0', '0 0 0');
this.event_damage = func_null;
this.takedamage = DAMAGE_NO;
- this.movetype = MOVETYPE_NONE;
+ set_movetype(this, MOVETYPE_NONE);
this.velocity = '0 0 0';
- if(this.movetype == MOVETYPE_NONE)
+ if(this.move_movetype == MOVETYPE_NONE)
this.velocity = this.oldvelocity;
RadiusDamage (this, this.realowner, (autocvar_g_monster_shambler_attack_lightning_damage), (autocvar_g_monster_shambler_attack_lightning_damage), (autocvar_g_monster_shambler_attack_lightning_radius),
gren.owner = gren.realowner = this;
gren.bot_dodge = true;
gren.bot_dodgerating = (autocvar_g_monster_shambler_attack_lightning_damage);
- gren.movetype = MOVETYPE_BOUNCE;
+ set_movetype(gren, MOVETYPE_BOUNCE);
PROJECTILE_MAKETRIGGER(gren);
gren.projectiledeathtype = DEATH_MONSTER_SHAMBLER_ZAP.m_id;
setorigin(gren, CENTER_OR_VIEWOFS(this));
//proj.glow_size = 50;
//proj.glow_color = 45;
- proj.movetype = MOVETYPE_BOUNCE;
+ set_movetype(proj, MOVETYPE_BOUNCE);
W_SetupProjVelocity_Explicit(proj, v_forward, v_up, (autocvar_g_monster_spider_attack_web_speed), (autocvar_g_monster_spider_attack_web_speed_up), 0, 0, false);
settouch(proj, M_Spider_Attack_Web_Touch);
setsize(proj, '-4 -4 -4', '4 4 4');
entity missile = spawn();
missile.owner = missile.realowner = actor;
missile.solid = SOLID_TRIGGER;
- missile.movetype = MOVETYPE_FLYMISSILE;
+ set_movetype(missile, MOVETYPE_FLYMISSILE);
missile.projectiledeathtype = DEATH_MONSTER_WYVERN.m_id;
setsize(missile, '-6 -6 -6', '6 6 6');
setorigin(missile, actor.origin + actor.view_ofs + v_forward * 14);
e.noalign = true;
e.monster_loot(e);
e.gravity = 1;
- e.movetype = MOVETYPE_TOSS;
+ set_movetype(e, MOVETYPE_TOSS);
e.reset = SUB_Remove;
setorigin(e, org);
e.velocity = randomvec() * 175 + '0 0 325';
}
- this.movetype = MOVETYPE_BOUNCE;
+ set_movetype(this, MOVETYPE_BOUNCE);
//this.velocity_z = -200;
return;
}
- else if(this.movetype == MOVETYPE_BOUNCE)
+ else if(this.move_movetype == MOVETYPE_BOUNCE)
{
this.angles_x = 0;
- this.movetype = MOVETYPE_WALK;
+ set_movetype(this, MOVETYPE_WALK);
}
}
this.takedamage = DAMAGE_AIM;
this.deadflag = DEAD_DEAD;
this.enemy = NULL;
- this.movetype = MOVETYPE_TOSS;
+ this.move_movetype = MOVETYPE_TOSS;
this.moveto = this.origin;
settouch(this, Monster_Touch); // reset incase monster was pouncing
this.reset = func_null;
settouch(this, Monster_Touch);
this.use = Monster_Use;
this.solid = SOLID_BBOX;
- this.movetype = MOVETYPE_WALK;
+ this.move_movetype = MOVETYPE_WALK;
this.spawnshieldtime = time + autocvar_g_monsters_spawnshieldtime;
this.enemy = NULL;
this.velocity = '0 0 0';
if(mon.spawnflags & MONSTER_TYPE_FLY)
{
this.flags |= FL_FLY;
- this.movetype = MOVETYPE_FLY;
+ set_movetype(this, MOVETYPE_FLY);
}
if(!(this.spawnflags & MONSTERFLAG_RESPAWNED))
setorigin(this, trace_endpos); // attempt to unstick
- this.movetype = MOVETYPE_TOSS;
+ set_movetype(this, MOVETYPE_TOSS);
makevectors(this.angles);
this.angles = '0 0 0';
this.reset = buff_Reset;
this.nextthink = time + 0.1;
this.gravity = 1;
- this.movetype = MOVETYPE_TOSS;
+ set_movetype(this, MOVETYPE_TOSS);
this.scale = 1;
this.skin = buff.m_skin;
this.effects = EF_FULLBRIGHT | EF_STARDUST | EF_NOSHADOW;
this.noalign = true;
if(this.noalign)
- this.movetype = MOVETYPE_NONE; // reset by random location
+ set_movetype(this, MOVETYPE_NONE); // reset by random location
setmodel(this, MDL_BUFF);
setsize(this, BUFF_MIN, BUFF_MAX);
}
this.velocity = (neworigin - this.origin) * (1.0 / PHYS_INPUT_TIMELENGTH);
- this.movetype = MOVETYPE_NOCLIP;
+ set_movetype(this, MOVETYPE_NOCLIP);
}
else
{
rigvel_z -= PHYS_INPUT_TIMELENGTH * PHYS_GRAVITY(this); // 4x gravity plays better
this.velocity = rigvel;
- this.movetype = MOVETYPE_FLY;
+ set_movetype(this, MOVETYPE_FLY);
}
trace_fraction = 1;
proj.maxs = '16 16 16';
}
proj.colormod = nade_type.m_color;
- proj.move_movetype = MOVETYPE_BOUNCE;
+ set_movetype(proj, MOVETYPE_BOUNCE);
settouch(proj, func_null);
proj.scale = 1.5;
proj.avelocity = randomvec() * 720;
proj.team = this.owner.team;
proj.bot_dodge = true;
proj.bot_dodgerating = autocvar_g_nades_napalm_ball_damage;
- proj.movetype = MOVETYPE_BOUNCE;
+ set_movetype(proj, MOVETYPE_BOUNCE);
proj.projectiledeathtype = DEATH_NADE_NAPALM.m_id;
PROJECTILE_MAKETRIGGER(proj);
setmodel(proj, MDL_Null);
fountain.ltime = time + autocvar_g_nades_napalm_fountain_lifetime;
fountain.pushltime = fountain.ltime;
fountain.team = this.team;
- fountain.movetype = MOVETYPE_TOSS;
+ set_movetype(fountain, MOVETYPE_TOSS);
fountain.projectiledeathtype = DEATH_NADE_NAPALM.m_id;
fountain.bot_dodge = true;
fountain.bot_dodgerating = autocvar_g_nades_napalm_fountain_damage;
fountain.ltime = time + autocvar_g_nades_ice_freeze_time;
fountain.pushltime = fountain.wait = fountain.ltime;
fountain.team = this.team;
- fountain.movetype = MOVETYPE_TOSS;
+ set_movetype(fountain, MOVETYPE_TOSS);
fountain.projectiledeathtype = DEATH_NADE_ICE.m_id;
fountain.bot_dodge = false;
setsize(fountain, '-16 -16 -16', '16 16 16');
entity spawnloc = spawn();
setorigin(spawnloc, this.origin);
setsize(spawnloc, this.realowner.mins, this.realowner.maxs);
- spawnloc.movetype = MOVETYPE_NONE;
+ set_movetype(spawnloc, MOVETYPE_NONE);
spawnloc.solid = SOLID_NOT;
spawnloc.drawonlytoclient = this.realowner;
spawnloc.effects = EF_STARDUST;
setsize(_nade, '-8 -8 -8', '8 8 8');
else
setsize(_nade, '-16 -16 -16', '16 16 16');
- _nade.movetype = MOVETYPE_BOUNCE;
+ set_movetype(_nade, MOVETYPE_BOUNCE);
tracebox(_nade.origin, _nade.mins, _nade.maxs, _nade.origin, false, _nade);
if (trace_startsolid)
e.draw = orb_draw;
e.health = 255;
- e.movetype = MOVETYPE_NONE;
+ e.move_movetype = MOVETYPE_NONE;
e.solid = SOLID_NOT;
e.drawmask = MASK_NORMAL;
e.scale = 0.01;
e.spawnfunc_checked = true;
spawnfunc_item_armor_small(e);
if (!wasfreed(e)) { // might have been blocked by a mutator
- e.movetype = MOVETYPE_TOSS;
+ set_movetype(e, MOVETYPE_TOSS);
e.gravity = 1;
e.reset = SUB_Remove;
setorigin(e, this.origin + '0 0 32');
missile.health = WEP_CVAR(rpc, health);
missile.event_damage = W_RocketPropelledChainsaw_Damage;
missile.damagedbycontents = true;
- missile.movetype = MOVETYPE_FLY;
+ set_movetype(missile, MOVETYPE_FLY);
missile.projectiledeathtype = WEP_RPC.m_id;
setsize (missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
this.angles = this.spawn_angles;
this.solid = SOLID_NOT;
this.alpha = -1;
- this.movetype = MOVETYPE_NONE;
+ set_movetype(this, MOVETYPE_NONE);
}
else
{
this.alpha = 1;
this.solid = SOLID_CORPSE;
- this.movetype = MOVETYPE_PHYSICS;
+ set_movetype(this, MOVETYPE_PHYSICS);
}
}
}
wep.owner = item;
wep.solid = SOLID_CORPSE;
- wep.movetype = MOVETYPE_PHYSICS;
+ set_movetype(wep, MOVETYPE_PHYSICS);
wep.takedamage = DAMAGE_AIM;
wep.effects |= EF_NOMODELFLAGS; // disable the spinning
wep.colormap = item.owner.colormap;
wep.spawn_angles = item.angles;
item.effects |= EF_NODRAW; // hide the original weapon
- item.movetype = MOVETYPE_FOLLOW;
+ set_movetype(item, MOVETYPE_FOLLOW);
item.aiment = wep; // attach the original weapon
setSendEntity(item, func_null);
}
sandbox_ObjectAttach_Remove(e);
e.old_solid = e.solid; // persist solidity
- e.old_movetype = e.movetype; // persist physics
- e.movetype = MOVETYPE_FOLLOW;
+ e.old_movetype = e.move_movetype; // persist physics
+ set_movetype(e, MOVETYPE_FOLLOW);
e.solid = SOLID_NOT;
e.takedamage = DAMAGE_NO;
it.angles = e.angles; // don't allow detached objects to spin or roll
it.solid = it.old_solid; // restore persisted solidity
- it.movetype = it.old_movetype; // restore persisted physics
+ set_movetype(it, it.old_movetype); // restore persisted physics
it.takedamage = DAMAGE_AIM;
});
}
e.takedamage = DAMAGE_AIM;
e.damageforcescale = 1;
e.solid = SOLID_BBOX; // SOLID_BSP would be best, but can lag the server badly
- e.movetype = MOVETYPE_TOSS;
+ set_movetype(e, MOVETYPE_TOSS);
e.frame = 0;
e.skin = 0;
e.material = string_null;
{
slot = 0;
solidity = head.solid; // applied solidity is normal solidity for children
- physics = head.movetype; // applied physics are normal physics for parents
+ physics = head.move_movetype; // applied physics are normal physics for parents
}
else if(head.owner == e) // child object, list them in order
{
e.frame = stof(argv(argv_num)); ++argv_num;
sandbox_ObjectEdit_Scale(e, stof(argv(argv_num))); ++argv_num;
e.solid = e.old_solid = stof(argv(argv_num)); ++argv_num;
- e.movetype = e.old_movetype = stof(argv(argv_num)); ++argv_num;
+ e.old_movetype = stof(argv(argv_num)); ++argv_num;
+ set_movetype(e, e.old_movetype);
e.damageforcescale = stof(argv(argv_num)); ++argv_num;
if(e.material) strunzone(e.material); if(argv(argv_num) != "") e.material = strzone(argv(argv_num)); else e.material = string_null; ++argv_num;
if(database)
switch(argv(3))
{
case "0": // static
- e.movetype = MOVETYPE_NONE;
+ set_movetype(e, MOVETYPE_NONE);
break;
case "1": // movable
- e.movetype = MOVETYPE_TOSS;
+ set_movetype(e, MOVETYPE_TOSS);
break;
case "2": // physical
- e.movetype = MOVETYPE_PHYSICS;
+ set_movetype(e, MOVETYPE_PHYSICS);
break;
default:
break;
#include <server/autocvars.qh>
#endif
+#ifdef SVQC
+void set_movetype(entity this, int mt)
+{
+ if(mt == MOVETYPE_PHYSICS || mt == MOVETYPE_PUSH || mt == MOVETYPE_FAKEPUSH)
+ {
+ this.movetype = this.move_movetype = mt; // we still set move_movetype, for other code that checks movetype
+ this.move_qcphysics = false;
+ return;
+ }
+
+ this.move_movetype = mt;
+
+ if(!this.move_qcphysics)
+ this.movetype = mt;
+}
+#elif defined(CSQC)
+void set_movetype(entity this, int mt)
+{
+ this.move_movetype = mt;
+}
+#endif
+
void _Movetype_WallFriction(entity this, vector stepnormal) // SV_WallFriction
{
/*float d, i;
}
}
+void Movetype_Physics_NoMatchTicrate(entity this, float movedt, bool isclient) // to be run every move frame
+{
+ this.move_time = time;
+
+ if(isclient)
+ _Movetype_Physics_ClientFrame(this, movedt);
+ else
+ _Movetype_Physics_Frame(this, movedt);
+ if(wasfreed(this))
+ return;
+
+ setorigin(this, this.origin);
+}
+
void Movetype_Physics_NoMatchServer(entity this) // optimized
{
float movedt = time - this.move_time;
.float bouncefactor;
#endif
+#ifdef SVQC
+.bool move_qcphysics;
+#endif
+
+void set_movetype(entity this, int mt);
+
.float move_movetype;
.float move_time;
//.vector move_origin;
float _Movetype_PushEntity(entity this, vector push, float failonstartsolid);
void makevectors_matrix(vector myangles);
+void Movetype_Physics_NoMatchTicrate(entity this, float movedt, bool isclient);
void Movetype_Physics_MatchTicrate(entity this, float tr, bool sloppy);
void Movetype_Physics_MatchServer(entity this, bool sloppy);
void Movetype_Physics_NoMatchServer(entity this);
if (!allowed_to_move)
{
this.velocity = '0 0 0';
- this.movetype = MOVETYPE_NONE;
+ set_movetype(this, MOVETYPE_NONE);
this.disableclientprediction = 2;
}
else if (this.disableclientprediction == 2)
{
- if (this.movetype == MOVETYPE_NONE)
- this.movetype = MOVETYPE_WALK;
+ if (this.move_movetype == MOVETYPE_NONE)
+ set_movetype(this, MOVETYPE_WALK);
this.disableclientprediction = 0;
}
}
#endif
#ifdef SVQC
- if (this.movetype == MOVETYPE_NONE)
+ if (this.move_movetype == MOVETYPE_NONE)
return;
// when we get here, disableclientprediction cannot be 2
- this.disableclientprediction = 0;
+ this.disableclientprediction = -1;
#endif
viewloc_PlayerPhysics(this);
{ }
#ifdef SVQC
- else if (this.movetype == MOVETYPE_NOCLIP || this.movetype == MOVETYPE_FLY || this.movetype == MOVETYPE_FLY_WORLDONLY || MUTATOR_CALLHOOK(IsFlying, this))
+ else if (this.move_movetype == MOVETYPE_NOCLIP || this.move_movetype == MOVETYPE_FLY || this.move_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
#endif
{
PM_Main(this);
+
+#ifdef SVQC
+ this.pm_frametime = frametime;
+#endif
}
// Client/server mappings
+.float pm_frametime;
+
.entity conveyor;
.float race_penalty;
{
this.reset = SUB_Remove;
// it's a dropped weapon
- this.movetype = MOVETYPE_TOSS;
+ set_movetype(this, MOVETYPE_TOSS);
// Savage: remove thrown items after a certain period of time ("garbage collection")
setthink(this, RemoveItem);
if(this.spawnflags & 1)
this.noalign = 1;
if (this.noalign > 0)
- this.movetype = MOVETYPE_NONE;
+ set_movetype(this, MOVETYPE_NONE);
else
- this.movetype = MOVETYPE_TOSS;
+ set_movetype(this, MOVETYPE_TOSS);
// do item filtering according to game mode and other things
if (this.noalign <= 0)
{
dbr.skin = this.debrisskin;
dbr.colormap = this.colormap; // inherit team colors
dbr.owner = this; // do not be affected by our own explosion
- dbr.movetype = this.debrismovetype;
+ set_movetype(dbr, this.debrismovetype);
dbr.solid = this.debrissolid;
if(dbr.solid != SOLID_BSP) // SOLID_BSP has exact collision, MAYBE this works? TODO check this out
setsize(dbr, '0 0 0', '0 0 0'); // needed for performance, until engine can deal better with it
{
SetMovedir(this);
InitMovingBrushTrigger(this);
- this.movetype = MOVETYPE_NONE;
+ set_movetype(this, MOVETYPE_NONE);
conveyor_init(this);
}
this.draw = conveyor_draw;
this.drawmask = MASK_NORMAL;
- this.movetype = MOVETYPE_NONE;
+ this.move_movetype = MOVETYPE_NONE;
this.model = "";
this.solid = SOLID_TRIGGER;
this.move_time = time;
vector t1 = fmins, t2 = fmaxs;
trigger = new(doortriggerfield);
- trigger.movetype = MOVETYPE_NONE;
+ set_movetype(trigger, MOVETYPE_NONE);
trigger.solid = SOLID_TRIGGER;
trigger.owner = this;
#ifdef SVQC
this.SUB_LTIME = ReadCoord();
this.solid = SOLID_BSP;
- this.movetype = MOVETYPE_PUSH;
+ this.move_movetype = MOVETYPE_PUSH;
this.use = door_use;
LinkDoors(this);
this.classname = "plat";
this.solid = SOLID_BSP;
- this.movetype = MOVETYPE_PUSH;
+ this.move_movetype = MOVETYPE_PUSH;
this.drawmask = MASK_NORMAL;
this.draw = plat_draw;
this.use = plat_use;
if (!this.dest)
this.dest = '0 0 -700';
this.angles = '0 0 0';
- this.movetype = MOVETYPE_NONE;
+ set_movetype(this, MOVETYPE_NONE);
this.solid = SOLID_NOT;
SetBrushEntityModel(this);
if (!this.cnt)
if (!this.dest)
this.dest = '0 0 -300';
this.angles = '0 0 0';
- this.movetype = MOVETYPE_NONE;
+ set_movetype(this, MOVETYPE_NONE);
this.solid = SOLID_NOT;
SetBrushEntityModel(this);
if (!this.cnt)
this.classname = "func_train";
this.solid = SOLID_BSP;
- this.movetype = MOVETYPE_PUSH;
+ this.move_movetype = MOVETYPE_PUSH;
this.drawmask = MASK_NORMAL;
this.draw = train_draw;
this.entremove = trigger_remove_generic;
{
if(this.spawnflags & 2)
{
- dst.movetype = MOVETYPE_FOLLOW;
+ set_movetype(dst, MOVETYPE_FOLLOW);
dst.aiment = src;
// dst.punchangle = '0 0 0'; // keep unchanged
dst.view_ofs = dst.origin;
trigger = spawn();
settouch(trigger, plat_center_touch);
- trigger.movetype = MOVETYPE_NONE;
+ set_movetype(trigger, MOVETYPE_NONE);
trigger.solid = SOLID_TRIGGER;
trigger.enemy = this;
{
++n;
#ifdef SVQC
- if(e.movetype == MOVETYPE_NONE)
+ if(e.move_movetype == MOVETYPE_NONE)
waypoint_spawnforteleporter(this, e.origin, 0);
if(e.classname != "info_teleport_destination")
LOG_INFO("^3MAPPER ERROR: teleporter does target an invalid teleport destination entity. Angles will not work.\n");
if (toucher.flags & FL_PROJECTILE)
{
toucher.angles = vectoangles (toucher.velocity);
- switch(toucher.movetype)
+ switch(toucher.move_movetype)
{
case MOVETYPE_FLY:
- toucher.movetype = MOVETYPE_TOSS;
+ set_movetype(toucher, MOVETYPE_TOSS);
toucher.gravity = 1;
break;
case MOVETYPE_BOUNCEMISSILE:
- toucher.movetype = MOVETYPE_BOUNCE;
+ set_movetype(toucher, MOVETYPE_BOUNCE);
toucher.gravity = 1;
break;
}
setsize(e, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL));
e.velocity = trigger_push_calculatevelocity(org, t, this.height);
tracetoss(e, e);
- if(e.movetype == MOVETYPE_NONE)
+ if(e.move_movetype == MOVETYPE_NONE)
waypoint_spawnforteleporter(this, trace_endpos, vlen(trace_endpos - org) / vlen(e.velocity));
remove(e);
#endif
this.health = 255;
this.solid = SOLID_BBOX;
this.tur_head.solid = SOLID_NOT;
- this.movetype = MOVETYPE_NOCLIP;
- this.tur_head.movetype = MOVETYPE_NOCLIP;
+ this.move_movetype = MOVETYPE_NOCLIP;
+ this.tur_head.move_movetype = MOVETYPE_NOCLIP;
this.draw = turret_draw;
this.entremove = turret_remove;
this.drawmask = MASK_NORMAL;
if(this.aim_flags & TFL_AIM_ZPREDICT)
if(!IS_ONGROUND(this.enemy))
- if(this.enemy.movetype == MOVETYPE_WALK || this.enemy.movetype == MOVETYPE_TOSS || this.enemy.movetype == MOVETYPE_BOUNCE)
+ if(this.enemy.move_movetype == MOVETYPE_WALK || this.enemy.move_movetype == MOVETYPE_TOSS || this.enemy.move_movetype == MOVETYPE_BOUNCE)
{
float vz;
prep_z = pre_pos_z;
setthink(proj, turret_projectile_explode);
settouch(proj, turret_projectile_touch);
proj.nextthink = time + 9;
- proj.movetype = MOVETYPE_FLYMISSILE;
+ proj.move_movetype = MOVETYPE_FLYMISSILE;
proj.velocity = normalize(actor.tur_shotdir_updated + randomvec() * actor.shot_spread) * actor.shot_speed;
proj.flags = FL_PROJECTILE;
proj.enemy = actor.enemy;
this.ammo_recharge *= this.ticrate;
this.solid = SOLID_BBOX;
this.takedamage = DAMAGE_AIM;
- this.movetype = MOVETYPE_NOCLIP;
+ this.move_movetype = MOVETYPE_NOCLIP;
this.view_ofs = '0 0 0';
this.turret_firecheckfunc = turret_firecheck;
this.event_damage = turret_damage;
this.tur_head.owner = this;
this.tur_head.takedamage = DAMAGE_NO;
this.tur_head.solid = SOLID_NOT;
- this.tur_head.movetype = this.movetype;
+ this.tur_head.move_movetype = this.move_movetype;
if(!this.tur_defend)
if(this.target != "")
{
entity e;
- if(it.movetype == MOVETYPE_WALK)
+ if(it.move_movetype == MOVETYPE_WALK)
{
it.velocity = '0 0 0';
it.enemy = NULL;
it.iscreature = true;
it.teleportable = TELEPORT_NORMAL;
it.damagedbycontents = true;
- it.movetype = MOVETYPE_WALK;
+ it.move_movetype = MOVETYPE_WALK;
it.solid = SOLID_SLIDEBOX;
it.takedamage = DAMAGE_AIM;
it.idle_aim = '0 0 0';
METHOD(EWheel, tr_setup, void(EWheel this, entity it))
{
it.gravity = 1;
- it.movetype = MOVETYPE_BOUNCE;
+ it.move_movetype = MOVETYPE_BOUNCE;
it.move_movetype = MOVETYPE_BOUNCE;
it.move_time = time;
it.draw = ewheel_draw;
setthink(missile, turret_hk_missile_think);
missile.nextthink = time + 0.25;
- missile.movetype = MOVETYPE_BOUNCEMISSILE;
+ set_movetype(missile, MOVETYPE_BOUNCEMISSILE);
missile.velocity = actor.tur_shotdir_updated * (actor.shot_speed * 0.75);
missile.angles = vectoangles(missile.velocity);
missile.cnt = time + 30;
{
this.cnt = time + 0.25;
this.nextthink = 0;
- this.movetype = MOVETYPE_BOUNCE;
+ this.move_movetype = MOVETYPE_BOUNCE;
return;
}
beam.owner = actor;
beam.shot_dmg = actor.shot_dmg / (actor.shot_speed / beam.ticrate);
beam.scale = actor.target_range / 256;
- beam.movetype = MOVETYPE_NONE;
+ set_movetype(beam, MOVETYPE_NONE);
beam.enemy = actor.enemy;
beam.bot_dodge = true;
beam.bot_dodgerating = beam.shot_dmg;
rocket.event_damage = walker_rocket_damage;
rocket.nextthink = time;
- rocket.movetype = MOVETYPE_FLY;
+ rocket.move_movetype = MOVETYPE_FLY;
rocket.velocity = normalize((v_forward + v_up * 0.5) + (randomvec() * 0.2)) * (autocvar_g_turrets_unit_walker_rocket_speed);
rocket.angles = vectoangles(rocket.velocity);
settouch(rocket, walker_rocket_touch);
entity e;
// Respawn is called & first spawn to, to set team. need to make sure we do not move the initial spawn.
- if(it.movetype == MOVETYPE_WALK)
+ if(it.move_movetype == MOVETYPE_WALK)
{
if(it.pos1)
setorigin(it, it.pos1);
it.damagedbycontents = true;
it.solid = SOLID_SLIDEBOX;
it.takedamage = DAMAGE_AIM;
- if(it.movetype != MOVETYPE_WALK)
+ if(it.move_movetype != MOVETYPE_WALK)
{
setorigin(it, it.origin);
tracebox(it.origin + '0 0 128', it.mins, it.maxs, it.origin - '0 0 10000', MOVE_NORMAL, it);
it.pos1 = it.origin;
it.pos2 = it.angles;
}
- it.movetype = MOVETYPE_WALK;
+ set_movetype(it, MOVETYPE_WALK);
it.idle_aim = '0 0 0';
it.turret_firecheckfunc = walker_firecheck;
entity err = new(error_marker);
setmodel(err, MDL_MARKER);
setorigin(err, where);
- err.movetype = MOVETYPE_NONE;
+ set_movetype(err, MOVETYPE_NONE);
setthink(err, marker_think);
err.nextthink = time;
err.skin = 0;
entity err = spawn(info_marker);
setmodel(err, MDL_MARKER);
setorigin(err, where);
- err.movetype = MOVETYPE_NONE;
+ set_movetype(err, MOVETYPE_NONE);
setthink(err, marker_think);
err.nextthink = time;
err.skin = 1;
entity err = spawn(mark_misc);
setmodel(err, MDL_MARKER);
setorigin(err, where);
- err.movetype = MOVETYPE_NONE;
+ set_movetype(err, MOVETYPE_NONE);
setthink(err, marker_think);
err.nextthink = time;
err.skin = 3;
//setattachment(e,onwho,"");
setorigin(e, onwho.origin + '0 0 1');
e.alpha = 0.15;
- e.movetype = MOVETYPE_FLY;
+ set_movetype(e, MOVETYPE_FLY);
e.velocity = (v_color * 32); // + '0 0 1' * 64;
setorigin(e, onwho.origin + '0 0 1');
e.alpha = 0.15;
- e.movetype = MOVETYPE_FLY;
+ set_movetype(e, MOVETYPE_FLY);
e.velocity = (v_color * 32); // + '0 0 1' * 64;
e.avelocity_x = -128;
e.scale = (f_size/512);
setsize(e, '0 0 0', '0 0 0');
setorigin(e, where + '0 0 1');
- e.movetype = MOVETYPE_NONE;
+ set_movetype(e, MOVETYPE_NONE);
e.velocity = '0 0 0';
e.colormod = v_color;
SUB_SetFade(e,time,f_time);
proj.shot_force = _force;
proj.totalfrags = _deahtype;
proj.solid = SOLID_BBOX;
- proj.movetype = MOVETYPE_FLYMISSILE;
+ proj.move_movetype = MOVETYPE_FLYMISSILE;
proj.flags = FL_PROJECTILE;
proj.bot_dodge = true;
proj.bot_dodgerating = _dmg;
vector org = gettaginfo(this, gettagindex(this, _tag));
setorigin(_gib, org);
_gib.velocity = _vel;
- _gib.movetype = MOVETYPE_TOSS;
+ set_movetype(_gib, MOVETYPE_TOSS);
_gib.solid = SOLID_CORPSE;
_gib.colormod = '-0.5 -0.5 -0.5';
_gib.effects = EF_LOWPRECISION;
player.takedamage = DAMAGE_AIM;
player.solid = SOLID_SLIDEBOX;
- player.movetype = MOVETYPE_WALK;
+ player.move_movetype = MOVETYPE_WALK;
player.effects &= ~EF_NODRAW;
player.teleportable = TELEPORT_NORMAL;
player.alpha = 1;
pl.angles = veh.angles;
pl.takedamage = DAMAGE_NO;
pl.solid = SOLID_NOT;
- pl.movetype = MOVETYPE_NOCLIP;
+ pl.move_movetype = MOVETYPE_NOCLIP;
pl.teleportable = false;
pl.alpha = -1;
pl.event_damage = func_null;
this.iscreature = true;
this.teleportable = false; // no teleporting for vehicles, too buggy
this.damagedbycontents = true;
- this.movetype = MOVETYPE_WALK;
+ this.move_movetype = MOVETYPE_WALK;
this.solid = SOLID_SLIDEBOX;
this.takedamage = DAMAGE_AIM;
this.deadflag = DEAD_NO;
gun.enemy = NULL;
if(trace_ent)
- if(trace_ent.movetype)
+ if(trace_ent.move_movetype)
if(trace_ent.takedamage)
if(!IS_DEAD(trace_ent) && !STAT(FROZEN, trace_ent))
{
vector vf = real_origin(gun.enemy);
vector _vel = gun.enemy.velocity;
- if(gun.enemy.movetype == MOVETYPE_WALK)
+ if(gun.enemy.move_movetype == MOVETYPE_WALK)
_vel.z *= 0.1;
player.takedamage = DAMAGE_AIM;
player.solid = SOLID_SLIDEBOX;
- player.movetype = MOVETYPE_WALK;
+ player.move_movetype = MOVETYPE_WALK;
player.effects &= ~EF_NODRAW;
player.alpha = 1;
player.PlayerPhysplug = func_null;
player.takedamage = DAMAGE_NO;
player.solid = SOLID_NOT;
player.alpha = -1;
- player.movetype = MOVETYPE_NOCLIP;
+ player.move_movetype = MOVETYPE_NOCLIP;
player.event_damage = func_null;
player.view_ofs = '0 0 0';
player.hud = gunner.hud;
vehic.tur_head.enemy = NULL;
if(trace_ent)
- if(trace_ent.movetype)
+ if(trace_ent.move_movetype)
if(trace_ent.takedamage)
if(!IS_DEAD(trace_ent) && !STAT(FROZEN, trace_ent))
{
this.nextthink = time;
}
- this.movetype = MOVETYPE_TOSS;
+ set_movetype(this, MOVETYPE_TOSS);
if(!this.owner)
return;
{
settouch(instance, bumblebee_touch);
instance.nextthink = 0;
- instance.movetype = MOVETYPE_BOUNCEMISSILE;
+ set_movetype(instance, MOVETYPE_BOUNCEMISSILE);
}
METHOD(Bumblebee, vr_gunner_enter, void(Bumblebee thisveh, entity instance, entity actor))
{
instance.solid = SOLID_NOT;
instance.takedamage = DAMAGE_NO;
instance.deadflag = DEAD_DYING;
- instance.movetype = MOVETYPE_NONE;
+ instance.move_movetype = MOVETYPE_NONE;
instance.effects = EF_NODRAW;
instance.colormod = '0 0 0';
instance.avelocity = '0 0 0';
instance.vehicle_health = autocvar_g_vehicle_bumblebee_health;
instance.vehicle_shield = autocvar_g_vehicle_bumblebee_shield;
instance.solid = SOLID_BBOX;
- instance.movetype = MOVETYPE_TOSS;
+ set_movetype(instance, MOVETYPE_TOSS);
instance.damageforcescale = 0.025;
instance.PlayerPhysplug = bumblebee_pilot_frame;
setthink(this, racer_think);
this.nextthink = time;
- this.movetype = MOVETYPE_BOUNCE;
+ this.move_movetype = MOVETYPE_BOUNCE;
sound (this.tur_head, CH_TRIGGER_SINGLE, SND_Null, VOL_VEHICLEENGINE, ATTEN_NORM);
if(!this.owner)
this.nextthink = time + autocvar_g_vehicle_racer_respawntime;
setthink(this, vehicles_spawn);
- this.movetype = MOVETYPE_NONE;
+ this.move_movetype = MOVETYPE_NONE;
this.effects = EF_NODRAW;
this.solid = SOLID_NOT;
METHOD(Racer, vr_enter, void(Racer thisveh, entity instance))
{
#ifdef SVQC
- instance.movetype = MOVETYPE_BOUNCE;
+ set_movetype(instance, MOVETYPE_BOUNCE);
instance.owner.vehicle_health = (instance.vehicle_health / autocvar_g_vehicle_racer_health) * 100;
instance.owner.vehicle_shield = (instance.vehicle_shield / autocvar_g_vehicle_racer_shield) * 100;
instance.vehicle_health = autocvar_g_vehicle_racer_health;
instance.vehicle_shield = autocvar_g_vehicle_racer_shield;
- instance.movetype = MOVETYPE_TOSS;
+ instance.move_movetype = MOVETYPE_TOSS;
instance.solid = SOLID_SLIDEBOX;
instance.delay = time;
instance.scale = 0.5;
instance.solid = SOLID_CORPSE;
instance.takedamage = DAMAGE_NO;
instance.deadflag = DEAD_DYING;
- instance.movetype = MOVETYPE_BOUNCE;
+ instance.move_movetype = MOVETYPE_BOUNCE;
instance.wait = time;
instance.delay = 2 + time + random() * 3;
instance.cnt = 1 + random() * 2;
if(hgt < 16)
{
- this.movetype = MOVETYPE_TOSS;
+ set_movetype(this, MOVETYPE_TOSS);
setthink(this, vehicles_think);
this.frame = 0;
}
vehic.gun1.enemy = NULL;
if(trace_ent)
- if(trace_ent.movetype)
+ if(trace_ent.move_movetype)
if(trace_ent.takedamage)
if(!IS_DEAD(trace_ent) && !STAT(FROZEN, trace_ent))
{
vf = real_origin(vehic.gun1.enemy);
UpdateAuxiliaryXhair(this, vf, '1 0 0', 1);
vector _vel = vehic.gun1.enemy.velocity;
- if(vehic.gun1.enemy.movetype == MOVETYPE_WALK)
+ if(vehic.gun1.enemy.move_movetype == MOVETYPE_WALK)
_vel_z *= 0.1;
if(autocvar_g_vehicle_raptor_cannon_predicttarget)
RadiusDamage (this, this.enemy, 250, 15, 250, NULL, NULL, 250, DEATH_VH_RAPT_DEATH.m_id, NULL);
this.alpha = -1;
- this.movetype = MOVETYPE_NONE;
+ this.move_movetype = MOVETYPE_NONE;
this.effects = EF_NODRAW;
this.colormod = '0 0 0';
this.avelocity = '0 0 0';
{
instance.vehicle_weapon2mode = RSM_BOMB;
instance.owner.PlayerPhysplug = raptor_takeoff;
- instance.movetype = MOVETYPE_BOUNCEMISSILE;
+ instance.move_movetype = MOVETYPE_BOUNCEMISSILE;
instance.solid = SOLID_SLIDEBOX;
instance.owner.vehicle_health = (instance.vehicle_health / autocvar_g_vehicle_raptor_health) * 100;
instance.owner.vehicle_shield = (instance.vehicle_shield / autocvar_g_vehicle_raptor_shield) * 100;
instance.solid = SOLID_CORPSE;
instance.takedamage = DAMAGE_NO;
instance.deadflag = DEAD_DYING;
- instance.movetype = MOVETYPE_BOUNCE;
+ instance.move_movetype = MOVETYPE_BOUNCE;
setthink(instance, raptor_diethink);
instance.nextthink = time;
instance.wait = time + 5 + (random() * 5);
spinner.owner = instance;
setmodel(spinner, MDL_VEH_RAPTOR_PROP);
setattachment(spinner, instance, "engine_left");
- spinner.movetype = MOVETYPE_NOCLIP;
+ set_movetype(spinner, MOVETYPE_NOCLIP);
spinner.avelocity = '0 90 0';
instance.bomb1.gun1 = spinner;
spinner.owner = instance;
setmodel(spinner, MDL_VEH_RAPTOR_PROP);
setattachment(spinner, instance, "engine_right");
- spinner.movetype = MOVETYPE_NOCLIP;
+ set_movetype(spinner, MOVETYPE_NOCLIP);
spinner.avelocity = '0 -90 0';
instance.bomb1.gun2 = spinner;
instance.frame = 0;
instance.vehicle_health = autocvar_g_vehicle_raptor_health;
instance.vehicle_shield = autocvar_g_vehicle_raptor_shield;
- instance.movetype = MOVETYPE_TOSS;
+ instance.move_movetype = MOVETYPE_TOSS;
instance.solid = SOLID_SLIDEBOX;
instance.vehicle_energy = 1;
_flare.effects = EF_LOWPRECISION | EF_FLAME;
_flare.scale = 0.5;
setorigin(_flare, actor.origin - '0 0 16');
- _flare.movetype = MOVETYPE_TOSS;
+ set_movetype(_flare, MOVETYPE_TOSS);
_flare.gravity = 0.15;
_flare.velocity = 0.25 * actor.velocity + (v_forward + randomvec() * 0.25)* -500;
setthink(_flare, raptor_flare_think);
bomblet = spawn();
setorigin(bomblet, this.origin);
- bomblet.movetype = MOVETYPE_TOSS;
+ bomblet.move_movetype = MOVETYPE_TOSS;
settouch(bomblet, raptor_bomblet_touch);
setthink(bomblet, raptor_bomblet_boom);
bomblet.nextthink = time + 5;
org = gettaginfo(this, gettagindex(this, "bombmount_right"));
setorigin(bomb_2, org);
- bomb_1.movetype = bomb_2.movetype = MOVETYPE_BOUNCE;
+ bomb_1.move_movetype = bomb_2.move_movetype = MOVETYPE_BOUNCE;
bomb_1.velocity = bomb_2.velocity = this.velocity;
settouch(bomb_1, raptor_bomb_touch);
settouch(bomb_2, raptor_bomb_touch);
setmodel(sfrag, MDL_VEH_RAPTOR_CB_FRAGMENT);
setorigin(sfrag, _org);
- sfrag.move_movetype = MOVETYPE_BOUNCE;
+ set_movetype(sfrag, MOVETYPE_BOUNCE);
sfrag.gravity = 0.15;
sfrag.solid = SOLID_CORPSE;
setthink(this, vehicles_think);
this.nextthink = time;
this.frame = 5;
- this.movetype = MOVETYPE_WALK;
+ set_movetype(this, MOVETYPE_WALK);
if(!this.owner)
return;
vector org = gettaginfo(this, gettagindex(this, "tag_head"));
setorigin(h, org);
- h.movetype = MOVETYPE_BOUNCE;
+ set_movetype(h, MOVETYPE_BOUNCE);
h.solid = SOLID_BBOX;
h.velocity = v_up * (500 + random() * 500) + randomvec() * 128;
h.modelflags = MF_ROCKET;
org = gettaginfo(this.tur_head, gettagindex(this.tur_head, "tag_hardpoint01"));
setorigin(g1, org);
- g1.movetype = MOVETYPE_TOSS;
+ set_movetype(g1, MOVETYPE_TOSS);
g1.solid = SOLID_CORPSE;
g1.velocity = v_forward * 700 + (randomvec() * 32);
g1.avelocity = randomvec() * 180;
org = gettaginfo(this.tur_head, gettagindex(this.tur_head, "tag_hardpoint02"));
setorigin(g2, org);
- g2.movetype = MOVETYPE_TOSS;
+ set_movetype(g2, MOVETYPE_TOSS);
g2.solid = SOLID_CORPSE;
g2.velocity = v_forward * 700 + (randomvec() * 32);
g2.avelocity = randomvec() * 180;
RadiusDamage (this, this.enemy, 250, 15, 250, NULL, NULL, 250, DEATH_VH_SPID_DEATH.m_id, NULL);
this.alpha = this.tur_head.alpha = this.gun1.alpha = this.gun2.alpha = -1;
- this.movetype = MOVETYPE_NONE;
+ set_movetype(this, MOVETYPE_NONE);
this.deadflag = DEAD_DEAD;
this.solid = SOLID_NOT;
this.tur_head.effects &= ~EF_FLAME;
METHOD(Spiderbot, vr_enter, void(Spiderbot thisveh, entity instance))
{
instance.vehicle_weapon2mode = SBRM_GUIDE;
- instance.movetype = MOVETYPE_WALK;
+ set_movetype(instance, MOVETYPE_WALK);
CSQCVehicleSetup(instance.owner, 0);
instance.owner.vehicle_health = (instance.vehicle_health / autocvar_g_vehicle_spiderbot_health) * 100;
instance.owner.vehicle_shield = (instance.vehicle_shield / autocvar_g_vehicle_spiderbot_shield) * 100;
instance.tur_head.effects |= EF_FLAME;
instance.colormod = instance.tur_head.colormod = '-1 -1 -1';
instance.frame = 10;
- instance.movetype = MOVETYPE_TOSS;
+ set_movetype(instance, MOVETYPE_TOSS);
CSQCModel_UnlinkEntity(instance); // networking the death scene would be a nightmare
}
instance.frame = 5;
instance.tur_head.frame = 1;
- instance.movetype = MOVETYPE_WALK;
+ set_movetype(instance, MOVETYPE_WALK);
instance.solid = SOLID_SLIDEBOX;
instance.alpha = instance.tur_head.alpha = instance.gun1.alpha = instance.gun2.alpha = 1;
instance.tur_head.angles = '0 0 0';
float h2 = 0.75 * vlen(rocket.pos1 - v);
rocket.velocity = spiberbot_calcartillery(v, rocket.pos1, ((h1 < h2) ? h1 : h2));
- rocket.movetype = MOVETYPE_TOSS;
+ rocket.move_movetype = MOVETYPE_TOSS;
rocket.gravity = 1;
//setthink(rocket, spiderbot_rocket_artillery);
break;
setorigin(missile, w_shotorg);
setsize(missile, '0 0 0', '0 0 0');
- missile.movetype = MOVETYPE_FLY;
+ set_movetype(missile, MOVETYPE_FLY);
W_SetupProjVelocity_PRE(missile, arc, bolt_);
missile.angles = vectoangles(missile.velocity);
beam.solid = SOLID_NOT;
setthink(beam, W_Arc_Beam_Think);
beam.owner = actor;
- beam.movetype = MOVETYPE_NONE;
+ set_movetype(beam, MOVETYPE_NONE);
beam.bot_dodge = true;
beam.bot_dodgerating = WEP_CVAR(arc, beam_damage);
beam.beam_bursting = burst;
void W_Blaster_Think(entity this)
{
- this.movetype = MOVETYPE_FLY;
+ set_movetype(this, MOVETYPE_FLY);
setthink(this, SUB_Remove);
this.nextthink = time + this.blaster_lifetime;
CSQCProjectile(this, true, PROJECTILE_BLASTER, true);
prevproj = proj;
- proj.movetype = MOVETYPE_BOUNCEMISSILE;
+ set_movetype(proj, MOVETYPE_BOUNCEMISSILE);
PROJECTILE_MAKETRIGGER(proj);
proj.projectiledeathtype = WEP_CRYLINK.m_id;
//proj.gravity = 0.001;
prevproj = proj;
- proj.movetype = MOVETYPE_BOUNCEMISSILE;
+ set_movetype(proj, MOVETYPE_BOUNCEMISSILE);
PROJECTILE_MAKETRIGGER(proj);
proj.projectiledeathtype = WEP_CRYLINK.m_id | HITTYPE_SECONDARY;
//proj.gravity = 0.001;
missile.event_damage = W_Devastator_Damage;
missile.damagedbycontents = true;
- missile.movetype = MOVETYPE_FLY;
+ set_movetype(missile, MOVETYPE_FLY);
PROJECTILE_MAKETRIGGER(missile);
missile.projectiledeathtype = WEP_DEVASTATOR.m_id;
setsize(missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
this.event_damage = func_null;
this.takedamage = DAMAGE_NO;
- if(this.movetype == MOVETYPE_BOUNCE)
+ if(this.move_movetype == MOVETYPE_BOUNCE)
{
RadiusDamage(
this,
proj.projectiledeathtype = WEP_ELECTRO.m_id;
setorigin(proj, w_shotorg);
- proj.movetype = MOVETYPE_FLY;
+ set_movetype(proj, MOVETYPE_FLY);
W_SetupProjVelocity_PRI(proj, electro);
proj.angles = vectoangles(proj.velocity);
settouch(proj, W_Electro_TouchExplode);
//proj.glow_size = 50;
//proj.glow_color = 45;
- proj.movetype = MOVETYPE_BOUNCE;
+ set_movetype(proj, MOVETYPE_BOUNCE);
W_SetupProjVelocity_UP_SEC(proj, electro);
settouch(proj, W_Electro_Orb_Touch);
setsize(proj, '0 0 -4', '0 0 -4');
proj.projectiledeathtype = WEP_FIREBALL.m_id;
setorigin(proj, w_shotorg);
- proj.movetype = MOVETYPE_FLY;
+ set_movetype(proj, MOVETYPE_FLY);
W_SetupProjVelocity_PRI(proj, fireball);
proj.angles = vectoangles(proj.velocity);
settouch(proj, W_Fireball_TouchExplode);
proj.owner = proj.realowner = actor;
proj.bot_dodge = true;
proj.bot_dodgerating = WEP_CVAR_SEC(fireball, damage);
- proj.movetype = MOVETYPE_BOUNCE;
+ set_movetype(proj, MOVETYPE_BOUNCE);
proj.projectiledeathtype = WEP_FIREBALL.m_id | HITTYPE_SECONDARY;
settouch(proj, W_Fireball_Firemine_Touch);
PROJECTILE_MAKETRIGGER(proj);
setorigin(missile, w_shotorg);
setsize(missile, '0 0 0', '0 0 0');
- missile.movetype = MOVETYPE_FLY;
+ set_movetype(missile, MOVETYPE_FLY);
W_SetupProjVelocity_PRI(missile, hagar);
missile.angles = vectoangles(missile.velocity);
setorigin(missile, w_shotorg);
setsize(missile, '0 0 0', '0 0 0');
- missile.movetype = MOVETYPE_BOUNCEMISSILE;
+ set_movetype(missile, MOVETYPE_BOUNCEMISSILE);
W_SetupProjVelocity_SEC(missile, hagar);
missile.angles = vectoangles(missile.velocity);
missile.projectiledeathtype = WEP_HAGAR.m_id | HITTYPE_SECONDARY;
setorigin(missile, w_shotorg);
setsize(missile, '0 0 0', '0 0 0');
- missile.movetype = MOVETYPE_FLY;
+ set_movetype(missile, MOVETYPE_FLY);
missile.missile_flags = MIF_SPLASH;
// per-shot spread calculation: the more shots there are, the less spread is applied (based on the bias cvar)
missile.bot_dodgerating = WEP_CVAR_PRI(hlac, damage);
- missile.movetype = MOVETYPE_FLY;
+ set_movetype(missile, MOVETYPE_FLY);
PROJECTILE_MAKETRIGGER(missile);
setorigin(missile, w_shotorg);
missile.bot_dodgerating = WEP_CVAR_SEC(hlac, damage);
- missile.movetype = MOVETYPE_FLY;
+ set_movetype(missile, MOVETYPE_FLY);
PROJECTILE_MAKETRIGGER(missile);
setorigin(missile, w_shotorg);
this.dmg_duration = WEP_CVAR_SEC(hook, duration);
this.teleport_time = time;
this.dmg_last = 1;
- this.movetype = MOVETYPE_NONE;
+ set_movetype(this, MOVETYPE_NONE);
}
void W_Hook_Explode2_use(entity this, entity actor, entity trigger)
gren.owner = gren.realowner = actor;
gren.bot_dodge = true;
gren.bot_dodgerating = WEP_CVAR_SEC(hook, damage);
- gren.movetype = MOVETYPE_TOSS;
+ set_movetype(gren, MOVETYPE_TOSS);
PROJECTILE_MAKETRIGGER(gren);
gren.projectiledeathtype = WEP_HOOK.m_id | HITTYPE_SECONDARY;
setorigin(gren, w_shotorg);
newmine.spawnshieldtime = this.spawnshieldtime;
newmine.damagedbycontents = true;
- newmine.movetype = MOVETYPE_NONE; // lock the mine in place
+ set_movetype(newmine, MOVETYPE_NONE); // lock the mine in place
newmine.projectiledeathtype = this.projectiledeathtype;
newmine.mine_time = this.mine_time;
this.event_damage = func_null;
this.takedamage = DAMAGE_NO;
- if(this.movetype == MOVETYPE_NONE || this.movetype == MOVETYPE_FOLLOW)
+ if(this.move_movetype == MOVETYPE_NONE || this.move_movetype == MOVETYPE_FOLLOW)
this.velocity = this.mine_orientation; // particle fx and decals need .velocity
RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, remote_damage), WEP_CVAR(minelayer, remote_edgedamage), WEP_CVAR(minelayer, remote_radius), NULL, NULL, WEP_CVAR(minelayer, remote_force), this.projectiledeathtype | HITTYPE_BOUNCE, NULL);
this.nextthink = time;
- if(this.movetype == MOVETYPE_FOLLOW)
+ if(this.move_movetype == MOVETYPE_FOLLOW)
{
if(LostMovetypeFollow(this))
{
UnsetMovetypeFollow(this);
- this.movetype = MOVETYPE_NONE;
+ set_movetype(this, MOVETYPE_NONE);
}
}
void W_MineLayer_Touch(entity this, entity toucher)
{
- if(this.movetype == MOVETYPE_NONE || this.movetype == MOVETYPE_FOLLOW)
+ if(this.move_movetype == MOVETYPE_NONE || this.move_movetype == MOVETYPE_FOLLOW)
return; // we're already a stuck mine, why do we get called? TODO does this even happen?
if(WarpZone_Projectile_Touch(this, toucher))
mine.event_damage = W_MineLayer_Damage;
mine.damagedbycontents = true;
- mine.movetype = MOVETYPE_TOSS;
+ set_movetype(mine, MOVETYPE_TOSS);
PROJECTILE_MAKETRIGGER(mine);
mine.projectiledeathtype = WEP_MINE_LAYER.m_id;
setsize(mine, '-4 -4 -4', '4 4 4'); // give it some size so it can be shot
this.event_damage = func_null;
this.takedamage = DAMAGE_NO;
- if(this.movetype == MOVETYPE_NONE)
+ if(this.move_movetype == MOVETYPE_NONE)
this.velocity = this.oldvelocity;
RadiusDamage(this, this.realowner, WEP_CVAR_PRI(mortar, damage), WEP_CVAR_PRI(mortar, edgedamage), WEP_CVAR_PRI(mortar, radius), NULL, NULL, WEP_CVAR_PRI(mortar, force), this.projectiledeathtype, directhitentity);
this.event_damage = func_null;
this.takedamage = DAMAGE_NO;
- if(this.movetype == MOVETYPE_NONE)
+ if(this.move_movetype == MOVETYPE_NONE)
this.velocity = this.oldvelocity;
RadiusDamage(this, this.realowner, WEP_CVAR_SEC(mortar, damage), WEP_CVAR_SEC(mortar, edgedamage), WEP_CVAR_SEC(mortar, radius), NULL, NULL, WEP_CVAR_SEC(mortar, force), this.projectiledeathtype, directhitentity);
this.projectiledeathtype |= HITTYPE_BOUNCE;
this.gl_bouncecnt += 1;
}
- else if(WEP_CVAR_PRI(mortar, type) == 2 && (!toucher || (toucher.takedamage != DAMAGE_AIM && toucher.movetype == MOVETYPE_NONE))) // stick
+ else if(WEP_CVAR_PRI(mortar, type) == 2 && (!toucher || (toucher.takedamage != DAMAGE_AIM && toucher.move_movetype == MOVETYPE_NONE))) // stick
{
spamsound(this, CH_SHOTS, SND(GRENADE_STICK), VOL_BASE, ATTN_NORM);
// let it stick whereever it is
this.oldvelocity = this.velocity;
this.velocity = '0 0 0';
- this.movetype = MOVETYPE_NONE; // also disables gravity
+ set_movetype(this, MOVETYPE_NONE); // also disables gravity
this.gravity = 0; // nope, it does NOT! maybe a bug in CSQC code? TODO
UpdateCSQCProjectile(this);
this.nextthink = time + WEP_CVAR_SEC(mortar, lifetime_bounce);
}
- else if(WEP_CVAR_SEC(mortar, type) == 2 && (!toucher || (toucher.takedamage != DAMAGE_AIM && toucher.movetype == MOVETYPE_NONE))) // stick
+ else if(WEP_CVAR_SEC(mortar, type) == 2 && (!toucher || (toucher.takedamage != DAMAGE_AIM && toucher.move_movetype == MOVETYPE_NONE))) // stick
{
spamsound(this, CH_SHOTS, SND(GRENADE_STICK), VOL_BASE, ATTN_NORM);
// let it stick whereever it is
this.oldvelocity = this.velocity;
this.velocity = '0 0 0';
- this.movetype = MOVETYPE_NONE; // also disables gravity
+ set_movetype(this, MOVETYPE_NONE); // also disables gravity
this.gravity = 0; // nope, it does NOT! maybe a bug in CSQC code? TODO
UpdateCSQCProjectile(this);
gren.owner = gren.realowner = actor;
gren.bot_dodge = true;
gren.bot_dodgerating = WEP_CVAR_PRI(mortar, damage);
- gren.movetype = MOVETYPE_BOUNCE;
+ set_movetype(gren, MOVETYPE_BOUNCE);
gren.bouncefactor = WEP_CVAR(mortar, bouncefactor);
gren.bouncestop = WEP_CVAR(mortar, bouncestop);
PROJECTILE_MAKETRIGGER(gren);
gren.owner = gren.realowner = actor;
gren.bot_dodge = true;
gren.bot_dodgerating = WEP_CVAR_SEC(mortar, damage);
- gren.movetype = MOVETYPE_BOUNCE;
+ set_movetype(gren, MOVETYPE_BOUNCE);
gren.bouncefactor = WEP_CVAR(mortar, bouncefactor);
gren.bouncestop = WEP_CVAR(mortar, bouncestop);
PROJECTILE_MAKETRIGGER(gren);
gren.playerid = actor.playerid;
gren.bot_dodge = true;
gren.bot_dodgerating = 200;
- gren.movetype = MOVETYPE_BOUNCEMISSILE;
+ set_movetype(gren, MOVETYPE_BOUNCEMISSILE);
PROJECTILE_MAKETRIGGER(gren);
gren.effects = EF_RED;
gren.scale = 4;
this.nextthink = time;// + cvar("g_balance_seeker_missile_activate_delay"); // cant dealy with csqc projectiles
if(autocvar_g_balance_seeker_missile_proxy)
- this.movetype = MOVETYPE_BOUNCEMISSILE;
+ this.move_movetype = MOVETYPE_BOUNCEMISSILE;
else
- this.movetype = MOVETYPE_FLYMISSILE;
+ this.move_movetype = MOVETYPE_FLYMISSILE;
}
UpdateCSQCProjectile(this);
setorigin(missile, w_shotorg);
setsize(missile, '-4 -4 -4', '4 4 4');
- missile.movetype = MOVETYPE_FLYMISSILE;
+ missile.move_movetype = MOVETYPE_FLYMISSILE;
missile.flags = FL_PROJECTILE;
missile.missile_flags = MIF_SPLASH | MIF_GUIDED_TAG;
setthink(missile, adaptor_think2use_hittype_splash);
missile.nextthink = time + WEP_CVAR(seeker, flac_lifetime) + WEP_CVAR(seeker, flac_lifetime_rand);
missile.solid = SOLID_BBOX;
- missile.movetype = MOVETYPE_FLY;
+ missile.move_movetype = MOVETYPE_FLY;
missile.projectiledeathtype = WEP_SEEKER.m_id;
missile.projectiledeathtype = WEP_SEEKER.m_id | HITTYPE_SECONDARY;
missile.flags = FL_PROJECTILE;
settouch(missile, W_Seeker_Tag_Touch);
setthink(missile, SUB_Remove);
missile.nextthink = time + WEP_CVAR(seeker, tag_lifetime);
- missile.movetype = MOVETYPE_FLY;
+ missile.move_movetype = MOVETYPE_FLY;
missile.solid = SOLID_BBOX;
missile.takedamage = DAMAGE_YES;
missile.flags = FL_PROJECTILE;
//missile.missile_flags = MIF_..?;
- missile.movetype = MOVETYPE_FLY;
+ missile.move_movetype = MOVETYPE_FLY;
W_SetupProjVelocity_PRE(missile, seeker, tag_);
missile.angles = vectoangles(missile.velocity);
//W_SetupProjectileVelocity(proj, autocvar_g_rm_laser_speed, spread * (rndspread ? random() : 1) * autocvar_g_rm_laser_speed);
- proj.movetype = MOVETYPE_BOUNCEMISSILE;
+ set_movetype(proj, MOVETYPE_BOUNCEMISSILE);
//W_SETUPPROJECTILEVELOCITY(proj, g_balance_minstanex_laser);
proj.velocity = (w_shotdir + (((counter + 0.5) / total) * 2 - 1) * v_right * (spread * (rndspread ? random() : 1))) * cvar("g_rm_laser_speed");
proj.velocity_z = proj.velocity_z + cvar("g_rm_laser_zspread") * (random() - 0.5);
//W_SetupProjectileVelocity(proj, autocvar_g_rm_laser_speed, spread * (rndspread ? random() : 1) * autocvar_g_rm_laser_speed);
- proj.movetype = MOVETYPE_BOUNCEMISSILE;
+ set_movetype(proj, MOVETYPE_BOUNCEMISSILE);
proj.velocity = w_shotdir * autocvar_g_rm_laser_speed;
proj.velocity = W_CalculateProjectileVelocity(actor, actor.velocity, proj.velocity, true);
proj.angles = vectoangles(proj.velocity);
return;
// FIXME needs a better check to know what is safe to teleport and what not
- if((toucher.movetype == MOVETYPE_NONE && toucher.move_movetype == MOVETYPE_NONE) || toucher.movetype == MOVETYPE_FOLLOW || toucher.move_movetype == MOVETYPE_FOLLOW || toucher.tag_entity
+ if((toucher.move_movetype == MOVETYPE_NONE && toucher.move_movetype == MOVETYPE_NONE) || toucher.move_movetype == MOVETYPE_FOLLOW || toucher.move_movetype == MOVETYPE_FOLLOW || toucher.tag_entity
#ifdef CSQC
|| tag_networkentity
#endif
setsize(this, this.mins * this.scale, this.maxs * this.scale);
else
setsize(this, this.mins, this.maxs);
- this.movetype = MOVETYPE_NONE;
+ set_movetype(this, MOVETYPE_NONE);
this.solid = SOLID_TRIGGER;
this.model = "";
}
if (!tracetossfaketarget)
tracetossfaketarget = new(tracetossfaketarget);
tracetossfaketarget.solid = savesolid;
- tracetossfaketarget.movetype = targ.movetype;
+ set_movetype(tracetossfaketarget, targ.move_movetype);
_setmodel(tracetossfaketarget, targ.model); // no low precision
tracetossfaketarget.model = targ.model;
tracetossfaketarget.modelindex = targ.modelindex;
// make it disappear
tracetossfaketarget.solid = SOLID_NOT;
- tracetossfaketarget.movetype = MOVETYPE_NONE;
+ set_movetype(tracetossfaketarget, MOVETYPE_NONE);
tracetossfaketarget.model = "";
tracetossfaketarget.modelindex = 0;
// relink to remove it from physics considerations
// make it disappear
tracetossfaketarget.solid = SOLID_NOT;
- tracetossfaketarget.movetype = MOVETYPE_NONE;
+ set_movetype(tracetossfaketarget, MOVETYPE_NONE);
tracetossfaketarget.model = "";
tracetossfaketarget.modelindex = 0;
// relink to remove it from physics considerations
break;
case CHIMPULSE_TELEPORT.impulse:
IS_CHEAT(this, imp, 0, 0);
- if(this.movetype == MOVETYPE_NOCLIP)
+ if(this.move_movetype == MOVETYPE_NOCLIP)
{
e = find(NULL, classname, "info_autoscreenshot");
if(e)
break;
case "noclip":
IS_CHEAT(this, 0, argc, 0);
- if(this.movetype != MOVETYPE_NOCLIP)
+ if(this.move_movetype != MOVETYPE_NOCLIP)
{
- this.movetype = MOVETYPE_NOCLIP;
+ set_movetype(this, MOVETYPE_NOCLIP);
sprint(this, "noclip ON\n");
DID_CHEAT();
}
else
{
- this.movetype = MOVETYPE_WALK;
+ set_movetype(this, MOVETYPE_WALK);
sprint(this, "noclip OFF\n");
}
break;
case "fly":
IS_CHEAT(this, 0, argc, 0);
- if(this.movetype != MOVETYPE_FLY)
+ if(this.move_movetype != MOVETYPE_FLY)
{
- this.movetype = MOVETYPE_FLY;
+ set_movetype(this, MOVETYPE_FLY);
sprint(this, "flymode ON\n");
DID_CHEAT();
}
else
{
- this.movetype = MOVETYPE_WALK;
+ set_movetype(this, MOVETYPE_WALK);
sprint(this, "flymode OFF\n");
}
break;
{
float tagscale;
- draggee.dragmovetype = draggee.movetype;
+ draggee.dragmovetype = draggee.move_movetype;
draggee.draggravity = draggee.gravity;
- draggee.movetype = MOVETYPE_WALK;
+ set_movetype(draggee, MOVETYPE_WALK);
draggee.gravity = 0.00001;
UNSET_ONGROUND(draggee);
draggee.draggedby = dragger;
if(dragger)
dragger.dragentity = NULL;
draggee.draggedby = NULL;
- draggee.movetype = draggee.dragmovetype;
+ set_movetype(draggee, draggee.dragmovetype);
draggee.gravity = draggee.draggravity;
- switch(draggee.movetype)
+ switch(draggee.move_movetype)
{
case MOVETYPE_TOSS:
case MOVETYPE_WALK:
this.health = FRAGS_SPECTATOR;
this.takedamage = DAMAGE_NO;
this.solid = SOLID_NOT;
- this.movetype = MOVETYPE_FLY_WORLDONLY; // user preference is controlled by playerprethink
+ set_movetype(this, MOVETYPE_FLY_WORLDONLY); // user preference is controlled by playerprethink
this.flags = FL_CLIENT | FL_NOTARGET;
this.armorvalue = 666;
this.effects = 0;
this.iscreature = true;
this.teleportable = TELEPORT_NORMAL;
this.damagedbycontents = true;
- this.movetype = MOVETYPE_WALK;
+ set_movetype(this, MOVETYPE_WALK);
this.solid = SOLID_SLIDEBOX;
this.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_SOLID;
if (autocvar_g_playerclip_collisions)
{
this.solid = SOLID_NOT;
this.takedamage = DAMAGE_NO;
- this.movetype = MOVETYPE_FLY;
+ set_movetype(this, MOVETYPE_FLY);
this.velocity = '0 0 1' * autocvar_g_respawn_ghosts_speed;
this.avelocity = randomvec() * autocvar_g_respawn_ghosts_speed * 3 - randomvec() * autocvar_g_respawn_ghosts_speed * 3;
this.effects |= CSQCMODEL_EF_RESPAWNGHOST;
msg_entity = this;
WriteByte(MSG_ONE, SVC_SETVIEW);
WriteEntity(MSG_ONE, this.enemy);
- this.movetype = MOVETYPE_NONE;
+ set_movetype(this, MOVETYPE_NONE);
accuracy_resend(this);
if(!SpectateUpdate(this))
MinigameImpulse(this, this.impulse);
this.impulse = 0;
}
- float prefered_movetype;
if (this.flags & FL_JUMPRELEASED) {
if (PHYS_INPUT_BUTTON_JUMP(this) && !this.version_mismatch) {
this.flags &= ~FL_JUMPRELEASED;
TRANSMUTE(Spectator, this);
}
} else {
- prefered_movetype = ((!PHYS_INPUT_BUTTON_USE(this) ? this.cvar_cl_clippedspectating : !this.cvar_cl_clippedspectating) ? MOVETYPE_FLY_WORLDONLY : MOVETYPE_NOCLIP);
- if (this.movetype != prefered_movetype)
- this.movetype = prefered_movetype;
+ int preferred_movetype = ((!PHYS_INPUT_BUTTON_USE(this) ? this.cvar_cl_clippedspectating : !this.cvar_cl_clippedspectating) ? MOVETYPE_FLY_WORLDONLY : MOVETYPE_NOCLIP);
+ set_movetype(this, preferred_movetype);
}
} else {
if (!(PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_JUMP(this))) {
}
}
+void Player_Physics(entity this)
+{
+ this.movetype = ((this.move_qcphysics) ? MOVETYPE_NONE : this.move_movetype);
+
+ if(!this.move_qcphysics)
+ return;
+
+ int mt = this.move_movetype;
+
+ if(mt == MOVETYPE_PUSH || mt == MOVETYPE_FAKEPUSH || mt == MOVETYPE_PHYSICS)
+ {
+ this.move_qcphysics = false;
+ this.movetype = mt;
+ return;
+ }
+
+ if(!frametime && !this.pm_frametime)
+ return;
+
+ Movetype_Physics_NoMatchTicrate(this, this.pm_frametime, true);
+
+ this.pm_frametime = 0;
+}
+
/*
=============
PlayerPostThink
.float idlekick_lasttimeleft;
void PlayerPostThink (entity this)
{
+ Player_Physics(this);
+
if (sv_maxidle > 0)
if (frametime) // WORKAROUND: only use dropclient in server frames (frametime set). Never use it in cl_movement frames (frametime zero).
if (IS_REAL_CLIENT(this))
clone.modelindex = this.modelindex;
clone.skin = this.skin;
clone.species = this.species;
- clone.movetype = this.movetype;
+ clone.move_qcphysics = false; // don't run gamecode logic on clones, too many
+ set_movetype(clone, this.move_movetype);
clone.solid = this.solid;
clone.ballistics_density = this.ballistics_density;
clone.takedamage = this.takedamage;
int animbits = deadbits;
if(STAT(FROZEN, this))
animbits |= ANIMSTATE_FROZEN;
- if(this.movetype == MOVETYPE_FOLLOW)
+ if(this.move_movetype == MOVETYPE_FOLLOW)
animbits |= ANIMSTATE_FOLLOW;
if(this.crouch)
animbits |= ANIMSTATE_DUCK;
// view from the floor
this.view_ofs = '0 0 -8';
// toss the corpse
- this.movetype = MOVETYPE_TOSS;
+ set_movetype(this, MOVETYPE_TOSS);
// shootable corpse
this.solid = SOLID_CORPSE;
this.ballistics_density = autocvar_g_ballistics_density_corpse;
if (!IS_PLAYER(targ) || time >= targ.spawnshieldtime || targ == attacker)
{
vector farce = damage_explosion_calcpush(targ.damageforcescale * force, targ.velocity, autocvar_g_balance_damagepush_speedfactor);
- if(targ.movetype == MOVETYPE_PHYSICS)
+ if(targ.move_movetype == MOVETYPE_PHYSICS)
{
entity farcent = new(farce);
farcent.enemy = targ;
return;
remove(pl.hook);
pl.hook = NULL;
- if(pl.movetype == MOVETYPE_FLY)
- pl.movetype = MOVETYPE_WALK;
+ if(pl.move_movetype == MOVETYPE_FLY)
+ set_movetype(pl, MOVETYPE_WALK);
//pl.disableclientprediction = false;
}
this.nextthink = time;
settouch(this, func_null);
this.velocity = '0 0 0';
- this.movetype = MOVETYPE_NONE;
+ set_movetype(this, MOVETYPE_NONE);
this.hook_length = -1;
}
this.hook_length = newlength;
}
- if(pull_entity.movetype == MOVETYPE_FLY)
- pull_entity.movetype = MOVETYPE_WALK;
+ if(pull_entity.move_movetype == MOVETYPE_FLY)
+ set_movetype(pull_entity, MOVETYPE_WALK);
if(this.realowner.hook_state & HOOK_RELEASING)
{
dv = ((v - v0) * dir) * dir;
if(tarzan >= 2)
{
- if(this.aiment.movetype == MOVETYPE_WALK || this.aiment.classname == "nade")
+ if(this.aiment.move_movetype == MOVETYPE_WALK || this.aiment.classname == "nade")
{
entity aim_ent = ((IS_VEHICLE(this.aiment) && this.aiment.owner) ? this.aiment.owner : this.aiment);
v = v - dv * 0.5;
if(spd < 50)
spd = 0;
this.realowner.velocity = dir*spd;
- this.realowner.movetype = MOVETYPE_FLY;
+ set_movetype(this.realowner, MOVETYPE_FLY);
UNSET_ONGROUND(this.realowner);
}
void GrapplingHookTouch(entity this, entity toucher)
{
- if(toucher.movetype == MOVETYPE_FOLLOW)
+ if(toucher.move_movetype == MOVETYPE_FOLLOW)
return;
PROJECTILE_TOUCH(this, toucher);
GrapplingHook_Stop(this);
if(toucher)
- if(toucher.movetype != MOVETYPE_NONE)
+ if(toucher.move_movetype != MOVETYPE_NONE)
{
SetMovetypeFollow(this, toucher);
WarpZone_RefSys_BeginAddingIncrementally(this, this.aiment);
missile.classname = "grapplinghook";
missile.flags = FL_PROJECTILE;
- missile.movetype = ((autocvar_g_balance_grapplehook_gravity) ? MOVETYPE_TOSS : MOVETYPE_FLY);
+ set_movetype(missile, ((autocvar_g_balance_grapplehook_gravity) ? MOVETYPE_TOSS : MOVETYPE_FLY));
PROJECTILE_MAKETRIGGER(missile);
//setmodel (missile, MDL_HOOK); // precision set below
objerror (this, "dynlight: no target to follow");
targ = find(NULL, targetname, this.target);
- this.movetype = MOVETYPE_FOLLOW;
+ set_movetype(this, MOVETYPE_FOLLOW);
this.aiment = targ;
this.owner = targ;
this.punchangle = targ.angles;
if (this.target)
// if (!(this.spawnflags & DFOLLOW))
{
- this.movetype = MOVETYPE_NOCLIP;
+ set_movetype(this, MOVETYPE_NOCLIP);
if (!this.speed)
this.speed = 100;
InitializeEntity(this, dynlight_find_path, INITPRIO_FINDTARGET);
#define G_MODEL_INIT(ent,sol) \
- if(ent.geomtype) if(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) ent.movetype = MOVETYPE_PHYSICS; \
+ if(ent.geomtype) if(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) set_movetype(ent, MOVETYPE_PHYSICS); \
if(!ent.scale) ent.scale = ent.modelscale; \
SetBrushEntityModel(ent); \
ent.use = g_model_setcolormaptoactivator; \
if(!ent.solid) ent.solid = (sol); else if(ent.solid < 0) ent.solid = SOLID_NOT;
#define G_CLIENTMODEL_INIT(ent,sol) \
- if(ent.geomtype) if(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) ent.movetype = MOVETYPE_PHYSICS; \
+ if(ent.geomtype) if(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) set_movetype(ent, MOVETYPE_PHYSICS); \
if(!ent.scale) ent.scale = ent.modelscale; \
SetBrushEntityModel(ent); \
ent.use = g_clientmodel_use; \
SetMovedir(this);
this.solid = SOLID_TRIGGER;
SetBrushEntityModel(this);
- this.movetype = MOVETYPE_NONE;
+ set_movetype(this, MOVETYPE_NONE);
this.modelindex = 0;
this.model = "";
}
SetMovedir(this);
this.solid = SOLID_BSP;
SetBrushEntityModel(this);
- this.movetype = MOVETYPE_NONE; // why was this PUSH? -div0
+ set_movetype(this, MOVETYPE_NONE); // why was this PUSH? -div0
// this.modelindex = 0;
this.model = "";
}
// to mean no restrictions, so use a yaw of 360 instead.
this.solid = SOLID_BSP;
SetBrushEntityModel(this);
- this.movetype = MOVETYPE_PUSH;
+ set_movetype(this, MOVETYPE_PUSH);
if(this.modelindex == 0)
{
objerror(this, "InitMovingBrushTrigger: no brushes found!");
e.health = -2342;
// first intermission phase; voting phase has positive health (used to decide whether to send SVC_FINALE or not)
e.solid = SOLID_NOT;
- e.movetype = MOVETYPE_NONE;
+ set_movetype(e, MOVETYPE_NONE);
e.takedamage = DAMAGE_NO;
for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
return "Map switch will happen after scoreboard.";
}
+bool autocvar_sv_freezenonclients;
+bool autocvar_sv_gameplayfix_delayprojectiles;
+void Physics_Frame()
+{
+ if(autocvar_sv_freezenonclients)
+ return;
+
+ FOREACH_ENTITY_FLOAT(pure_data, false,
+ {
+ if(IS_CLIENT(it) || it.classname == "" || it.movetype == MOVETYPE_PUSH || it.movetype == MOVETYPE_FAKEPUSH || it.movetype == MOVETYPE_PHYSICS)
+ continue;
+
+ int mt = it.move_movetype;
+
+ if(mt == MOVETYPE_PUSH || mt == MOVETYPE_FAKEPUSH || mt == MOVETYPE_PHYSICS)
+ {
+ it.move_qcphysics = false;
+ it.movetype = mt;
+ continue;
+ }
+
+ it.movetype = ((it.move_qcphysics) ? MOVETYPE_NONE : it.move_movetype);
+
+ if(it.move_movetype == MOVETYPE_NONE)
+ continue;
+
+ if(it.move_qcphysics)
+ Movetype_Physics_NoMatchTicrate(it, PHYS_INPUT_TIMELENGTH, false);
+ });
+
+ if(autocvar_sv_gameplayfix_delayprojectiles >= 0)
+ return;
+
+ FOREACH_ENTITY_FLOAT(move_qcphysics, true,
+ {
+ if(IS_CLIENT(it) || is_pure(it) || it.classname == "" || it.move_movetype == MOVETYPE_NONE)
+ continue;
+ Movetype_Physics_NoMatchTicrate(it, PHYS_INPUT_TIMELENGTH, false);
+ });
+}
void EndFrame()
{
anticheat_endframe();
+ Physics_Frame();
+
FOREACH_CLIENT(IS_REAL_CLIENT(it), {
entity e = IS_SPEC(it) ? it.enemy : it;
if (e.typehitsound) {
this.noalign = 1;
if (this.noalign)
- this.movetype = MOVETYPE_NONE;
+ set_movetype(this, MOVETYPE_NONE);
else
- this.movetype = MOVETYPE_TOSS;
+ set_movetype(this, MOVETYPE_TOSS);
precache_sound(this.noise);
void follow_sameorigin(entity e, entity to)
{
- e.movetype = MOVETYPE_FOLLOW; // make the hole follow
+ set_movetype(e, MOVETYPE_FOLLOW); // make the hole follow
e.aiment = to; // make the hole follow bmodel
e.punchangle = to.angles; // the original angles of bmodel
e.view_ofs = e.origin - to.origin; // relative origin
void unfollow_sameorigin(entity e)
{
- e.movetype = MOVETYPE_NONE;
+ set_movetype(e, MOVETYPE_NONE);
}
entity gettaginfo_relative_ent;
void SetMovetypeFollow(entity ent, entity e)
{
// FIXME this may not be warpzone aware
- ent.movetype = MOVETYPE_FOLLOW; // make the hole follow
+ set_movetype(ent, MOVETYPE_FOLLOW); // make the hole follow
ent.solid = SOLID_NOT; // MOVETYPE_FOLLOW is always non-solid - this means this cannot be teleported by warpzones any more! Instead, we must notice when our owner gets teleported.
ent.aiment = e; // make the hole follow bmodel
ent.punchangle = e.angles; // the original angles of bmodel
}
void UnsetMovetypeFollow(entity ent)
{
- ent.movetype = MOVETYPE_FLY;
+ set_movetype(ent, MOVETYPE_FLY);
PROJECTILE_MAKETRIGGER(ent);
ent.aiment = NULL;
}
float LostMovetypeFollow(entity ent)
{
/*
- if(ent.movetype != MOVETYPE_FOLLOW)
+ if(ent.move_movetype != MOVETYPE_FOLLOW)
if(ent.aiment)
error("???");
*/
settouch(shield, ctf_CaptureShield_Touch);
setcefc(shield, ctf_CaptureShield_Customize);
shield.effects = EF_ADDITIVE;
- shield.movetype = MOVETYPE_NOCLIP;
+ set_movetype(shield, MOVETYPE_NOCLIP);
shield.solid = SOLID_TRIGGER;
shield.avelocity = '7 0 11';
shield.scale = 0.5;
player = (player ? player : flag.pass_sender);
// main
- flag.movetype = MOVETYPE_TOSS;
+ set_movetype(flag, MOVETYPE_TOSS);
flag.takedamage = DAMAGE_YES;
flag.angles = '0 0 0';
flag.health = flag.max_flag_health;
setattachment(flag, player, "");
setorigin(flag, FLAG_CARRY_OFFSET);
}
- flag.movetype = MOVETYPE_NONE;
+ set_movetype(flag, MOVETYPE_NONE);
flag.takedamage = DAMAGE_NO;
flag.solid = SOLID_NOT;
flag.angles = '0 0 0';
ctf_CalculatePassVelocity(flag, targ_origin, player.origin, false);
// main
- flag.movetype = MOVETYPE_FLY;
+ set_movetype(flag, MOVETYPE_FLY);
flag.takedamage = DAMAGE_NO;
flag.pass_sender = player;
flag.pass_target = receiver;
}
// flag setup
- flag.movetype = MOVETYPE_NONE;
+ set_movetype(flag, MOVETYPE_NONE);
flag.takedamage = DAMAGE_NO;
flag.solid = SOLID_NOT;
flag.angles = '0 0 0';
if(pointcontents(midpoint + FLAG_FLOAT_OFFSET) == CONTENT_WATER)
{ this.velocity_z = autocvar_g_ctf_flag_dropped_floatinwater; }
else
- { this.movetype = MOVETYPE_FLY; }
+ { set_movetype(this, MOVETYPE_FLY); }
}
- else if(this.movetype == MOVETYPE_FLY) { this.movetype = MOVETYPE_TOSS; }
+ else if(this.move_movetype == MOVETYPE_FLY) { set_movetype(this, MOVETYPE_TOSS); }
}
if(autocvar_g_ctf_flag_return_dropped)
{
setattachment(flag, NULL, "");
setorigin(flag, flag.ctf_spawnorigin);
- flag.movetype = ((flag.noalign) ? MOVETYPE_NONE : MOVETYPE_TOSS);
+ set_movetype(flag, ((flag.noalign) ? MOVETYPE_NONE : MOVETYPE_TOSS));
flag.takedamage = DAMAGE_NO;
flag.health = flag.max_flag_health;
flag.solid = SOLID_TRIGGER;
{
flag.dropped_origin = flag.origin;
flag.noalign = true;
- flag.movetype = MOVETYPE_NONE;
+ set_movetype(flag, MOVETYPE_NONE);
}
else // drop to floor, automatically find a platform and set that as spawn origin
{
flag.noalign = false;
droptofloor(flag);
- flag.movetype = MOVETYPE_TOSS;
+ set_movetype(flag, MOVETYPE_NONE);
}
InitializeEntity(flag, ctf_DelayedFlagSetup, INITPRIO_SETLOCATION);
case FLAG_PASSING:
{
// lock the flag, game is over
- flag.movetype = MOVETYPE_NONE;
+ set_movetype(flag, MOVETYPE_NONE);
flag.takedamage = DAMAGE_NO;
flag.solid = SOLID_NOT;
flag.nextthink = false; // stop thinking
if(player.race_penalty)
{
player.velocity = '0 0 0';
- player.movetype = MOVETYPE_NONE;
+ set_movetype(player, MOVETYPE_NONE);
player.disableclientprediction = 2;
}
}
}
makevectors(this.angles);
- this.movetype = MOVETYPE_BOUNCE;
+ set_movetype(this, MOVETYPE_BOUNCE);
this.velocity = '0 0 200';
this.angles = '0 0 0';
this.effects = autocvar_g_keepawayball_effects;
// make the ball invisible/unable to do anything/set up time scoring
this.velocity = '0 0 0';
- this.movetype = MOVETYPE_NONE;
+ set_movetype(this, MOVETYPE_NONE);
this.effects |= EF_NODRAW;
settouch(this, func_null);
setthink(this, ka_TimeScoring);
// reset the ball
setattachment(ball, NULL, "");
- ball.movetype = MOVETYPE_BOUNCE;
+ set_movetype(ball, MOVETYPE_BOUNCE);
ball.wait = time + 1;
settouch(ball, ka_TouchEvent);
setthink(ball, ka_RespawnBall);
e.damageforcescale = autocvar_g_keepawayball_damageforcescale;
e.takedamage = DAMAGE_YES;
e.solid = SOLID_TRIGGER;
- e.movetype = MOVETYPE_BOUNCE;
+ set_movetype(e, MOVETYPE_BOUNCE);
e.glow_color = autocvar_g_keepawayball_trail_color;
e.glow_trail = true;
e.flags = FL_ITEM;
#endif
key.flags = 0;
key.solid = SOLID_NOT;
- key.movetype = MOVETYPE_NONE;
+ set_movetype(key, MOVETYPE_NONE);
key.team = key.owner.team;
key.nextthink = time;
key.damageforcescale = 0;
#endif
key.flags = FL_ITEM;
key.solid = SOLID_TRIGGER;
- key.movetype = MOVETYPE_TOSS;
+ set_movetype(key, MOVETYPE_TOSS);
key.pain_finished = time + autocvar_g_balance_keyhunt_delay_return;
key.damageforcescale = autocvar_g_balance_keyhunt_damageforcescale;
key.takedamage = DAMAGE_YES;
if(player.race_penalty)
{
player.velocity = '0 0 0';
- player.movetype = MOVETYPE_NONE;
+ set_movetype(player, MOVETYPE_NONE);
player.disableclientprediction = 2;
}
}
this.playerdemo_starttime = time - 1;
this.playerdemo_time = stof(fgets(this.playerdemo_fh));
this.playerdemo_time += this.playerdemo_starttime;
- this.movetype = MOVETYPE_NONE;
+ set_movetype(this, MOVETYPE_NONE);
LOG_INFO("playerdemo: ", this.netname, " reading from ", f, "\n");
}
void playerdemo_open_write(entity this, string f)
setthink(flocker, flocker_think);
flocker.nextthink = time + random() * 5;
PROJECTILE_MAKETRIGGER(flocker);
- flocker.movetype = MOVETYPE_BOUNCEMISSILE;
+ flocker.move_movetype = MOVETYPE_BOUNCEMISSILE;
flocker.effects = EF_LOWPRECISION;
flocker.velocity = randomvec() * 300;
flocker.angles = vectoangles(flocker.velocity);
this.enemy.scale = 3;
this.enemy.effects = EF_LOWPRECISION;
- this.enemy.movetype = MOVETYPE_BOUNCEMISSILE;
+ this.enemy.move_movetype = MOVETYPE_BOUNCEMISSILE;
PROJECTILE_MAKETRIGGER(this.enemy);
setthink(this.enemy, flocker_hunter_think);
this.enemy.nextthink = time + 10;
void CreatureFrame_All()
{
FOREACH_ENTITY_FLOAT(damagedbycontents, true, {
- if (it.movetype == MOVETYPE_NOCLIP) continue;
+ if (it.move_movetype == MOVETYPE_NOCLIP) continue;
CreatureFrame_Liquids(it);
CreatureFrame_FallDamage(it);
it.oldvelocity = it.velocity;
return;
}
+ this.move_movetype = this.movetype;
+
// support special -1 and -2 angle from radiant
if (this.angles == '0 -1 0')
this.angles = '-90 0 0';
e.csqcprojectile_clientanimate = clientanimate;
- if(e.movetype == MOVETYPE_TOSS || e.movetype == MOVETYPE_BOUNCE)
+ if(e.move_movetype == MOVETYPE_TOSS || e.move_movetype == MOVETYPE_BOUNCE)
{
if(e.gravity == 0)
e.gravity = 1;