X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_lights.qc;h=425716d2da7cb92dc3001d2383947b7a4eab86dd;hb=0a980f57412cf2253cfd73c8c01a26fb04c87189;hp=796af16b13e5efe2a1a0307d32a0dc34d1cf3102;hpb=3d4a324cc2e15c1eb99209674942506eb998e2ec;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_lights.qc b/qcsrc/server/g_lights.qc index 796af16b1..425716d2d 100644 --- a/qcsrc/server/g_lights.qc +++ b/qcsrc/server/g_lights.qc @@ -36,50 +36,50 @@ flags: */ void dynlight_think(entity this) { - if(!self.owner) - remove(self); + if(!this.owner) + delete(this); - self.nextthink = time + 0.1; + this.nextthink = time + 0.1; } void dynlight_find_aiment(entity this) { entity targ; - if (!self.target) - objerror ("dynlight: no target to follow"); + if (!this.target) + objerror (this, "dynlight: no target to follow"); - targ = find(world, targetname, self.target); - self.movetype = MOVETYPE_FOLLOW; - self.aiment = targ; - self.owner = targ; - self.punchangle = targ.angles; - self.view_ofs = self.origin - targ.origin; - self.v_angle = self.angles - targ.angles; - setthink(self, dynlight_think); - self.nextthink = time + 0.1; + targ = find(NULL, targetname, this.target); + set_movetype(this, MOVETYPE_FOLLOW); + this.aiment = targ; + this.owner = targ; + this.punchangle = targ.angles; + this.view_ofs = this.origin - targ.origin; + this.v_angle = this.angles - targ.angles; + setthink(this, dynlight_think); + this.nextthink = time + 0.1; } void dynlight_find_path(entity this) { entity targ; - if (!self.target) - objerror ("dynlight: no target to follow"); + if (!this.target) + objerror (this, "dynlight: no target to follow"); - targ = find(world, targetname, self.target); - self.target = targ.target; - setorigin (self, targ.origin); - setthink(self, train_next); - self.nextthink = time + 0.1; + targ = find(NULL, targetname, this.target); + this.target = targ.target; + setorigin(this, targ.origin); + setthink(this, train_next); + this.nextthink = time + 0.1; } void dynlight_find_target(entity this) { entity targ; - if (!self.target) - objerror ("dynlight: no target to follow"); + if (!this.target) + objerror (this, "dynlight: no target to follow"); - targ = find(world, targetname, self.target); - setattachment(self, targ, self.dtagname); - self.owner = targ; - setthink(self, dynlight_think); - self.nextthink = time + 0.1; + targ = find(NULL, targetname, this.target); + setattachment(this, targ, this.dtagname); + this.owner = targ; + setthink(this, dynlight_think); + this.nextthink = time + 0.1; } void dynlight_use(entity this, entity actor, entity trigger) { @@ -97,7 +97,7 @@ spawnfunc(dynlight) this.lefty = this.light_lev; this.use = dynlight_use; setsize (this, '0 0 0', '0 0 0'); - setorigin (this, this.origin); + setorigin(this, this.origin); //this.pflags = PFLAGS_FULLDYNAMIC; this.solid = SOLID_NOT; //this.blocked = func_null; @@ -123,7 +123,7 @@ spawnfunc(dynlight) if (this.target) // if (!(this.spawnflags & DFOLLOW)) { - this.movetype = MOVETYPE_NOCLIP; + set_movetype(this, MOVETYPE_NOCLIP); if (!this.speed) this.speed = 100; InitializeEntity(this, dynlight_find_path, INITPRIO_FINDTARGET);