From c4230403a60e672acde0b6dfa32ca67f56879183 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 23 Jul 2016 22:02:26 +1000 Subject: [PATCH] Implement move_qcphysics --- qcsrc/client/csqc_constants.qh | 2 +- qcsrc/client/main.qc | 2 +- qcsrc/common/csqcmodel_settings.qh | 2 +- qcsrc/common/debug.qh | 2 +- .../gamemodes/gamemode/nexball/nexball.qc | 14 +++--- .../gamemode/onslaught/cl_controlpoint.qc | 4 +- .../gamemode/onslaught/cl_generator.qc | 4 +- .../gamemodes/gamemode/onslaught/onslaught.qc | 10 ++--- qcsrc/common/minigames/sv_minigames.qc | 4 +- qcsrc/common/monsters/monster/mage.qc | 2 +- qcsrc/common/monsters/monster/shambler.qc | 6 +-- qcsrc/common/monsters/monster/spider.qc | 2 +- qcsrc/common/monsters/monster/wyvern.qc | 2 +- qcsrc/common/monsters/sv_monsters.qc | 14 +++--- qcsrc/common/mutators/mutator/buffs/buffs.qc | 6 +-- .../mutators/mutator/bugrigs/bugrigs.qc | 4 +- qcsrc/common/mutators/mutator/nades/nades.qc | 12 ++--- qcsrc/common/mutators/mutator/nades/net.qc | 2 +- .../mutators/mutator/overkill/overkill.qc | 2 +- qcsrc/common/mutators/mutator/overkill/rpc.qc | 2 +- .../mutator/physical_items/physical_items.qc | 8 ++-- .../mutators/mutator/sandbox/sandbox.qc | 19 ++++---- qcsrc/common/physics/movetypes/movetypes.qc | 36 +++++++++++++++ qcsrc/common/physics/movetypes/movetypes.qh | 7 +++ qcsrc/common/physics/player.qc | 16 ++++--- qcsrc/common/physics/player.qh | 2 + qcsrc/common/t_items.qc | 6 +-- qcsrc/common/triggers/func/breakable.qc | 2 +- qcsrc/common/triggers/func/conveyor.qc | 4 +- qcsrc/common/triggers/func/door.qc | 4 +- qcsrc/common/triggers/func/plat.qc | 2 +- qcsrc/common/triggers/func/rainsnow.qc | 4 +- qcsrc/common/triggers/func/train.qc | 2 +- qcsrc/common/triggers/misc/follow.qc | 2 +- qcsrc/common/triggers/platforms.qc | 2 +- qcsrc/common/triggers/teleporters.qc | 2 +- qcsrc/common/triggers/trigger/jumppads.qc | 8 ++-- qcsrc/common/turrets/cl_turrets.qc | 4 +- qcsrc/common/turrets/sv_turrets.qc | 8 ++-- qcsrc/common/turrets/turret/ewheel.qc | 6 +-- qcsrc/common/turrets/turret/hk_weapon.qc | 4 +- qcsrc/common/turrets/turret/phaser_weapon.qc | 2 +- qcsrc/common/turrets/turret/walker.qc | 8 ++-- qcsrc/common/turrets/util.qc | 12 ++--- qcsrc/common/vehicles/sv_vehicles.qc | 10 ++--- qcsrc/common/vehicles/vehicle/bumblebee.qc | 18 ++++---- qcsrc/common/vehicles/vehicle/racer.qc | 10 ++--- qcsrc/common/vehicles/vehicle/raptor.qc | 18 ++++---- .../common/vehicles/vehicle/raptor_weapons.qc | 8 ++-- qcsrc/common/vehicles/vehicle/spiderbot.qc | 16 +++---- .../vehicles/vehicle/spiderbot_weapons.qc | 2 +- qcsrc/common/weapons/weapon/arc.qc | 4 +- qcsrc/common/weapons/weapon/blaster.qc | 2 +- qcsrc/common/weapons/weapon/crylink.qc | 4 +- qcsrc/common/weapons/weapon/devastator.qc | 2 +- qcsrc/common/weapons/weapon/electro.qc | 6 +-- qcsrc/common/weapons/weapon/fireball.qc | 4 +- qcsrc/common/weapons/weapon/hagar.qc | 6 +-- qcsrc/common/weapons/weapon/hlac.qc | 4 +- qcsrc/common/weapons/weapon/hook.qc | 4 +- qcsrc/common/weapons/weapon/minelayer.qc | 12 ++--- qcsrc/common/weapons/weapon/mortar.qc | 16 +++---- qcsrc/common/weapons/weapon/porto.qc | 2 +- qcsrc/common/weapons/weapon/seeker.qc | 12 ++--- qcsrc/common/weapons/weapon/vaporizer.qc | 4 +- qcsrc/lib/warpzone/server.qc | 2 +- qcsrc/lib/warpzone/util_server.qc | 2 +- qcsrc/server/bot/aim.qc | 6 +-- qcsrc/server/cheats.qc | 22 +++++----- qcsrc/server/cl_client.qc | 40 +++++++++++++---- qcsrc/server/cl_player.qc | 7 +-- qcsrc/server/g_damage.qc | 2 +- qcsrc/server/g_hook.qc | 20 ++++----- qcsrc/server/g_lights.qc | 4 +- qcsrc/server/g_models.qc | 4 +- qcsrc/server/g_subs.qc | 6 +-- qcsrc/server/g_world.qc | 44 ++++++++++++++++++- qcsrc/server/item_key.qc | 4 +- qcsrc/server/miscfunctions.qc | 10 ++--- qcsrc/server/mutators/mutator/gamemode_ctf.qc | 22 +++++----- qcsrc/server/mutators/mutator/gamemode_cts.qc | 2 +- .../mutators/mutator/gamemode_keepaway.qc | 8 ++-- .../mutators/mutator/gamemode_keyhunt.qc | 4 +- .../server/mutators/mutator/gamemode_race.qc | 2 +- qcsrc/server/playerdemo.qc | 2 +- qcsrc/server/steerlib.qc | 4 +- qcsrc/server/sv_main.qc | 4 +- qcsrc/server/weapons/csqcprojectile.qc | 2 +- 88 files changed, 387 insertions(+), 268 deletions(-) diff --git a/qcsrc/client/csqc_constants.qh b/qcsrc/client/csqc_constants.qh index 2ea1e746f..d8906b12b 100644 --- a/qcsrc/client/csqc_constants.qh +++ b/qcsrc/client/csqc_constants.qh @@ -132,7 +132,7 @@ const int SOLID_CORPSE = 5; // same as SOLID_BBOX, except it behaves as SOLID_N 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; diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index c96b3c8bd..65ee03aaf 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -699,7 +699,7 @@ NET_HANDLE(ENT_CLIENT_SPAWNPOINT, bool is_new) 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) diff --git a/qcsrc/common/csqcmodel_settings.qh b/qcsrc/common/csqcmodel_settings.qh index ff890afec..39cec4322 100644 --- a/qcsrc/common/csqcmodel_settings.qh +++ b/qcsrc/common/csqcmodel_settings.qh @@ -28,7 +28,7 @@ # define TAG_VIEWLOC_NAME viewloc # define TAG_VIEWLOC_TYPE entity -# define MOVETYPE_NAME movetype +# define MOVETYPE_NAME move_movetype #endif // new fields diff --git a/qcsrc/common/debug.qh b/qcsrc/common/debug.qh index 9aca8e774..2833acc23 100644 --- a/qcsrc/common/debug.qh +++ b/qcsrc/common/debug.qh @@ -100,7 +100,7 @@ bool autocvar_debugdraw; // 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; diff --git a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc index 07479cc19..21d2d858b 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc @@ -178,7 +178,7 @@ void GiveBall(entity plyr, entity ball) 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. @@ -209,7 +209,7 @@ void DropBall(entity ball, vector org, vector vel) 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; @@ -237,7 +237,7 @@ void InitBall(entity this) { 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") @@ -261,7 +261,7 @@ void ResetBall(entity this) 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); @@ -283,7 +283,7 @@ void ResetBall(entity this) 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; } @@ -549,7 +549,7 @@ void SpawnBall(entity this) this.glow_trail = true; } - this.movetype = MOVETYPE_FLY; + set_movetype(this, MOVETYPE_FLY); if(!autocvar_g_nexball_sound_bounce) this.noise = ""; @@ -818,7 +818,7 @@ void W_Nexball_Attack2(entity actor) missile.owner = actor; - missile.movetype = MOVETYPE_FLY; + set_movetype(missile, MOVETYPE_FLY); PROJECTILE_MAKETRIGGER(missile); //setmodel(missile, "models/elaser.mdl"); // precision set below diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc b/qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc index bbd3f03b3..013479242 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc @@ -117,7 +117,7 @@ void cpicon_construct(entity this) 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; } @@ -125,7 +125,7 @@ void cpicon_construct(entity this) 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; diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc b/qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc index 30ecfb1ac..a22815b16 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc @@ -33,7 +33,7 @@ void ons_generator_ray_spawn(vector org) 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; @@ -153,7 +153,7 @@ void generator_construct(entity this) 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; diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc b/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc index 7d9c93d94..6242414ae 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc @@ -211,7 +211,7 @@ void ons_CaptureShield_Spawn(entity generator, bool is_generator) 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; @@ -863,7 +863,7 @@ void ons_ControlPoint_Setup(entity cp) 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; @@ -882,14 +882,14 @@ void ons_ControlPoint_Setup(entity cp) 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 @@ -1105,7 +1105,7 @@ void ons_GeneratorSetup(entity gen) // called when spawning a generator entity o 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; diff --git a/qcsrc/common/minigames/sv_minigames.qc b/qcsrc/common/minigames/sv_minigames.qc index 992eab054..0d0efb05d 100644 --- a/qcsrc/common/minigames/sv_minigames.qc +++ b/qcsrc/common/minigames/sv_minigames.qc @@ -5,9 +5,9 @@ void player_clear_minigame(entity player) 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; } diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index 46a9fb18e..65c82ab37 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -233,7 +233,7 @@ void M_Mage_Attack_Spike(entity this, vector dir) 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'); diff --git a/qcsrc/common/monsters/monster/shambler.qc b/qcsrc/common/monsters/monster/shambler.qc index dd9a61d41..afbb954c0 100644 --- a/qcsrc/common/monsters/monster/shambler.qc +++ b/qcsrc/common/monsters/monster/shambler.qc @@ -85,10 +85,10 @@ void M_Shambler_Attack_Lightning_Explode(entity this, entity directhitentity) 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), @@ -150,7 +150,7 @@ void M_Shambler_Attack_Lightning(entity this) 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)); diff --git a/qcsrc/common/monsters/monster/spider.qc b/qcsrc/common/monsters/monster/spider.qc index b6d41dbb4..c7ffece15 100644 --- a/qcsrc/common/monsters/monster/spider.qc +++ b/qcsrc/common/monsters/monster/spider.qc @@ -185,7 +185,7 @@ void M_Spider_Attack_Web(entity 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'); diff --git a/qcsrc/common/monsters/monster/wyvern.qc b/qcsrc/common/monsters/monster/wyvern.qc index 345d6459c..53d08effa 100644 --- a/qcsrc/common/monsters/monster/wyvern.qc +++ b/qcsrc/common/monsters/monster/wyvern.qc @@ -64,7 +64,7 @@ METHOD(WyvernAttack, wr_think, void(WyvernAttack thiswep, entity actor, .entity 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); diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 005f128b9..4013e9d4f 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -50,7 +50,7 @@ void monster_dropitem(entity this, entity attacker) 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'; @@ -763,15 +763,15 @@ void Monster_Move(entity this, float runspeed, float walkspeed, float stpspeed) } - 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); } } @@ -1010,7 +1010,7 @@ void Monster_Dead(entity this, entity attacker, float gibbed) 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; @@ -1320,7 +1320,7 @@ bool Monster_Spawn(entity this, int mon_id) 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'; @@ -1355,7 +1355,7 @@ bool Monster_Spawn(entity this, int mon_id) if(mon.spawnflags & MONSTER_TYPE_FLY) { this.flags |= FL_FLY; - this.movetype = MOVETYPE_FLY; + set_movetype(this, MOVETYPE_FLY); } if(!(this.spawnflags & MONSTERFLAG_RESPAWNED)) diff --git a/qcsrc/common/mutators/mutator/buffs/buffs.qc b/qcsrc/common/mutators/mutator/buffs/buffs.qc index 921cd03cd..5c2987e0e 100644 --- a/qcsrc/common/mutators/mutator/buffs/buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/buffs.qc @@ -207,7 +207,7 @@ void buff_Respawn(entity this) setorigin(this, trace_endpos); // attempt to unstick - this.movetype = MOVETYPE_TOSS; + set_movetype(this, MOVETYPE_TOSS); makevectors(this.angles); this.angles = '0 0 0'; @@ -428,7 +428,7 @@ void buff_Init(entity this) 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; @@ -445,7 +445,7 @@ void buff_Init(entity this) 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); diff --git a/qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc b/qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc index 96490700e..8631afabf 100644 --- a/qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc +++ b/qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc @@ -214,13 +214,13 @@ void RaceCarPhysics(entity this) } 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; diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index 7ba2f6f5b..5570a1b08 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -94,7 +94,7 @@ MUTATOR_HOOKFUNCTION(cl_nades, EditProjectile) 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; @@ -273,7 +273,7 @@ void nade_napalm_ball(entity this) 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); @@ -356,7 +356,7 @@ void nade_napalm_boom(entity this) 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; @@ -448,7 +448,7 @@ void nade_ice_boom(entity this) 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'); @@ -494,7 +494,7 @@ void nade_spawn_boom(entity this) 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; @@ -907,7 +907,7 @@ void toss_nade(entity e, bool set_owner, vector _velocity, float _time) 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) diff --git a/qcsrc/common/mutators/mutator/nades/net.qc b/qcsrc/common/mutators/mutator/nades/net.qc index 26ebd504e..cbb8e4abf 100644 --- a/qcsrc/common/mutators/mutator/nades/net.qc +++ b/qcsrc/common/mutators/mutator/nades/net.qc @@ -30,7 +30,7 @@ void orb_setup(entity e) 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; diff --git a/qcsrc/common/mutators/mutator/overkill/overkill.qc b/qcsrc/common/mutators/mutator/overkill/overkill.qc index 2fb75b3f8..ef76ab515 100644 --- a/qcsrc/common/mutators/mutator/overkill/overkill.qc +++ b/qcsrc/common/mutators/mutator/overkill/overkill.qc @@ -130,7 +130,7 @@ void ok_DropItem(entity this, entity targ) 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'); diff --git a/qcsrc/common/mutators/mutator/overkill/rpc.qc b/qcsrc/common/mutators/mutator/overkill/rpc.qc index b14b6bce4..4c59f183a 100644 --- a/qcsrc/common/mutators/mutator/overkill/rpc.qc +++ b/qcsrc/common/mutators/mutator/overkill/rpc.qc @@ -129,7 +129,7 @@ void W_RocketPropelledChainsaw_Attack (Weapon thiswep, entity actor) 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 diff --git a/qcsrc/common/mutators/mutator/physical_items/physical_items.qc b/qcsrc/common/mutators/mutator/physical_items/physical_items.qc index 6e4bfa566..8e9d4699e 100644 --- a/qcsrc/common/mutators/mutator/physical_items/physical_items.qc +++ b/qcsrc/common/mutators/mutator/physical_items/physical_items.qc @@ -53,13 +53,13 @@ void physical_item_think(entity this) 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); } } } @@ -109,7 +109,7 @@ MUTATOR_HOOKFUNCTION(physical_items, Item_Spawn) 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; @@ -134,7 +134,7 @@ MUTATOR_HOOKFUNCTION(physical_items, Item_Spawn) 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); } diff --git a/qcsrc/common/mutators/mutator/sandbox/sandbox.qc b/qcsrc/common/mutators/mutator/sandbox/sandbox.qc index 973ff3151..6adc964be 100644 --- a/qcsrc/common/mutators/mutator/sandbox/sandbox.qc +++ b/qcsrc/common/mutators/mutator/sandbox/sandbox.qc @@ -129,8 +129,8 @@ void sandbox_ObjectAttach_Set(entity e, entity parent, string s) 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; @@ -156,7 +156,7 @@ void sandbox_ObjectAttach_Remove(entity e) 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; }); } @@ -169,7 +169,7 @@ entity sandbox_ObjectSpawn(entity this, float database) 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; @@ -240,7 +240,7 @@ string sandbox_ObjectPort_Save(entity e, float database) { 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 { @@ -347,7 +347,8 @@ entity sandbox_ObjectPort_Load(entity this, string s, float database) 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) @@ -683,13 +684,13 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand) 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; diff --git a/qcsrc/common/physics/movetypes/movetypes.qc b/qcsrc/common/physics/movetypes/movetypes.qc index 285bc164a..07f192065 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qc +++ b/qcsrc/common/physics/movetypes/movetypes.qc @@ -12,6 +12,28 @@ #include #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; @@ -623,6 +645,20 @@ void _Movetype_Physics_ClientFrame(entity this, float movedt) } } +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; diff --git a/qcsrc/common/physics/movetypes/movetypes.qh b/qcsrc/common/physics/movetypes/movetypes.qh index 8b061e383..e36eca952 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qh +++ b/qcsrc/common/physics/movetypes/movetypes.qh @@ -10,6 +10,12 @@ .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; @@ -46,6 +52,7 @@ void _Movetype_PushEntityTrace(entity this, vector push); 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); diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index d010dfe6c..0ce4777b3 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -1381,24 +1381,24 @@ void PM_Main(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); @@ -1523,7 +1523,7 @@ void PM_Main(entity 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 @@ -1564,4 +1564,8 @@ void CSQC_ClientMovement_PlayerMove_Frame(entity this) #endif { PM_Main(this); + +#ifdef SVQC + this.pm_frametime = frametime; +#endif } diff --git a/qcsrc/common/physics/player.qh b/qcsrc/common/physics/player.qh index de76bb8d8..73d2ec932 100644 --- a/qcsrc/common/physics/player.qh +++ b/qcsrc/common/physics/player.qh @@ -3,6 +3,8 @@ // Client/server mappings +.float pm_frametime; + .entity conveyor; .float race_penalty; diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 3147354ea..0de2fe1cf 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -1077,7 +1077,7 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default { 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); @@ -1118,9 +1118,9 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default 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) { diff --git a/qcsrc/common/triggers/func/breakable.qc b/qcsrc/common/triggers/func/breakable.qc index 1a65710a9..6763701d3 100644 --- a/qcsrc/common/triggers/func/breakable.qc +++ b/qcsrc/common/triggers/func/breakable.qc @@ -59,7 +59,7 @@ void LaunchDebris (entity this, string debrisname, vector force) 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 diff --git a/qcsrc/common/triggers/func/conveyor.qc b/qcsrc/common/triggers/func/conveyor.qc index bdb80fe14..95f9ebc69 100644 --- a/qcsrc/common/triggers/func/conveyor.qc +++ b/qcsrc/common/triggers/func/conveyor.qc @@ -140,7 +140,7 @@ spawnfunc(func_conveyor) { SetMovedir(this); InitMovingBrushTrigger(this); - this.movetype = MOVETYPE_NONE; + set_movetype(this, MOVETYPE_NONE); conveyor_init(this); } @@ -153,7 +153,7 @@ void conveyor_init(entity 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; diff --git a/qcsrc/common/triggers/func/door.qc b/qcsrc/common/triggers/func/door.qc index a27787634..a0fb12a4c 100644 --- a/qcsrc/common/triggers/func/door.qc +++ b/qcsrc/common/triggers/func/door.qc @@ -441,7 +441,7 @@ void door_spawnfield(entity this, vector fmins, vector fmaxs) 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 @@ -815,7 +815,7 @@ NET_HANDLE(ENT_CLIENT_DOOR, bool isnew) this.SUB_LTIME = ReadCoord(); this.solid = SOLID_BSP; - this.movetype = MOVETYPE_PUSH; + this.move_movetype = MOVETYPE_PUSH; this.use = door_use; LinkDoors(this); diff --git a/qcsrc/common/triggers/func/plat.qc b/qcsrc/common/triggers/func/plat.qc index 86b7b3880..07709df33 100644 --- a/qcsrc/common/triggers/func/plat.qc +++ b/qcsrc/common/triggers/func/plat.qc @@ -168,7 +168,7 @@ NET_HANDLE(ENT_CLIENT_PLAT, bool isnew) 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; diff --git a/qcsrc/common/triggers/func/rainsnow.qc b/qcsrc/common/triggers/func/rainsnow.qc index 265d45e0a..d2cf18963 100644 --- a/qcsrc/common/triggers/func/rainsnow.qc +++ b/qcsrc/common/triggers/func/rainsnow.qc @@ -35,7 +35,7 @@ spawnfunc(func_rain) 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) @@ -73,7 +73,7 @@ spawnfunc(func_snow) 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) diff --git a/qcsrc/common/triggers/func/train.qc b/qcsrc/common/triggers/func/train.qc index d9e1799fb..6bf6b0b1a 100644 --- a/qcsrc/common/triggers/func/train.qc +++ b/qcsrc/common/triggers/func/train.qc @@ -307,7 +307,7 @@ NET_HANDLE(ENT_CLIENT_TRAIN, bool isnew) 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; diff --git a/qcsrc/common/triggers/misc/follow.qc b/qcsrc/common/triggers/misc/follow.qc index 69222bf2d..fa242beb9 100644 --- a/qcsrc/common/triggers/misc/follow.qc +++ b/qcsrc/common/triggers/misc/follow.qc @@ -47,7 +47,7 @@ void follow_init(entity this) { 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; diff --git a/qcsrc/common/triggers/platforms.qc b/qcsrc/common/triggers/platforms.qc index 324fd3676..391172fe0 100644 --- a/qcsrc/common/triggers/platforms.qc +++ b/qcsrc/common/triggers/platforms.qc @@ -23,7 +23,7 @@ void plat_spawn_inside_trigger(entity this) trigger = spawn(); settouch(trigger, plat_center_touch); - trigger.movetype = MOVETYPE_NONE; + set_movetype(trigger, MOVETYPE_NONE); trigger.solid = SOLID_TRIGGER; trigger.enemy = this; diff --git a/qcsrc/common/triggers/teleporters.qc b/qcsrc/common/triggers/teleporters.qc index e2d6288bd..a1a38d39e 100644 --- a/qcsrc/common/triggers/teleporters.qc +++ b/qcsrc/common/triggers/teleporters.qc @@ -234,7 +234,7 @@ void teleport_findtarget(entity 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"); diff --git a/qcsrc/common/triggers/trigger/jumppads.qc b/qcsrc/common/triggers/trigger/jumppads.qc index ffe3d4ee8..4a30ca695 100644 --- a/qcsrc/common/triggers/trigger/jumppads.qc +++ b/qcsrc/common/triggers/trigger/jumppads.qc @@ -235,14 +235,14 @@ void trigger_push_touch(entity this, entity toucher) 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; } @@ -289,7 +289,7 @@ void trigger_push_findtarget(entity this) 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 diff --git a/qcsrc/common/turrets/cl_turrets.qc b/qcsrc/common/turrets/cl_turrets.qc index 7e4330308..7dfab581b 100644 --- a/qcsrc/common/turrets/cl_turrets.qc +++ b/qcsrc/common/turrets/cl_turrets.qc @@ -230,8 +230,8 @@ void turret_construct(entity this) 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; diff --git a/qcsrc/common/turrets/sv_turrets.qc b/qcsrc/common/turrets/sv_turrets.qc index 1f8450f39..d26405da4 100644 --- a/qcsrc/common/turrets/sv_turrets.qc +++ b/qcsrc/common/turrets/sv_turrets.qc @@ -32,7 +32,7 @@ vector turret_aim_generic(entity this) 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; @@ -474,7 +474,7 @@ entity turret_projectile(entity actor, Sound _snd, float _size, float _health, f 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; @@ -1329,7 +1329,7 @@ bool turret_initialize(entity this, Turret tur) 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; @@ -1349,7 +1349,7 @@ bool turret_initialize(entity this, Turret tur) 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 != "") diff --git a/qcsrc/common/turrets/turret/ewheel.qc b/qcsrc/common/turrets/turret/ewheel.qc index 25879f599..be6e3fd01 100644 --- a/qcsrc/common/turrets/turret/ewheel.qc +++ b/qcsrc/common/turrets/turret/ewheel.qc @@ -184,7 +184,7 @@ METHOD(EWheel, tr_setup, void(EWheel this, entity it)) { entity e; - if(it.movetype == MOVETYPE_WALK) + if(it.move_movetype == MOVETYPE_WALK) { it.velocity = '0 0 0'; it.enemy = NULL; @@ -218,7 +218,7 @@ METHOD(EWheel, tr_setup, void(EWheel this, entity it)) 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'; @@ -257,7 +257,7 @@ void ewheel_draw(entity this) 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; diff --git a/qcsrc/common/turrets/turret/hk_weapon.qc b/qcsrc/common/turrets/turret/hk_weapon.qc index dc6f49cab..afc3ed17c 100644 --- a/qcsrc/common/turrets/turret/hk_weapon.qc +++ b/qcsrc/common/turrets/turret/hk_weapon.qc @@ -31,7 +31,7 @@ METHOD(HunterKillerAttack, wr_think, void(entity thiswep, entity actor, .entity 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; @@ -207,7 +207,7 @@ void turret_hk_missile_think(entity this) { this.cnt = time + 0.25; this.nextthink = 0; - this.movetype = MOVETYPE_BOUNCE; + this.move_movetype = MOVETYPE_BOUNCE; return; } diff --git a/qcsrc/common/turrets/turret/phaser_weapon.qc b/qcsrc/common/turrets/turret/phaser_weapon.qc index ea48a6479..df68e1ce7 100644 --- a/qcsrc/common/turrets/turret/phaser_weapon.qc +++ b/qcsrc/common/turrets/turret/phaser_weapon.qc @@ -33,7 +33,7 @@ METHOD(PhaserTurretAttack, wr_think, void(entity thiswep, entity actor, .entity 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; diff --git a/qcsrc/common/turrets/turret/walker.qc b/qcsrc/common/turrets/turret/walker.qc index 46108e0b7..18af3d37d 100644 --- a/qcsrc/common/turrets/turret/walker.qc +++ b/qcsrc/common/turrets/turret/walker.qc @@ -255,7 +255,7 @@ void walker_fire_rocket(entity this, vector org) 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); @@ -571,7 +571,7 @@ METHOD(WalkerTurret, tr_setup, void(WalkerTurret this, entity it)) 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); @@ -590,7 +590,7 @@ METHOD(WalkerTurret, tr_setup, void(WalkerTurret this, entity it)) 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); @@ -598,7 +598,7 @@ METHOD(WalkerTurret, tr_setup, void(WalkerTurret this, entity 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; diff --git a/qcsrc/common/turrets/util.qc b/qcsrc/common/turrets/util.qc index 4928262f2..2c33c165a 100644 --- a/qcsrc/common/turrets/util.qc +++ b/qcsrc/common/turrets/util.qc @@ -115,7 +115,7 @@ void mark_error(vector where,float lifetime) 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; @@ -128,7 +128,7 @@ void mark_info(vector where,float lifetime) 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; @@ -141,7 +141,7 @@ entity mark_misc(vector where,float lifetime) 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; @@ -167,7 +167,7 @@ void paint_target(entity onwho, float f_size, vector v_color, float f_time) //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; @@ -186,7 +186,7 @@ void paint_target2(entity onwho, float f_size, vector v_color, float f_time) 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; @@ -203,7 +203,7 @@ void paint_target3(vector where, float f_size, vector v_color, float f_time) 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); diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index fc2a06241..e5736abd4 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -227,7 +227,7 @@ entity vehicles_projectile(entity this, string _mzlfx, Sound _mzlsound, 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; @@ -290,7 +290,7 @@ entity vehicle_tossgib(entity this, entity _template, vector _vel, string _tag, 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; @@ -777,7 +777,7 @@ void vehicles_exit(entity vehic, bool eject) 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; @@ -947,7 +947,7 @@ void vehicles_enter(entity pl, entity veh) 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; @@ -1051,7 +1051,7 @@ void vehicles_spawn(entity this) 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; diff --git a/qcsrc/common/vehicles/vehicle/bumblebee.qc b/qcsrc/common/vehicles/vehicle/bumblebee.qc index a0b196e1e..1842ebe7b 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee.qc @@ -138,7 +138,7 @@ bool bumblebee_gunner_frame(entity this) 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)) { @@ -156,7 +156,7 @@ bool bumblebee_gunner_frame(entity this) 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; @@ -256,7 +256,7 @@ void bumblebee_gunner_exit(entity this, int _exitflag) 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; @@ -319,7 +319,7 @@ bool bumblebee_gunner_enter(entity this, entity player) 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; @@ -510,7 +510,7 @@ bool bumblebee_pilot_frame(entity this) 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)) { @@ -660,7 +660,7 @@ void bumblebee_exit(entity this, int eject) this.nextthink = time; } - this.movetype = MOVETYPE_TOSS; + set_movetype(this, MOVETYPE_TOSS); if(!this.owner) return; @@ -737,7 +737,7 @@ METHOD(Bumblebee, vr_enter, void(Bumblebee thisveh, entity instance)) { 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)) { @@ -824,7 +824,7 @@ METHOD(Bumblebee, vr_death, void(Bumblebee thisveh, entity instance)) 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'; @@ -904,7 +904,7 @@ METHOD(Bumblebee, vr_spawn, void(Bumblebee thisveh, entity instance)) 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; diff --git a/qcsrc/common/vehicles/vehicle/racer.qc b/qcsrc/common/vehicles/vehicle/racer.qc index cee5a6a0e..e216a740c 100644 --- a/qcsrc/common/vehicles/vehicle/racer.qc +++ b/qcsrc/common/vehicles/vehicle/racer.qc @@ -439,7 +439,7 @@ void racer_exit(entity this, int eject) 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) @@ -490,7 +490,7 @@ void racer_blowup(entity this) 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; @@ -538,7 +538,7 @@ METHOD(Racer, vr_impact, void(Racer thisveh, entity instance)) 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; @@ -572,7 +572,7 @@ METHOD(Racer, vr_spawn, void(Racer thisveh, entity instance)) 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; @@ -596,7 +596,7 @@ METHOD(Racer, vr_death, void(Racer thisveh, entity instance)) 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; diff --git a/qcsrc/common/vehicles/vehicle/raptor.qc b/qcsrc/common/vehicles/vehicle/raptor.qc index 562f522f3..8e2866946 100644 --- a/qcsrc/common/vehicles/vehicle/raptor.qc +++ b/qcsrc/common/vehicles/vehicle/raptor.qc @@ -96,7 +96,7 @@ void raptor_land(entity this) if(hgt < 16) { - this.movetype = MOVETYPE_TOSS; + set_movetype(this, MOVETYPE_TOSS); setthink(this, vehicles_think); this.frame = 0; } @@ -287,7 +287,7 @@ bool raptor_frame(entity this) 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)) { @@ -313,7 +313,7 @@ bool raptor_frame(entity this) 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) @@ -517,7 +517,7 @@ void raptor_blowup(entity this, entity toucher) 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'; @@ -613,7 +613,7 @@ METHOD(Raptor, vr_enter, void(Raptor thisveh, entity instance)) { 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; @@ -635,7 +635,7 @@ METHOD(Raptor, vr_death, void(Raptor thisveh, entity instance)) 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); @@ -702,7 +702,7 @@ METHOD(Raptor, vr_spawn, void(Raptor thisveh, entity instance)) 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; @@ -710,7 +710,7 @@ METHOD(Raptor, vr_spawn, void(Raptor thisveh, entity instance)) 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; @@ -724,7 +724,7 @@ METHOD(Raptor, vr_spawn, void(Raptor thisveh, entity instance)) 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; diff --git a/qcsrc/common/vehicles/vehicle/raptor_weapons.qc b/qcsrc/common/vehicles/vehicle/raptor_weapons.qc index f1357f306..94fb9eaa5 100644 --- a/qcsrc/common/vehicles/vehicle/raptor_weapons.qc +++ b/qcsrc/common/vehicles/vehicle/raptor_weapons.qc @@ -67,7 +67,7 @@ METHOD(RaptorFlare, wr_think, void(entity thiswep, entity actor, .entity weapone _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); @@ -128,7 +128,7 @@ void raptor_bomb_burst(entity this) 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; @@ -160,7 +160,7 @@ void raptor_bombdrop(entity this) 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); @@ -240,7 +240,7 @@ void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang) 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; diff --git a/qcsrc/common/vehicles/vehicle/spiderbot.qc b/qcsrc/common/vehicles/vehicle/spiderbot.qc index 8015b3102..8140de864 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot.qc @@ -349,7 +349,7 @@ void spiderbot_exit(entity this, int eject) setthink(this, vehicles_think); this.nextthink = time; this.frame = 5; - this.movetype = MOVETYPE_WALK; + set_movetype(this, MOVETYPE_WALK); if(!this.owner) return; @@ -435,7 +435,7 @@ void spiderbot_blowup(entity this) 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; @@ -451,14 +451,14 @@ void spiderbot_blowup(entity this) 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; @@ -473,7 +473,7 @@ void spiderbot_blowup(entity this) 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; @@ -543,7 +543,7 @@ METHOD(Spiderbot, vr_impact, void(Spiderbot thisveh, entity instance)) 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; @@ -573,7 +573,7 @@ METHOD(Spiderbot, vr_death, void(Spiderbot thisveh, entity instance)) 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 } @@ -594,7 +594,7 @@ METHOD(Spiderbot, vr_spawn, void(Spiderbot thisveh, entity instance)) 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'; diff --git a/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc b/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc index 8876f8959..c81a88b74 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc @@ -232,7 +232,7 @@ void spiderbot_rocket_do(entity this) 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; diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index 012b2c0f1..b07a3d98c 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -295,7 +295,7 @@ void W_Arc_Attack_Bolt(Weapon thiswep, entity actor) 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); @@ -685,7 +685,7 @@ void W_Arc_Beam(float burst, entity actor) 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; diff --git a/qcsrc/common/weapons/weapon/blaster.qc b/qcsrc/common/weapons/weapon/blaster.qc index 79a680e36..3a9bf365d 100644 --- a/qcsrc/common/weapons/weapon/blaster.qc +++ b/qcsrc/common/weapons/weapon/blaster.qc @@ -80,7 +80,7 @@ void W_Blaster_Touch(entity this, entity toucher) 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); diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index d1f2522ab..47fa8efca 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -395,7 +395,7 @@ void W_Crylink_Attack(Weapon thiswep, entity actor) prevproj = proj; - proj.movetype = MOVETYPE_BOUNCEMISSILE; + set_movetype(proj, MOVETYPE_BOUNCEMISSILE); PROJECTILE_MAKETRIGGER(proj); proj.projectiledeathtype = WEP_CRYLINK.m_id; //proj.gravity = 0.001; @@ -503,7 +503,7 @@ void W_Crylink_Attack2(Weapon thiswep, entity actor) 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; diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index 9d955f058..bcc81c82e 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -376,7 +376,7 @@ void W_Devastator_Attack(Weapon thiswep, entity actor) 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 diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index b9811abd8..a1d6eb39a 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -156,7 +156,7 @@ void W_Electro_Explode(entity this, entity directhitentity) this.event_damage = func_null; this.takedamage = DAMAGE_NO; - if(this.movetype == MOVETYPE_BOUNCE) + if(this.move_movetype == MOVETYPE_BOUNCE) { RadiusDamage( this, @@ -285,7 +285,7 @@ void W_Electro_Attack_Bolt(Weapon thiswep, entity actor) 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); @@ -385,7 +385,7 @@ void W_Electro_Attack_Orb(Weapon thiswep, entity actor) //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'); diff --git a/qcsrc/common/weapons/weapon/fireball.qc b/qcsrc/common/weapons/weapon/fireball.qc index 37deb1452..69c2dc006 100644 --- a/qcsrc/common/weapons/weapon/fireball.qc +++ b/qcsrc/common/weapons/weapon/fireball.qc @@ -218,7 +218,7 @@ void W_Fireball_Attack1(entity actor) 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); @@ -340,7 +340,7 @@ void W_Fireball_Attack2(entity actor) 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); diff --git a/qcsrc/common/weapons/weapon/hagar.qc b/qcsrc/common/weapons/weapon/hagar.qc index 1a078dff0..130c47063 100644 --- a/qcsrc/common/weapons/weapon/hagar.qc +++ b/qcsrc/common/weapons/weapon/hagar.qc @@ -164,7 +164,7 @@ void W_Hagar_Attack(Weapon thiswep, entity actor) 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); @@ -207,7 +207,7 @@ void W_Hagar_Attack2(Weapon thiswep, entity actor) 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); @@ -264,7 +264,7 @@ void W_Hagar_Attack2_Load_Release(entity actor, .entity weaponentity) 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) diff --git a/qcsrc/common/weapons/weapon/hlac.qc b/qcsrc/common/weapons/weapon/hlac.qc index d46972fa1..ab4e2f7a0 100644 --- a/qcsrc/common/weapons/weapon/hlac.qc +++ b/qcsrc/common/weapons/weapon/hlac.qc @@ -95,7 +95,7 @@ void W_HLAC_Attack(Weapon thiswep, entity actor) missile.bot_dodgerating = WEP_CVAR_PRI(hlac, damage); - missile.movetype = MOVETYPE_FLY; + set_movetype(missile, MOVETYPE_FLY); PROJECTILE_MAKETRIGGER(missile); setorigin(missile, w_shotorg); @@ -137,7 +137,7 @@ void W_HLAC_Attack2(entity actor) missile.bot_dodgerating = WEP_CVAR_SEC(hlac, damage); - missile.movetype = MOVETYPE_FLY; + set_movetype(missile, MOVETYPE_FLY); PROJECTILE_MAKETRIGGER(missile); setorigin(missile, w_shotorg); diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index f46e592e2..8926ffa30 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -115,7 +115,7 @@ void W_Hook_Explode2(entity this) 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) @@ -152,7 +152,7 @@ void W_Hook_Attack2(Weapon thiswep, entity actor) 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); diff --git a/qcsrc/common/weapons/weapon/minelayer.qc b/qcsrc/common/weapons/weapon/minelayer.qc index 08b3634f4..ffa9793e8 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qc +++ b/qcsrc/common/weapons/weapon/minelayer.qc @@ -91,7 +91,7 @@ void W_MineLayer_Stick(entity this, entity to) 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; @@ -148,7 +148,7 @@ void W_MineLayer_DoRemoteExplode(entity this) 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); @@ -216,12 +216,12 @@ void W_MineLayer_Think(entity this) 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); } } @@ -274,7 +274,7 @@ void W_MineLayer_Think(entity this) 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)) @@ -350,7 +350,7 @@ void W_MineLayer_Attack(Weapon thiswep, entity actor) 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 diff --git a/qcsrc/common/weapons/weapon/mortar.qc b/qcsrc/common/weapons/weapon/mortar.qc index 8cbe75e74..748c2347f 100644 --- a/qcsrc/common/weapons/weapon/mortar.qc +++ b/qcsrc/common/weapons/weapon/mortar.qc @@ -76,7 +76,7 @@ void W_Mortar_Grenade_Explode(entity this, entity 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_PRI(mortar, damage), WEP_CVAR_PRI(mortar, edgedamage), WEP_CVAR_PRI(mortar, radius), NULL, NULL, WEP_CVAR_PRI(mortar, force), this.projectiledeathtype, directhitentity); @@ -101,7 +101,7 @@ void W_Mortar_Grenade_Explode2(entity this, entity 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); @@ -155,14 +155,14 @@ void W_Mortar_Grenade_Touch1(entity this, entity toucher) 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); @@ -191,14 +191,14 @@ void W_Mortar_Grenade_Touch2(entity this, entity toucher) 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); @@ -224,7 +224,7 @@ void W_Mortar_Attack(Weapon thiswep, entity actor) 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); @@ -272,7 +272,7 @@ void W_Mortar_Attack2(Weapon thiswep, entity actor) 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); diff --git a/qcsrc/common/weapons/weapon/porto.qc b/qcsrc/common/weapons/weapon/porto.qc index dbcad2c1e..f17a2ac50 100644 --- a/qcsrc/common/weapons/weapon/porto.qc +++ b/qcsrc/common/weapons/weapon/porto.qc @@ -257,7 +257,7 @@ void W_Porto_Attack(entity actor, float type) 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; diff --git a/qcsrc/common/weapons/weapon/seeker.qc b/qcsrc/common/weapons/weapon/seeker.qc index 524c6791f..7ef0367db 100644 --- a/qcsrc/common/weapons/weapon/seeker.qc +++ b/qcsrc/common/weapons/weapon/seeker.qc @@ -244,9 +244,9 @@ void W_Seeker_Missile_Animate(entity this) 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); @@ -293,7 +293,7 @@ void W_Seeker_Fire_Missile(Weapon thiswep, entity actor, vector f_diff, entity m 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; @@ -367,7 +367,7 @@ void W_Seeker_Fire_Flac(Weapon thiswep, entity actor) 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; @@ -578,7 +578,7 @@ void W_Seeker_Fire_Tag(Weapon thiswep, entity actor) 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; @@ -592,7 +592,7 @@ void W_Seeker_Fire_Tag(Weapon thiswep, entity actor) 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); diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index 8a2fbdac3..362209f91 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -277,7 +277,7 @@ void W_RocketMinsta_Attack2(entity actor) //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); @@ -329,7 +329,7 @@ void W_RocketMinsta_Attack3 (entity actor) //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); diff --git a/qcsrc/lib/warpzone/server.qc b/qcsrc/lib/warpzone/server.qc index 4390df809..0b83f05bf 100644 --- a/qcsrc/lib/warpzone/server.qc +++ b/qcsrc/lib/warpzone/server.qc @@ -175,7 +175,7 @@ void WarpZone_Touch(entity this, entity toucher) 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 diff --git a/qcsrc/lib/warpzone/util_server.qc b/qcsrc/lib/warpzone/util_server.qc index 73f09c0e0..d5533647f 100644 --- a/qcsrc/lib/warpzone/util_server.qc +++ b/qcsrc/lib/warpzone/util_server.qc @@ -43,7 +43,7 @@ void WarpZoneLib_ExactTrigger_Init(entity this) 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 = ""; } diff --git a/qcsrc/server/bot/aim.qc b/qcsrc/server/bot/aim.qc index b2fca55e8..b867b5f6d 100644 --- a/qcsrc/server/bot/aim.qc +++ b/qcsrc/server/bot/aim.qc @@ -43,7 +43,7 @@ float findtrajectorywithleading(vector org, vector m1, vector m2, entity targ, f 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; @@ -63,7 +63,7 @@ float findtrajectorywithleading(vector org, vector m1, vector m2, entity targ, f // 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 @@ -78,7 +78,7 @@ float findtrajectorywithleading(vector org, vector m1, vector m2, entity targ, f // 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 diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index a7cbeae28..86f46b067 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -232,7 +232,7 @@ float CheatImpulse(entity this, int imp) 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) @@ -639,29 +639,29 @@ float CheatCommand(entity this, int argc) 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; @@ -868,9 +868,9 @@ void Drag_Begin(entity dragger, entity draggee, vector touchpoint) { 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; @@ -895,10 +895,10 @@ void Drag_Finish(entity 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: diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index a47e14e16..525006c9c 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -269,7 +269,7 @@ void PutObserverInServer(entity this) 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; @@ -481,7 +481,7 @@ void PutClientInServer(entity this) 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) @@ -1289,7 +1289,7 @@ void respawn(entity this) { 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; @@ -1675,7 +1675,7 @@ bool SpectateSet(entity this) 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)) @@ -1925,7 +1925,6 @@ void ObserverThink(entity 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; @@ -1936,9 +1935,8 @@ void ObserverThink(entity this) 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))) { @@ -2420,6 +2418,30 @@ void DrownPlayer(entity 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 @@ -2430,6 +2452,8 @@ Called every frame for each client after the physics are run .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)) diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 50ceba310..098a176c8 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -91,7 +91,8 @@ void CopyBody(entity this, float keepvelocity) 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; @@ -151,7 +152,7 @@ void player_anim(entity this) 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; @@ -594,7 +595,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, // 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; diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 61104af4d..5fbe64230 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -837,7 +837,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d 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; diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index fd3cd08ec..88d63e384 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -76,8 +76,8 @@ void RemoveGrapplingHook(entity pl) 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; } @@ -101,7 +101,7 @@ void GrapplingHook_Stop(entity this) 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; } @@ -220,8 +220,8 @@ void GrapplingHookThink(entity this) 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) { @@ -238,7 +238,7 @@ void GrapplingHookThink(entity this) 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; @@ -280,7 +280,7 @@ void GrapplingHookThink(entity this) 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); } @@ -303,14 +303,14 @@ void GrapplingHookThink(entity this) 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); @@ -371,7 +371,7 @@ void FireGrapplingHook(entity actor) 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 diff --git a/qcsrc/server/g_lights.qc b/qcsrc/server/g_lights.qc index 41366f5ea..e79bbcaf7 100644 --- a/qcsrc/server/g_lights.qc +++ b/qcsrc/server/g_lights.qc @@ -48,7 +48,7 @@ void dynlight_find_aiment(entity this) 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; @@ -123,7 +123,7 @@ spawnfunc(dynlight) 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); diff --git a/qcsrc/server/g_models.qc b/qcsrc/server/g_models.qc index 38e72c732..348f30727 100644 --- a/qcsrc/server/g_models.qc +++ b/qcsrc/server/g_models.qc @@ -165,7 +165,7 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf) #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; \ @@ -173,7 +173,7 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf) 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; \ diff --git a/qcsrc/server/g_subs.qc b/qcsrc/server/g_subs.qc index dba509b28..f3fb1a322 100644 --- a/qcsrc/server/g_subs.qc +++ b/qcsrc/server/g_subs.qc @@ -417,7 +417,7 @@ void InitTrigger(entity this) SetMovedir(this); this.solid = SOLID_TRIGGER; SetBrushEntityModel(this); - this.movetype = MOVETYPE_NONE; + set_movetype(this, MOVETYPE_NONE); this.modelindex = 0; this.model = ""; } @@ -429,7 +429,7 @@ void InitSolidBSPTrigger(entity this) 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 = ""; } @@ -440,7 +440,7 @@ bool InitMovingBrushTrigger(entity this) // 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!"); diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index f2eb1d118..409e33cd0 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -1488,7 +1488,7 @@ void FixIntermissionClient(entity e) 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) { @@ -1984,11 +1984,53 @@ string GotoMap(string m) 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) { diff --git a/qcsrc/server/item_key.qc b/qcsrc/server/item_key.qc index cf2b25acf..64e10a2f2 100644 --- a/qcsrc/server/item_key.qc +++ b/qcsrc/server/item_key.qc @@ -99,9 +99,9 @@ void spawn_item_key(entity this) 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); diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 2c206cf1a..2686e0553 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -1319,7 +1319,7 @@ void detach_sameorigin(entity e) 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 @@ -1328,7 +1328,7 @@ void follow_sameorigin(entity e, entity to) void unfollow_sameorigin(entity e) { - e.movetype = MOVETYPE_NONE; + set_movetype(e, MOVETYPE_NONE); } entity gettaginfo_relative_ent; @@ -1350,7 +1350,7 @@ vector gettaginfo_relative(entity e, float tag) 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 @@ -1361,14 +1361,14 @@ void SetMovetypeFollow(entity ent, entity e) } 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("???"); */ diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qc b/qcsrc/server/mutators/mutator/gamemode_ctf.qc index b3a06416c..0383d2e50 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qc @@ -334,7 +334,7 @@ void ctf_CaptureShield_Spawn(entity flag) 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; @@ -355,7 +355,7 @@ void ctf_Handle_Drop(entity flag, entity player, int droptype) 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; @@ -414,7 +414,7 @@ void ctf_Handle_Retrieve(entity flag, entity player) 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'; @@ -480,7 +480,7 @@ void ctf_Handle_Throw(entity player, entity receiver, int droptype) 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; @@ -668,7 +668,7 @@ void ctf_Handle_Pickup(entity flag, entity player, int pickuptype) } // flag setup - flag.movetype = MOVETYPE_NONE; + set_movetype(flag, MOVETYPE_NONE); flag.takedamage = DAMAGE_NO; flag.solid = SOLID_NOT; flag.angles = '0 0 0'; @@ -937,9 +937,9 @@ void ctf_FlagThink(entity this) 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) { @@ -1157,7 +1157,7 @@ void ctf_RespawnFlag(entity flag) 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; @@ -1318,13 +1318,13 @@ void ctf_FlagSetup(int teamnumber, entity flag) // called when spawning a flag e { 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); @@ -2334,7 +2334,7 @@ MUTATOR_HOOKFUNCTION(ctf, MatchEnd) 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 diff --git a/qcsrc/server/mutators/mutator/gamemode_cts.qc b/qcsrc/server/mutators/mutator/gamemode_cts.qc index bfddc30b0..444fe5692 100644 --- a/qcsrc/server/mutators/mutator/gamemode_cts.qc +++ b/qcsrc/server/mutators/mutator/gamemode_cts.qc @@ -127,7 +127,7 @@ MUTATOR_HOOKFUNCTION(cts, PlayerPhysics) if(player.race_penalty) { player.velocity = '0 0 0'; - player.movetype = MOVETYPE_NONE; + set_movetype(player, MOVETYPE_NONE); player.disableclientprediction = 2; } } diff --git a/qcsrc/server/mutators/mutator/gamemode_keepaway.qc b/qcsrc/server/mutators/mutator/gamemode_keepaway.qc index 00cdf0d68..1ce62672d 100644 --- a/qcsrc/server/mutators/mutator/gamemode_keepaway.qc +++ b/qcsrc/server/mutators/mutator/gamemode_keepaway.qc @@ -96,7 +96,7 @@ void ka_RespawnBall(entity this) // runs whenever the ball needs to be relocated } 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; @@ -152,7 +152,7 @@ void ka_TouchEvent(entity this, entity toucher) // runs any time that the ball c // 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); @@ -191,7 +191,7 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los // 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); @@ -490,7 +490,7 @@ void ka_SpawnBall() // loads various values for the ball, runs only once at star 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; diff --git a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc index 9ac66b5f5..ab23b686f 100644 --- a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc @@ -307,7 +307,7 @@ void kh_Key_Attach(entity key) // runs when a player picks up a key and several #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; @@ -346,7 +346,7 @@ void kh_Key_Detach(entity key) // runs every time a key is dropped or lost. Runs #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; diff --git a/qcsrc/server/mutators/mutator/gamemode_race.qc b/qcsrc/server/mutators/mutator/gamemode_race.qc index 132eba162..3043d4714 100644 --- a/qcsrc/server/mutators/mutator/gamemode_race.qc +++ b/qcsrc/server/mutators/mutator/gamemode_race.qc @@ -159,7 +159,7 @@ MUTATOR_HOOKFUNCTION(rc, PlayerPhysics) if(player.race_penalty) { player.velocity = '0 0 0'; - player.movetype = MOVETYPE_NONE; + set_movetype(player, MOVETYPE_NONE); player.disableclientprediction = 2; } } diff --git a/qcsrc/server/playerdemo.qc b/qcsrc/server/playerdemo.qc index 9bc0855f5..34c886fa1 100644 --- a/qcsrc/server/playerdemo.qc +++ b/qcsrc/server/playerdemo.qc @@ -34,7 +34,7 @@ void playerdemo_open_read(entity this, string f) 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) diff --git a/qcsrc/server/steerlib.qc b/qcsrc/server/steerlib.qc index bf0a95551..2b5302af2 100644 --- a/qcsrc/server/steerlib.qc +++ b/qcsrc/server/steerlib.qc @@ -556,7 +556,7 @@ void spawn_flocker(entity this) 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); @@ -649,7 +649,7 @@ spawnfunc(flockerspawn) 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; diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index bc6814879..bf24e09b7 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -119,7 +119,7 @@ void CreatureFrame_FallDamage(entity this) 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; @@ -368,6 +368,8 @@ LABEL(cvar_fail) 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'; diff --git a/qcsrc/server/weapons/csqcprojectile.qc b/qcsrc/server/weapons/csqcprojectile.qc index 7e7478e9b..caa367e5d 100644 --- a/qcsrc/server/weapons/csqcprojectile.qc +++ b/qcsrc/server/weapons/csqcprojectile.qc @@ -83,7 +83,7 @@ void CSQCProjectile(entity e, float clientanimate, int type, float docull) 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; -- 2.39.2