#if defined(CSQC)
#include "../../../client/_all.qh"
- #include "../../buffs.qh"
+ #include "../../buffs/all.qh"
#include "../../../csqcmodellib/interpolate.qh"
#include "../../../client/main.qh"
#include "../../../csqcmodellib/cl_model.qh"
#ifdef SVQC
.float modelscale;
void misc_laser_aim()
-{
+{SELFPARAM();
vector a;
if(self.enemy)
{
}
void misc_laser_init()
-{
+{SELFPARAM();
if(self.target != "")
self.enemy = find(world, targetname, self.target);
}
.entity pusher;
void misc_laser_think()
-{
+{SELFPARAM();
vector o;
- entity oldself;
entity hitent;
vector hitloc;
{
self.count = 1;
- oldself = self;
- self = self.enemy;
- activator = self.pusher;
- SUB_UseTargets();
- self = oldself;
+ activator = self.enemy.pusher;
+ WITH(entity, self, self.enemy, SUB_UseTargets());
}
}
else
{
self.count = 0;
- oldself = self;
- self = self.enemy;
- activator = self.pusher;
- SUB_UseTargets();
- self = oldself;
+ activator = self.enemy.pusher;
+ WITH(entity, self, self.enemy, SUB_UseTargets());
}
}
}
}
}
-float laser_SendEntity(entity to, float fl)
+bool laser_SendEntity(entity this, entity to, float fl)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_LASER);
fl = fl - (fl & 0xF0); // use that bit to indicate finite length laser
damage per second (-1 for a laser that kills immediately)
*/
void laser_use()
-{
+{SELFPARAM();
self.state = !self.state;
self.SendFlags |= 4;
misc_laser_aim();
}
void laser_reset()
-{
+{SELFPARAM();
if(self.spawnflags & 1)
self.state = 1;
else
self.state = 0;
}
-void spawnfunc_misc_laser()
+spawnfunc(misc_laser)
{
if(self.mdl)
{
self.cnt = -1;
else
{
- self.cnt = particleeffectnum(self.mdl);
+ self.cnt = _particleeffectnum(self.mdl);
if(self.cnt < 0)
if(self.dmg)
- self.cnt = particleeffectnum("laser_deadly");
+ self.cnt = particleeffectnum(EFFECT_LASER_DEADLY);
}
}
else if(!self.cnt)
{
if(self.dmg)
- self.cnt = particleeffectnum("laser_deadly");
+ self.cnt = particleeffectnum(EFFECT_LASER_DEADLY);
else
self.cnt = -1;
}
class(Laser) .float scale; // scaling factor of the thickness
class(Laser) .float modelscale; // scaling factor of the dlight
-void Draw_Laser()
+void Draw_Laser(entity this)
{
if(!self.state)
return;
}
void Ent_Laser()
-{
+{SELFPARAM();
InterpolateOrigin_Undo();
// 30 bytes, or 13 bytes for just moving