X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Feffects%2Fall.qc;h=9ee58f5fe1c07323097ca2c08ff2f9df091bf34f;hb=24151b08c3de08e46dace760129f0526a455be4b;hp=d229b05100a751fb50a8795dbc11997d52a953c9;hpb=d492869ab1f18e05121529b7bcffcb637d13994c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/effects/all.qc b/qcsrc/common/effects/all.qc index d229b0510..9ee58f5fe 100644 --- a/qcsrc/common/effects/all.qc +++ b/qcsrc/common/effects/all.qc @@ -4,25 +4,18 @@ REGISTER_NET_TEMP(net_effect) #ifdef CSQC NET_HANDLE(net_effect, bool isNew) { - int net_name = (Effects_COUNT >= 255) ? ReadShort() : ReadByte(); + int net_name = (REGISTRY_COUNT(Effects) >= 255) ? ReadShort() : ReadByte(); - entity eff = Effects_from(net_name); + entity eff = REGISTRY_GET(Effects, net_name); vector vel = '0 0 0'; int eff_cnt = 1; bool eff_trail = eff.eent_eff_trail; - vector v; - v_x = ReadCoord(); - v_y = ReadCoord(); - v_z = ReadCoord(); + vector v = ReadVector(); bool use_vel = ReadByte(); if(use_vel) - { - vel_x = ReadCoord(); - vel_y = ReadCoord(); - vel_z = ReadCoord(); - } + vel = ReadVector(); if(!eff_trail) eff_cnt = ReadByte(); @@ -41,20 +34,16 @@ bool Net_Write_Effect(entity this, entity client, int sf) int channel = MSG_ONE; msg_entity = client; WriteHeader(channel, net_effect); - (Effects_COUNT >= 255) + (REGISTRY_COUNT(Effects) >= 255) ? WriteShort(channel, this.m_id) : WriteByte(channel, this.m_id); - WriteCoord(channel, this.eent_net_location_x); - WriteCoord(channel, this.eent_net_location_y); - WriteCoord(channel, this.eent_net_location_z); + WriteVector(channel, this.eent_net_location); // attempt to save a tiny bit more bandwidth by not sending velocity if it isn't set if(this.eent_net_velocity) { WriteByte(channel, true); - WriteCoord(channel, this.eent_net_velocity_x); - WriteCoord(channel, this.eent_net_velocity_y); - WriteCoord(channel, this.eent_net_velocity_z); + WriteVector(channel, this.eent_net_velocity); } else { WriteByte(channel, false); } @@ -86,11 +75,11 @@ void Send_Effect_(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt) Send_Effect(it, eff_loc, eff_vel, eff_cnt); return; }); - // revert to engine handling + // revert to engine handling TODO: send the effect name and draw it on the client side? not as light on networking, but resolves the use of server side effects __pointparticles(_particleeffectnum(eff_name), eff_loc, eff_vel, eff_cnt); } #endif -#ifdef EFFECTINFO +#if ENABLE_EFFECTINFO #include "effectinfo.qc" #endif