From d074ccfccf63ad3982b15aa92e5dcc330fb8a6fe Mon Sep 17 00:00:00 2001 From: div0 Date: Sun, 5 Apr 2009 12:20:22 +0000 Subject: [PATCH] fix negative pointparticles impulse git-svn-id: svn://svn.icculus.org/nexuiz/trunk@6432 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/client/particles.qc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/data/qcsrc/client/particles.qc b/data/qcsrc/client/particles.qc index ffb25cf07..9fc687d7c 100644 --- a/data/qcsrc/client/particles.qc +++ b/data/qcsrc/client/particles.qc @@ -101,13 +101,11 @@ void Ent_PointParticles_Remove() void Ent_PointParticles() { float f; + vector v; f = ReadByte(); if(f & 2) { self.impulse = ReadCoord(); // density (<0: point, >0: volume) - self.absolute = (self.impulse >= 0); - if(!self.absolute) - self.impulse *= -self.maxs_x * self.maxs_y * self.maxs_z / 262144; // relative: particles per 64^3 cube } if(f & 4) { @@ -147,6 +145,16 @@ void Ent_PointParticles() self.noise = strzone(ReadString()); } + if(f & 2) + { + self.absolute = (self.impulse >= 0); + if(!self.absolute) + { + v = self.maxs - self.mins; + self.impulse *= -v_x * v_y * v_z / 262144; // relative: particles per 64^3 cube + } + } + setorigin(self, self.origin); setsize(self, self.mins, self.maxs); self.solid = SOLID_NOT; -- 2.39.2