X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fweapons%2Fprojectile.qc;h=1f88bc8d60ae01519f0f13774d0f81191e35e279;hp=6261fa842f987773298274395246d7a32f782739;hb=b0a563c3658ec620ddb9037b9417b743a47002a5;hpb=10c0e93c75ef6f408e3357bd5fb46c721e7e0576 diff --git a/qcsrc/client/weapons/projectile.qc b/qcsrc/client/weapons/projectile.qc index 6261fa842..1f88bc8d6 100644 --- a/qcsrc/client/weapons/projectile.qc +++ b/qcsrc/client/weapons/projectile.qc @@ -6,6 +6,7 @@ #include "../mutators/events.qh" #include +#include #include #include @@ -16,10 +17,10 @@ .float scale; .vector colormod; -void SUB_Stop(entity this) +void SUB_Stop(entity this, entity toucher) { - this.move_velocity = this.move_avelocity = '0 0 0'; - this.move_movetype = MOVETYPE_NONE; + this.velocity = this.avelocity = '0 0 0'; + set_movetype(this, MOVETYPE_NONE); } void Projectile_ResetTrail(entity this, vector to) @@ -58,11 +59,11 @@ void Projectile_Draw(entity this) float t; float a; - f = this.move_flags; + f = this.flags; if (this.count & 0x80) { - // this.move_flags &= ~FL_ONGROUND; + // UNSET_ONGROUND(this); if (this.move_movetype == MOVETYPE_NONE || this.move_movetype == MOVETYPE_FLY) Movetype_Physics_NoMatchServer(this); // the trivial movetypes do not have to match the @@ -72,9 +73,9 @@ void Projectile_Draw(entity this) // moving, we might still be ticrate dependent. else Movetype_Physics_MatchServer(this, autocvar_cl_projectiles_sloppy); - if (!(this.move_flags & FL_ONGROUND)) + if (!IS_ONGROUND(this)) if (this.velocity != '0 0 0') - this.move_angles = this.angles = vectoangles(this.velocity); + this.angles = vectoangles(this.velocity); } else { @@ -209,9 +210,9 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) // projectiles no longer being able to lie on a bmodel this.move_nomonsters = MOVE_WORLDONLY; if (f & 0x40) - this.move_flags |= FL_ONGROUND; + SET_ONGROUND(this); else - this.move_flags &= ~FL_ONGROUND; + UNSET_ONGROUND(this); if (!this.move_time) { @@ -243,8 +244,6 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) this.gravity = ReadCoord(); else this.gravity = 0; // none - this.move_origin = this.origin; - this.move_velocity = this.velocity; } if (time == this.spawntime || (this.count & 0x80) || (f & 0x08)) @@ -332,7 +331,7 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) this.maxs = '0 0 0'; this.colormod = '0 0 0'; settouch(this, SUB_Stop); - this.move_movetype = MOVETYPE_TOSS; + set_movetype(this, MOVETYPE_TOSS); this.alphamod = 1; switch (this.cnt) @@ -340,12 +339,12 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) case PROJECTILE_ELECTRO: // only new engines support sound moving with object loopsound(this, CH_SHOTS_SINGLE, SND(ELECTRO_FLY), VOL_BASE, ATTEN_NORM); - this.mins = '0 0 -4'; - this.maxs = '0 0 -4'; - this.move_movetype = MOVETYPE_BOUNCE; + this.mins = '-4 -4 -4'; + this.maxs = '4 4 4'; + set_movetype(this, MOVETYPE_BOUNCE); settouch(this, func_null); - this.move_bounce_factor = WEP_CVAR_SEC(electro, bouncefactor); - this.move_bounce_stopspeed = WEP_CVAR_SEC(electro, bouncestop); + this.bouncefactor = WEP_CVAR_SEC(electro, bouncefactor); + this.bouncestop = WEP_CVAR_SEC(electro, bouncestop); break; case PROJECTILE_RPC: case PROJECTILE_ROCKET: @@ -360,10 +359,10 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) case PROJECTILE_GRENADE_BOUNCING: this.mins = '-3 -3 -3'; this.maxs = '3 3 3'; - this.move_movetype = MOVETYPE_BOUNCE; + set_movetype(this, MOVETYPE_BOUNCE); settouch(this, func_null); - this.move_bounce_factor = WEP_CVAR(mortar, bouncefactor); - this.move_bounce_stopspeed = WEP_CVAR(mortar, bouncestop); + this.bouncefactor = WEP_CVAR(mortar, bouncefactor); + this.bouncestop = WEP_CVAR(mortar, bouncestop); break; case PROJECTILE_SHAMBLER_LIGHTNING: this.mins = '-8 -8 -8'; @@ -378,21 +377,21 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) case PROJECTILE_PORTO_RED: this.colormod = '2 1 1'; this.alphamod = 0.5; - this.move_movetype = MOVETYPE_BOUNCE; + set_movetype(this, MOVETYPE_BOUNCE); settouch(this, func_null); break; case PROJECTILE_PORTO_BLUE: this.colormod = '1 1 2'; this.alphamod = 0.5; - this.move_movetype = MOVETYPE_BOUNCE; + set_movetype(this, MOVETYPE_BOUNCE); settouch(this, func_null); break; case PROJECTILE_HAGAR_BOUNCING: - this.move_movetype = MOVETYPE_BOUNCE; + set_movetype(this, MOVETYPE_BOUNCE); settouch(this, func_null); break; case PROJECTILE_CRYLINK_BOUNCING: - this.move_movetype = MOVETYPE_BOUNCE; + set_movetype(this, MOVETYPE_BOUNCE); settouch(this, func_null); break; case PROJECTILE_FIREBALL: @@ -402,7 +401,7 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) break; case PROJECTILE_FIREMINE: loopsound(this, CH_SHOTS_SINGLE, SND(FIREBALL_FLY), VOL_BASE, ATTEN_NORM); - this.move_movetype = MOVETYPE_BOUNCE; + set_movetype(this, MOVETYPE_BOUNCE); settouch(this, func_null); this.mins = '-4 -4 -4'; this.maxs = '4 4 4'; @@ -443,9 +442,9 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) this.mins = '0 0 -4'; this.maxs = '0 0 -4'; this.move_movetype = MOVETYPE_BOUNCE; - this.move_touch = func_null; - this.move_bounce_factor = WEP_CVAR_SEC(electro, bouncefactor); - this.move_bounce_stopspeed = WEP_CVAR_SEC(electro, bouncestop); + settouch(this, func_null); + this.bouncefactor = WEP_CVAR_SEC(electro, bouncefactor); + this.bouncestop = WEP_CVAR_SEC(electro, bouncestop); break; */ default: @@ -462,16 +461,16 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) if (this.gravity) { if (this.move_movetype == MOVETYPE_FLY) - this.move_movetype = MOVETYPE_TOSS; + set_movetype(this, MOVETYPE_TOSS); if (this.move_movetype == MOVETYPE_BOUNCEMISSILE) - this.move_movetype = MOVETYPE_BOUNCE; + set_movetype(this, MOVETYPE_BOUNCE); } else { if (this.move_movetype == MOVETYPE_TOSS) - this.move_movetype = MOVETYPE_FLY; + set_movetype(this, MOVETYPE_FLY); if (this.move_movetype == MOVETYPE_BOUNCE) - this.move_movetype = MOVETYPE_BOUNCEMISSILE; + set_movetype(this, MOVETYPE_BOUNCEMISSILE); } if (!(this.count & 0x80)) @@ -479,6 +478,7 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) this.classname = "csqcprojectile"; this.draw = Projectile_Draw; + if (isnew) IL_PUSH(g_drawables, this); this.entremove = Ent_RemoveProjectile; }