X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Fmisc%2Flaser.qc;h=cc15516d1d14e067e3ef7c5e08c72c4427fd18a1;hb=2ce2f533321210bef1f49b1245a8ea1fda15eea4;hp=2d9f0951954438bbae044e6b5138f58ad0334064;hpb=99c1b6ca80a69e112d410ee493d62f757b2c6df8;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/misc/laser.qc b/qcsrc/common/triggers/misc/laser.qc index 2d9f09519..cc15516d1 100644 --- a/qcsrc/common/triggers/misc/laser.qc +++ b/qcsrc/common/triggers/misc/laser.qc @@ -1,6 +1,5 @@ #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" @@ -11,7 +10,7 @@ #ifdef SVQC .float modelscale; void misc_laser_aim() -{ +{SELFPARAM(); vector a; if(self.enemy) { @@ -50,16 +49,15 @@ void misc_laser_aim() } 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; @@ -98,11 +96,8 @@ void misc_laser_think() { 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 @@ -111,11 +106,8 @@ void misc_laser_think() { 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()); } } } @@ -130,7 +122,7 @@ void misc_laser_think() } } -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 @@ -196,21 +188,21 @@ Keys: 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) { @@ -218,16 +210,16 @@ void spawnfunc_misc_laser() 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; } @@ -279,7 +271,7 @@ class(Laser) .float alpha; 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; @@ -331,7 +323,7 @@ void Draw_Laser() } void Ent_Laser() -{ +{SELFPARAM(); InterpolateOrigin_Undo(); // 30 bytes, or 13 bytes for just moving