X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fweapons%2Fprojectile.qc;h=a8cdcf90c5724877f25a045e16dcb25800eeaae4;hp=3d2d32d9af16bff4eeb0c6ca89d1e7951c71e1c5;hb=ce80a3d3800ee2f5ce8a8d93ccb6b835a46ec5f6;hpb=ea21cf9661f922f64dd6cc698f3aa717bb70c3ab diff --git a/qcsrc/client/weapons/projectile.qc b/qcsrc/client/weapons/projectile.qc index 3d2d32d9af..a8cdcf90c5 100644 --- a/qcsrc/client/weapons/projectile.qc +++ b/qcsrc/client/weapons/projectile.qc @@ -1,18 +1,14 @@ #include "projectile.qh" -#include "../autocvars.qh" -#include "../defs.qh" -#include "../main.qh" -#include "../mutators/events.qh" - +#include +#include #include -#include #include +#include +#include #include #include - #include - #include .float alpha; @@ -46,12 +42,11 @@ void Projectile_DrawTrail(entity this, vector to) if (this.traileffect) { particles_alphamin = particles_alphamax = particles_fade = sqrt(this.alpha); - boxparticles(particleeffectnum(Effects_from(this.traileffect)), this, from, to, this.velocity, this.velocity, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE | PARTICLES_DRAWASTRAIL); + entity eff = REGISTRY_GET(Effects, this.traileffect); + boxparticles(particleeffectnum(eff), this, from, to, this.velocity, this.velocity, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE | PARTICLES_DRAWASTRAIL); } } -bool Projectile_isnade(int proj); // TODO: remove - void Projectile_Draw(entity this) { vector rot; @@ -171,7 +166,7 @@ void Projectile_Draw(entity this) void loopsound(entity e, int ch, Sound samp, float vol, float attn) { - TC(int, ch); + TC(int, ch); if (e.silent) return; @@ -236,15 +231,11 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) if (f & 1) { - this.origin_x = ReadCoord(); - this.origin_y = ReadCoord(); - this.origin_z = ReadCoord(); + this.origin = ReadVector(); setorigin(this, this.origin); if (this.count & 0x80) { - this.velocity_x = ReadCoord(); - this.velocity_y = ReadCoord(); - this.velocity_z = ReadCoord(); + this.velocity = ReadVector(); if (f & 0x10) this.gravity = ReadCoord(); else @@ -269,23 +260,23 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) this.fade_rate = 0; } - int myteam = ReadByte(); - this.team = myteam - 1; + int proj_team = ReadByte(); + this.team = proj_team - 1; if(teamplay) { - if(myteam) + if(proj_team) this.colormap = (this.team) * 0x11; // note: team - 1 on server (client uses different numbers) else this.colormap = 0x00; this.colormap |= BIT(10); // RENDER_COLORMAPPED } else - this.colormap = myteam; + this.colormap = proj_team; // TODO: projectiles use glowmaps for their color, not teams #if 0 if(this.colormap > 0) - this.glowmod = colormapPaletteColor(this.colormap & 0x0F, true) * 2; + this.glowmod = colormapPaletteColor(this.colormap & 0x0F, true); else this.glowmod = '1 1 1'; #endif @@ -500,7 +491,6 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) if (!(this.count & 0x80)) InterpolateOrigin_Note(this); - this.classname = "csqcprojectile"; this.draw = Projectile_Draw; if (isnew) IL_PUSH(g_drawables, this); this.entremove = Ent_RemoveProjectile;