if(this.ItemStatus & ITS_ANIMATE2)
this.avelocity = '0 -90 0';
}
+
+ // delay is for blocking item's position for a while;
+ // it's a workaround for dropped weapons that receive the position
+ // another time right after they spawn overriding animation position
+ this.onground_time = time + 0.5;
}
}
else if (autocvar_cl_animate_items)
if(this.ItemStatus & ITS_ANIMATE1)
{
this.angles += this.avelocity * frametime;
- setorigin(this, '0 0 10' + this.oldorigin + '0 0 8' * sin(time * 2));
+ float fade_in = bound(0, time - this.onground_time, 1);
+ setorigin(this, this.oldorigin + fade_in * ('0 0 10' + '0 0 8' * sin((time - this.onground_time) * 2)));
}
if(this.ItemStatus & ITS_ANIMATE2)
{
this.angles += this.avelocity * frametime;
- setorigin(this, '0 0 8' + this.oldorigin + '0 0 4' * sin(time * 3));
+ float fade_in = bound(0, time - this.onground_time, 1);
+ setorigin(this, this.oldorigin + fade_in * ('0 0 8' + '0 0 4' * sin((time - this.onground_time) * 3)));
}
}