| 206 | } |
| 207 | |
| 208 | void sendNetFx(const Entity &src, BitStream &bs) |
| 209 | { |
| 210 | bs.StorePackedBits(1, src.m_net_fx.size()); // num fx |
| 211 | for(const NetFx &fx : src.m_net_fx) |
| 212 | { |
| 213 | // refactor as fx.serializeto() ? |
| 214 | bs.StoreBits(8, fx.command); // command |
| 215 | bs.StoreBits(32, fx.net_id); // NetID |
| 216 | bs.StoreBits(1, fx.pitch_to_target); |
| 217 | storePackedBitsConditional(bs, 10, fx.handle); // handle |
| 218 | storeBitsConditional(bs, 4, fx.client_timer); // client timer |
| 219 | storeBitsConditional(bs, 32, fx.client_trigger_fx); // clientTriggerFx |
| 220 | storeFloatConditional(bs, fx.duration); // duration |
| 221 | storeFloatConditional(bs, fx.radius); // radius |
| 222 | storeBitsConditional(bs, 4, fx.power); // power |
| 223 | storeBitsConditional(bs, 32, fx.debris); // debris |
| 224 | |
| 225 | storeBitsConditional(bs, 2, fx.origin.type_is_location); // origiType |
| 226 | if(fx.origin.type_is_location) |
| 227 | { |
| 228 | bs.StoreFloat(fx.target.pos.x); // origin Pos |
| 229 | bs.StoreFloat(fx.target.pos.y); |
| 230 | bs.StoreFloat(fx.target.pos.z); |
| 231 | } |
| 232 | else |
| 233 | { |
| 234 | storePackedBitsConditional(bs, 8, fx.origin.ent_idx); // origin entity |
| 235 | bs.StorePackedBits(2,fx.bone_id); // bone id |
| 236 | } |
| 237 | |
| 238 | storeBitsConditional(bs, 2, fx.target.type_is_location); // target type |
| 239 | if(fx.target.type_is_location) |
| 240 | { |
| 241 | bs.StoreFloat(fx.target.pos.x); // targetPos x |
| 242 | bs.StoreFloat(fx.target.pos.y); // targetPos y |
| 243 | bs.StoreFloat(fx.target.pos.z); // targetPos z |
| 244 | } |
| 245 | else |
| 246 | storePackedBitsConditional(bs, 12, fx.target.ent_idx); // target entity |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | void sendCostumes(const Entity &src,BitStream &bs) |
| 251 | { |
no test coverage detected