X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmutators%2Fmutator%2Fnades%2Fnet.qc;h=1fdf5fd7aad1a5e2ef0e85c68d326da0fb6845bc;hb=4096ab0591cbd7fac803e022375cd3c221511d8b;hp=269574cda4be6fdcab792156a3dfbbf61cfe25e0;hpb=df2fe9b28cb6210b671bec6d5ae834ff4eb2e2db;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mutators/mutator/nades/net.qc b/qcsrc/common/mutators/mutator/nades/net.qc index 269574cda..1fdf5fd7a 100644 --- a/qcsrc/common/mutators/mutator/nades/net.qc +++ b/qcsrc/common/mutators/mutator/nades/net.qc @@ -1,6 +1,8 @@ -#include "nades.qh" +#include "net.qh" + +#ifdef GAMEQC -#ifdef IMPLEMENTATION +#include "nades.qh" #ifdef CSQC .float ltime; @@ -13,11 +15,13 @@ void orb_draw(entity this) this.alpha = (this.ltime - time) / this.orb_lifetime; this.scale = min((1 - this.alpha)*this.orb_lifetime*4,1)*this.orb_radius; + this.angles = this.angles + dt * this.avelocity; } void orb_setup(entity e) { setmodel(e, MDL_NADE_ORB); + e.skin = 1; setorigin(e, e.origin); @@ -27,12 +31,13 @@ void orb_setup(entity e) e.orb_radius = e.orb_radius/model_radius*0.6; e.draw = orb_draw; - e.health = 255; - e.movetype = MOVETYPE_NONE; + IL_PUSH(g_drawables, e); + SetResourceAmountExplicit(e, RESOURCE_HEALTH, 255); + set_movetype(e, MOVETYPE_NONE); e.solid = SOLID_NOT; e.drawmask = MASK_NORMAL; e.scale = 0.01; - e.avelocity = e.move_avelocity = '7 0 11'; + e.avelocity = '7 0 11'; e.renderflags |= RF_ADDITIVE; } #endif @@ -45,13 +50,9 @@ NET_HANDLE(Nade_Orb, bool isNew) Net_Accept(Nade_Orb); int sf = ReadByte(); if (sf & 1) { - this.origin_x = ReadCoord(); - this.origin_y = ReadCoord(); - this.origin_z = ReadCoord(); + this.origin = ReadVector(); setorigin(this, this.origin); - this.colormod_x = ReadCoord(); - this.colormod_y = ReadCoord(); - this.colormod_z = ReadCoord(); + this.colormod = ReadVector(); this.orb_lifetime = ReadByte(); this.orb_radius = ReadShort(); this.ltime = time + ReadByte()/10.0; @@ -69,13 +70,9 @@ bool orb_send(entity this, entity to, int sf) WriteHeader(channel, Nade_Orb); WriteByte(channel, sf); if (sf & 1) { - WriteCoord(channel, this.origin.x); - WriteCoord(channel, this.origin.y); - WriteCoord(channel, this.origin.z); + WriteVector(channel, this.origin); - WriteCoord(channel, this.colormod.x); - WriteCoord(channel, this.colormod.y); - WriteCoord(channel, this.colormod.z); + WriteVector(channel, this.colormod); WriteByte(channel, this.orb_lifetime); //WriteByte(MSG_ENTITY, this.ltime - time + 1);