particle outside world fix

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1664 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2008-02-17 09:56:38 +00:00
parent 828e443728
commit 72855d64d8
+13 -1
View File
@@ -225,6 +225,8 @@ void particlereset()
void newparticle(const vec &o, const vec &d, int fade, int type)
{
if(OUTBORD((int)o.x, (int)o.y)) return;
if(!parempty)
{
particle *ps = new particle[256];
@@ -450,7 +452,17 @@ void render_particles(int time)
else
{
if(pt.gr) p->o.z -= ((lastmillis-p->millis)/3.0f)*time/(pt.gr*10000);
if(pt.type==PT_PART || pt.type==PT_BLOOD) p->o.add(vec(p->d).mul(time/20000.0f));
if(pt.type==PT_PART || pt.type==PT_BLOOD)
{
p->o.add(vec(p->d).mul(time/20000.0f));
if(OUTBORD((int)p->o.x, (int)p->o.y))
{
*pp = p->next;
p->next = parempty;
parempty = p;
continue;
}
}
if(pt.type==PT_BLOOD)
{
sqr *s = S((int)p->o.x, (int)p->o.y);