From: Mario Date: Thu, 19 May 2016 20:48:42 +0000 (+1000) Subject: Clean out self from most NET_HANDLEs X-Git-Tag: xonotic-v0.8.2~921 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=47ac01ac700f05fceef988e8051282f0d41ddf6c;p=xonotic%2Fxonotic-data.pk3dir.git Clean out self from most NET_HANDLEs --- diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 2016944bb..15cb36c92 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -152,134 +152,134 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew) if(sf & ISF_LOCATION) { - self.origin_x = ReadCoord(); - self.origin_y = ReadCoord(); - self.origin_z = ReadCoord(); - setorigin(self, self.origin); - self.oldorigin = self.origin; + this.origin_x = ReadCoord(); + this.origin_y = ReadCoord(); + this.origin_z = ReadCoord(); + setorigin(this, this.origin); + this.oldorigin = this.origin; } if(sf & ISF_ANGLES) { - self.angles_x = ReadAngle(); - self.angles_y = ReadAngle(); - self.angles_z = ReadAngle(); - self.move_angles = self.angles; + this.angles_x = ReadAngle(); + this.angles_y = ReadAngle(); + this.angles_z = ReadAngle(); + this.move_angles = this.angles; } if(sf & ISF_SIZE) { float use_bigsize = ReadByte(); - setsize(self, '-16 -16 0', (use_bigsize) ? '16 16 48' : '16 16 32'); + setsize(this, '-16 -16 0', (use_bigsize) ? '16 16 48' : '16 16 32'); } if(sf & ISF_STATUS) // need to read/write status frist so model can handle simple, fb etc. { - self.ItemStatus = ReadByte(); + this.ItemStatus = ReadByte(); - Item_SetAlpha(self); + Item_SetAlpha(this); if(autocvar_cl_fullbright_items) - if(self.ItemStatus & ITS_ALLOWFB) - self.effects |= EF_FULLBRIGHT; + if(this.ItemStatus & ITS_ALLOWFB) + this.effects |= EF_FULLBRIGHT; - if(self.ItemStatus & ITS_POWERUP) + if(this.ItemStatus & ITS_POWERUP) { - if(self.ItemStatus & ITS_AVAILABLE) - self.effects |= (EF_ADDITIVE | EF_FULLBRIGHT); + if(this.ItemStatus & ITS_AVAILABLE) + this.effects |= (EF_ADDITIVE | EF_FULLBRIGHT); else - self.effects &= ~(EF_ADDITIVE | EF_FULLBRIGHT); + this.effects &= ~(EF_ADDITIVE | EF_FULLBRIGHT); } } if(sf & ISF_MODEL) { - self.drawmask = MASK_NORMAL; - self.move_movetype = MOVETYPE_TOSS; - self.draw = ItemDraw; - self.solid = SOLID_TRIGGER; - //self.move_flags |= FL_ITEM; + this.drawmask = MASK_NORMAL; + this.move_movetype = MOVETYPE_TOSS; + this.draw = ItemDraw; + this.solid = SOLID_TRIGGER; + //this.move_flags |= FL_ITEM; bool use_bigsize = ReadByte(); - self.fade_end = ReadShort(); - self.fade_start = ReadShort(); - if(self.fade_start && !autocvar_cl_items_nofade) - setpredraw(self, Item_PreDraw); + this.fade_end = ReadShort(); + this.fade_start = ReadShort(); + if(this.fade_start && !autocvar_cl_items_nofade) + setpredraw(this, Item_PreDraw); - if(self.mdl) - strunzone(self.mdl); + if(this.mdl) + strunzone(this.mdl); - self.mdl = ""; + this.mdl = ""; string _fn = ReadString(); - if(autocvar_cl_simple_items && (self.ItemStatus & ITS_ALLOWSI)) + if(autocvar_cl_simple_items && (this.ItemStatus & ITS_ALLOWSI)) { string _fn2 = substring(_fn, 0 , strlen(_fn) -4); - self.draw = ItemDrawSimple; + this.draw = ItemDrawSimple; if(fexists(sprintf("%s%s.md3", _fn2, autocvar_cl_simpleitems_postfix))) - self.mdl = strzone(sprintf("%s%s.md3", _fn2, autocvar_cl_simpleitems_postfix)); + this.mdl = strzone(sprintf("%s%s.md3", _fn2, autocvar_cl_simpleitems_postfix)); else if(fexists(sprintf("%s%s.dpm", _fn2, autocvar_cl_simpleitems_postfix))) - self.mdl = strzone(sprintf("%s%s.dpm", _fn2, autocvar_cl_simpleitems_postfix)); + this.mdl = strzone(sprintf("%s%s.dpm", _fn2, autocvar_cl_simpleitems_postfix)); else if(fexists(sprintf("%s%s.iqm", _fn2, autocvar_cl_simpleitems_postfix))) - self.mdl = strzone(sprintf("%s%s.iqm", _fn2, autocvar_cl_simpleitems_postfix)); + this.mdl = strzone(sprintf("%s%s.iqm", _fn2, autocvar_cl_simpleitems_postfix)); else if(fexists(sprintf("%s%s.mdl", _fn2, autocvar_cl_simpleitems_postfix))) - self.mdl = strzone(sprintf("%s%s.mdl", _fn2, autocvar_cl_simpleitems_postfix)); + this.mdl = strzone(sprintf("%s%s.mdl", _fn2, autocvar_cl_simpleitems_postfix)); else { - self.draw = ItemDraw; + this.draw = ItemDraw; LOG_TRACE("Simple item requested for ", _fn, " but no model exists for it\n"); } } - if(self.draw != ItemDrawSimple) - self.mdl = strzone(_fn); + if(this.draw != ItemDrawSimple) + this.mdl = strzone(_fn); - if(self.mdl == "") - LOG_TRACE("^1WARNING!^7 self.mdl is unset for item ", self.classname, ", tell tZork about this!\n"); + if(this.mdl == "") + LOG_TRACE("^1WARNING!^7 this.mdl is unset for item ", this.classname, ", tell tZork about this!\n"); - precache_model(self.mdl); - _setmodel(self, self.mdl); + precache_model(this.mdl); + _setmodel(this, this.mdl); - setsize(self, '-16 -16 0', (use_bigsize) ? '16 16 48' : '16 16 32'); + setsize(this, '-16 -16 0', (use_bigsize) ? '16 16 48' : '16 16 32'); } if(sf & ISF_COLORMAP) - self.colormap = ReadShort(); + this.colormap = ReadShort(); if(sf & ISF_DROP) { - self.gravity = 1; - self.pushable = true; - //self.move_angles = '0 0 0'; - self.move_movetype = MOVETYPE_TOSS; - self.move_velocity_x = ReadCoord(); - self.move_velocity_y = ReadCoord(); - self.move_velocity_z = ReadCoord(); - self.velocity = self.move_velocity; - self.move_origin = self.oldorigin; - - if(!self.move_time) + this.gravity = 1; + this.pushable = true; + //this.move_angles = '0 0 0'; + this.move_movetype = MOVETYPE_TOSS; + this.move_velocity_x = ReadCoord(); + this.move_velocity_y = ReadCoord(); + this.move_velocity_z = ReadCoord(); + this.velocity = this.move_velocity; + this.move_origin = this.oldorigin; + + if(!this.move_time) { - self.move_time = time; - self.spawntime = time; + this.move_time = time; + this.spawntime = time; } else - self.move_time = max(self.move_time, time); + this.move_time = max(this.move_time, time); } if(autocvar_cl_animate_items) { - if(self.ItemStatus & ITS_ANIMATE1) - self.move_avelocity = '0 180 0'; + if(this.ItemStatus & ITS_ANIMATE1) + this.move_avelocity = '0 180 0'; - if(self.ItemStatus & ITS_ANIMATE2) - self.move_avelocity = '0 -90 0'; + if(this.ItemStatus & ITS_ANIMATE2) + this.move_avelocity = '0 -90 0'; } - self.entremove = ItemRemove; + this.entremove = ItemRemove; return true; } diff --git a/qcsrc/common/triggers/func/conveyor.qc b/qcsrc/common/triggers/func/conveyor.qc index d3c1abf73..dd7c129d6 100644 --- a/qcsrc/common/triggers/func/conveyor.qc +++ b/qcsrc/common/triggers/func/conveyor.qc @@ -149,53 +149,53 @@ spawnfunc(func_conveyor) void conveyor_draw(entity this) { WITHSELF(this, conveyor_think()); } -void conveyor_init() -{SELFPARAM(); - self.draw = conveyor_draw; - self.drawmask = MASK_NORMAL; +void conveyor_init(entity this) +{ + this.draw = conveyor_draw; + this.drawmask = MASK_NORMAL; - self.movetype = MOVETYPE_NONE; - self.model = ""; - self.solid = SOLID_TRIGGER; - self.move_origin = self.origin; - self.move_time = time; + this.movetype = MOVETYPE_NONE; + this.model = ""; + this.solid = SOLID_TRIGGER; + this.move_origin = this.origin; + this.move_time = time; } NET_HANDLE(ENT_CLIENT_CONVEYOR, bool isnew) { - float sf = ReadByte(); + int sf = ReadByte(); if(sf & 1) { - self.warpzone_isboxy = ReadByte(); - self.origin_x = ReadCoord(); - self.origin_y = ReadCoord(); - self.origin_z = ReadCoord(); - setorigin(self, self.origin); - - self.mins_x = ReadCoord(); - self.mins_y = ReadCoord(); - self.mins_z = ReadCoord(); - self.maxs_x = ReadCoord(); - self.maxs_y = ReadCoord(); - self.maxs_z = ReadCoord(); - setsize(self, self.mins, self.maxs); - - self.movedir_x = ReadCoord(); - self.movedir_y = ReadCoord(); - self.movedir_z = ReadCoord(); - - self.speed = ReadByte(); - self.state = ReadByte(); - - self.targetname = strzone(ReadString()); - self.target = strzone(ReadString()); - - conveyor_init(); + this.warpzone_isboxy = ReadByte(); + this.origin_x = ReadCoord(); + this.origin_y = ReadCoord(); + this.origin_z = ReadCoord(); + setorigin(this, this.origin); + + this.mins_x = ReadCoord(); + this.mins_y = ReadCoord(); + this.mins_z = ReadCoord(); + this.maxs_x = ReadCoord(); + this.maxs_y = ReadCoord(); + this.maxs_z = ReadCoord(); + setsize(this, this.mins, this.maxs); + + this.movedir_x = ReadCoord(); + this.movedir_y = ReadCoord(); + this.movedir_z = ReadCoord(); + + this.speed = ReadByte(); + this.state = ReadByte(); + + this.targetname = strzone(ReadString()); + this.target = strzone(ReadString()); + + conveyor_init(this); } if(sf & 2) - self.state = ReadByte(); + this.state = ReadByte(); return true; } diff --git a/qcsrc/common/triggers/func/door.qc b/qcsrc/common/triggers/func/door.qc index 7fe9ba55c..c4844b4df 100644 --- a/qcsrc/common/triggers/func/door.qc +++ b/qcsrc/common/triggers/func/door.qc @@ -802,7 +802,7 @@ void door_draw(entity this) NET_HANDLE(ENT_CLIENT_DOOR, bool isnew) { - float sf = ReadByte(); + int sf = ReadByte(); if(sf & SF_TRIGGER_INIT) { @@ -812,7 +812,7 @@ NET_HANDLE(ENT_CLIENT_DOOR, bool isnew) this.mdl = strzone(ReadString()); _setmodel(this, this.mdl); - trigger_common_read(true); + trigger_common_read(this, true); vector v; diff --git a/qcsrc/common/triggers/func/ladder.qc b/qcsrc/common/triggers/func/ladder.qc index ea8af7198..570ef3bad 100644 --- a/qcsrc/common/triggers/func/ladder.qc +++ b/qcsrc/common/triggers/func/ladder.qc @@ -72,7 +72,7 @@ NET_HANDLE(ENT_CLIENT_LADDER, bool isnew) this.skin = ReadByte(); this.speed = ReadCoord(); - trigger_common_read(false); + trigger_common_read(this, false); this.solid = SOLID_TRIGGER; this.move_touch = func_ladder_touch; diff --git a/qcsrc/common/triggers/func/plat.qc b/qcsrc/common/triggers/func/plat.qc index 02822e7d2..7e2ae74aa 100644 --- a/qcsrc/common/triggers/func/plat.qc +++ b/qcsrc/common/triggers/func/plat.qc @@ -142,7 +142,7 @@ NET_HANDLE(ENT_CLIENT_PLAT, bool isnew) this.model = strzone(ReadString()); _setmodel(this, this.model); - trigger_common_read(true); + trigger_common_read(this, true); this.pos1_x = ReadCoord(); this.pos1_y = ReadCoord(); diff --git a/qcsrc/common/triggers/func/pointparticles.qc b/qcsrc/common/triggers/func/pointparticles.qc index 9cec88f99..fa77082b2 100644 --- a/qcsrc/common/triggers/func/pointparticles.qc +++ b/qcsrc/common/triggers/func/pointparticles.qc @@ -279,105 +279,105 @@ NET_HANDLE(ENT_CLIENT_POINTPARTICLES, bool isnew) if(f & 2) { i = ReadCoord(); // density (<0: point, >0: volume) - if(i && !self.impulse && (self.cnt || self.mdl)) // self.cnt check is so it only happens if the ent already existed - self.just_toggled = 1; - self.impulse = i; + if(i && !this.impulse && (this.cnt || this.mdl)) // this.cnt check is so it only happens if the ent already existed + this.just_toggled = 1; + this.impulse = i; } if(f & 4) { - self.origin_x = ReadCoord(); - self.origin_y = ReadCoord(); - self.origin_z = ReadCoord(); + this.origin_x = ReadCoord(); + this.origin_y = ReadCoord(); + this.origin_z = ReadCoord(); } if(f & 1) { - self.modelindex = ReadShort(); + this.modelindex = ReadShort(); if(f & 0x80) { - if(self.modelindex) + if(this.modelindex) { - self.mins_x = ReadCoord(); - self.mins_y = ReadCoord(); - self.mins_z = ReadCoord(); - self.maxs_x = ReadCoord(); - self.maxs_y = ReadCoord(); - self.maxs_z = ReadCoord(); + this.mins_x = ReadCoord(); + this.mins_y = ReadCoord(); + this.mins_z = ReadCoord(); + this.maxs_x = ReadCoord(); + this.maxs_y = ReadCoord(); + this.maxs_z = ReadCoord(); } else { - self.mins = '0 0 0'; - self.maxs_x = ReadCoord(); - self.maxs_y = ReadCoord(); - self.maxs_z = ReadCoord(); + this.mins = '0 0 0'; + this.maxs_x = ReadCoord(); + this.maxs_y = ReadCoord(); + this.maxs_z = ReadCoord(); } } else { - self.mins = self.maxs = '0 0 0'; + this.mins = this.maxs = '0 0 0'; } - self.cnt = ReadShort(); // effect number - self.mdl = strzone(ReadString()); // effect string + this.cnt = ReadShort(); // effect number + this.mdl = strzone(ReadString()); // effect string if(f & 0x20) { - self.velocity = decompressShortVector(ReadShort()); - self.movedir = decompressShortVector(ReadShort()); + this.velocity = decompressShortVector(ReadShort()); + this.movedir = decompressShortVector(ReadShort()); } else { - self.velocity = self.movedir = '0 0 0'; + this.velocity = this.movedir = '0 0 0'; } if(f & 0x40) { - self.waterlevel = ReadShort() / 16.0; - self.count = ReadByte() / 16.0; + this.waterlevel = ReadShort() / 16.0; + this.count = ReadByte() / 16.0; } else { - self.waterlevel = 0; - self.count = 1; + this.waterlevel = 0; + this.count = 1; } - if(self.noise) - strunzone(self.noise); - if(self.bgmscript) - strunzone(self.bgmscript); - self.noise = strzone(ReadString()); - if(self.noise != "") + if(this.noise) + strunzone(this.noise); + if(this.bgmscript) + strunzone(this.bgmscript); + this.noise = strzone(ReadString()); + if(this.noise != "") { - self.atten = ReadByte() / 64.0; - self.volume = ReadByte() / 255.0; + this.atten = ReadByte() / 64.0; + this.volume = ReadByte() / 255.0; } - self.bgmscript = strzone(ReadString()); - if(self.bgmscript != "") + this.bgmscript = strzone(ReadString()); + if(this.bgmscript != "") { - self.bgmscriptattack = ReadByte() / 64.0; - self.bgmscriptdecay = ReadByte() / 64.0; - self.bgmscriptsustain = ReadByte() / 255.0; - self.bgmscriptrelease = ReadByte() / 64.0; + this.bgmscriptattack = ReadByte() / 64.0; + this.bgmscriptdecay = ReadByte() / 64.0; + this.bgmscriptsustain = ReadByte() / 255.0; + this.bgmscriptrelease = ReadByte() / 64.0; } - BGMScript_InitEntity(self); + BGMScript_InitEntity(this); } return = true; if(f & 2) { - self.absolute = (self.impulse >= 0); - if(!self.absolute) + this.absolute = (this.impulse >= 0); + if(!this.absolute) { - v = self.maxs - self.mins; - self.impulse *= -v.x * v.y * v.z / 262144; // relative: particles per 64^3 cube + v = this.maxs - this.mins; + this.impulse *= -v.x * v.y * v.z / 262144; // relative: particles per 64^3 cube } } if(f & 0x10) - self.absolute = 2; + this.absolute = 2; - setorigin(self, self.origin); - setsize(self, self.mins, self.maxs); - self.solid = SOLID_NOT; - self.draw = Draw_PointParticles; - self.entremove = Ent_PointParticles_Remove; + setorigin(this, this.origin); + setsize(this, this.mins, this.maxs); + this.solid = SOLID_NOT; + this.draw = Draw_PointParticles; + this.entremove = Ent_PointParticles_Remove; } #endif diff --git a/qcsrc/common/triggers/func/train.qc b/qcsrc/common/triggers/func/train.qc index 033748812..6c674d474 100644 --- a/qcsrc/common/triggers/func/train.qc +++ b/qcsrc/common/triggers/func/train.qc @@ -266,70 +266,70 @@ NET_HANDLE(ENT_CLIENT_TRAIN, bool isnew) if(sf & SF_TRIGGER_INIT) { - self.platmovetype = strzone(ReadString()); - self.platmovetype_turn = ReadByte(); - self.spawnflags = ReadByte(); + this.platmovetype = strzone(ReadString()); + this.platmovetype_turn = ReadByte(); + this.spawnflags = ReadByte(); - self.model = strzone(ReadString()); - _setmodel(self, self.model); + this.model = strzone(ReadString()); + _setmodel(this, this.model); - trigger_common_read(true); + trigger_common_read(this, true); - self.curvetarget = strzone(ReadString()); + this.curvetarget = strzone(ReadString()); - self.pos1_x = ReadCoord(); - self.pos1_y = ReadCoord(); - self.pos1_z = ReadCoord(); - self.pos2_x = ReadCoord(); - self.pos2_y = ReadCoord(); - self.pos2_z = ReadCoord(); + this.pos1_x = ReadCoord(); + this.pos1_y = ReadCoord(); + this.pos1_z = ReadCoord(); + this.pos2_x = ReadCoord(); + this.pos2_y = ReadCoord(); + this.pos2_z = ReadCoord(); - self.size_x = ReadCoord(); - self.size_y = ReadCoord(); - self.size_z = ReadCoord(); + this.size_x = ReadCoord(); + this.size_y = ReadCoord(); + this.size_z = ReadCoord(); - self.view_ofs_x = ReadCoord(); - self.view_ofs_y = ReadCoord(); - self.view_ofs_z = ReadCoord(); + this.view_ofs_x = ReadCoord(); + this.view_ofs_y = ReadCoord(); + this.view_ofs_z = ReadCoord(); - self.mangle_x = ReadAngle(); - self.mangle_y = ReadAngle(); - self.mangle_z = ReadAngle(); + this.mangle_x = ReadAngle(); + this.mangle_y = ReadAngle(); + this.mangle_z = ReadAngle(); - self.speed = ReadShort(); - self.height = ReadShort(); - self.lip = ReadByte(); - self.state = ReadByte(); - self.wait = ReadByte(); + this.speed = ReadShort(); + this.height = ReadShort(); + this.lip = ReadByte(); + this.state = ReadByte(); + this.wait = ReadByte(); - self.dmg = ReadShort(); - self.dmgtime = ReadByte(); + this.dmg = ReadShort(); + this.dmgtime = ReadByte(); - self.classname = "func_train"; - self.solid = SOLID_BSP; - self.movetype = MOVETYPE_PUSH; - self.drawmask = MASK_NORMAL; - self.draw = train_draw; - self.entremove = trigger_remove_generic; + this.classname = "func_train"; + this.solid = SOLID_BSP; + this.movetype = MOVETYPE_PUSH; + this.drawmask = MASK_NORMAL; + this.draw = train_draw; + this.entremove = trigger_remove_generic; - if(set_platmovetype(self, self.platmovetype)) + if(set_platmovetype(this, this.platmovetype)) { - self.platmovetype_start_default = self.platmovetype_start; - self.platmovetype_end_default = self.platmovetype_end; + this.platmovetype_start_default = this.platmovetype_start; + this.platmovetype_end_default = this.platmovetype_end; } // everything is set up by the time the train is linked, we shouldn't need this //func_train_find(); // but we will need these - //self.move_nextthink = self.move_ltime + 0.1; - //self.move_think = train_next; - train_next(); - - self.move_movetype = MOVETYPE_PUSH; - self.move_origin = self.origin; - self.move_angles = self.angles; - self.move_time = time; + //this.move_nextthink = this.move_ltime + 0.1; + //this.move_think = train_next; + WITHSELF(this, train_next()); + + this.move_movetype = MOVETYPE_PUSH; + this.move_origin = this.origin; + this.move_angles = this.angles; + this.move_time = time; } if(sf & SF_TRIGGER_RESET) diff --git a/qcsrc/common/triggers/misc/corner.qc b/qcsrc/common/triggers/misc/corner.qc index 77f430640..38772a295 100644 --- a/qcsrc/common/triggers/misc/corner.qc +++ b/qcsrc/common/triggers/misc/corner.qc @@ -61,29 +61,29 @@ void corner_remove(entity this) NET_HANDLE(ENT_CLIENT_CORNER, bool isnew) { - self.platmovetype = strzone(ReadString()); + this.platmovetype = strzone(ReadString()); - self.origin_x = ReadCoord(); - self.origin_y = ReadCoord(); - self.origin_z = ReadCoord(); - setorigin(self, self.origin); + this.origin_x = ReadCoord(); + this.origin_y = ReadCoord(); + this.origin_z = ReadCoord(); + setorigin(this, this.origin); - self.target = strzone(ReadString()); - self.target2 = strzone(ReadString()); - self.target3 = strzone(ReadString()); - self.target4 = strzone(ReadString()); - self.targetname = strzone(ReadString()); - self.target_random = ReadByte(); + this.target = strzone(ReadString()); + this.target2 = strzone(ReadString()); + this.target3 = strzone(ReadString()); + this.target4 = strzone(ReadString()); + this.targetname = strzone(ReadString()); + this.target_random = ReadByte(); - self.wait = ReadByte(); + this.wait = ReadByte(); return = true; - self.classname = "path_corner"; - self.drawmask = MASK_NORMAL; - self.entremove = corner_remove; + this.classname = "path_corner"; + this.drawmask = MASK_NORMAL; + this.entremove = corner_remove; - set_platmovetype(self, self.platmovetype); + set_platmovetype(this, this.platmovetype); } #endif diff --git a/qcsrc/common/triggers/misc/laser.qc b/qcsrc/common/triggers/misc/laser.qc index 6e589eddf..3d09282d5 100644 --- a/qcsrc/common/triggers/misc/laser.qc +++ b/qcsrc/common/triggers/misc/laser.qc @@ -317,65 +317,65 @@ void Draw_Laser(entity this) NET_HANDLE(ENT_CLIENT_LASER, bool isnew) { - InterpolateOrigin_Undo(self); + InterpolateOrigin_Undo(this); // 30 bytes, or 13 bytes for just moving int f = ReadByte(); - self.count = (f & 0xF0); + this.count = (f & 0xF0); - if(self.count & 0x80) - self.iflags = IFLAG_VELOCITY | IFLAG_ORIGIN; + if(this.count & 0x80) + this.iflags = IFLAG_VELOCITY | IFLAG_ORIGIN; else - self.iflags = IFLAG_ANGLES | IFLAG_ORIGIN; + this.iflags = IFLAG_ANGLES | IFLAG_ORIGIN; if(f & 1) { - self.origin_x = ReadCoord(); - self.origin_y = ReadCoord(); - self.origin_z = ReadCoord(); - setorigin(self, self.origin); + this.origin_x = ReadCoord(); + this.origin_y = ReadCoord(); + this.origin_z = ReadCoord(); + setorigin(this, this.origin); } if(f & 8) { - self.colormod_x = ReadByte() / 255.0; - self.colormod_y = ReadByte() / 255.0; - self.colormod_z = ReadByte() / 255.0; + this.colormod_x = ReadByte() / 255.0; + this.colormod_y = ReadByte() / 255.0; + this.colormod_z = ReadByte() / 255.0; if(f & 0x40) - self.alpha = ReadByte() / 255.0; + this.alpha = ReadByte() / 255.0; else - self.alpha = 0; - self.scale = 2; - self.modelscale = 50; + this.alpha = 0; + this.scale = 2; + this.modelscale = 50; if(f & 0x20) { - self.scale *= ReadByte() / 16.0; // beam radius - self.modelscale *= ReadByte() / 16.0; // dlight radius + this.scale *= ReadByte() / 16.0; // beam radius + this.modelscale *= ReadByte() / 16.0; // dlight radius } if((f & 0x80) || !(f & 0x10)) - self.cnt = ReadShort() - 1; // effect number + this.cnt = ReadShort() - 1; // effect number else - self.cnt = 0; + this.cnt = 0; } if(f & 2) { if(f & 0x80) { - self.velocity_x = ReadCoord(); - self.velocity_y = ReadCoord(); - self.velocity_z = ReadCoord(); + this.velocity_x = ReadCoord(); + this.velocity_y = ReadCoord(); + this.velocity_z = ReadCoord(); } else { - self.angles_x = ReadAngle(); - self.angles_y = ReadAngle(); + this.angles_x = ReadAngle(); + this.angles_y = ReadAngle(); } } if(f & 4) - self.state = ReadByte(); + this.state = ReadByte(); return = true; InterpolateOrigin_Note(this); - self.draw = Draw_Laser; + this.draw = Draw_Laser; } #endif diff --git a/qcsrc/common/triggers/target/music.qc b/qcsrc/common/triggers/target/music.qc index b57d483f2..cbc584d86 100644 --- a/qcsrc/common/triggers/target/music.qc +++ b/qcsrc/common/triggers/target/music.qc @@ -273,55 +273,55 @@ NET_HANDLE(ENT_CLIENT_TRIGGER_MUSIC, bool isnew) int f = ReadByte(); if(f & 4) { - self.origin_x = ReadCoord(); - self.origin_y = ReadCoord(); - self.origin_z = ReadCoord(); + this.origin_x = ReadCoord(); + this.origin_y = ReadCoord(); + this.origin_z = ReadCoord(); } if(f & 1) { - self.modelindex = ReadShort(); - if(self.modelindex) + this.modelindex = ReadShort(); + if(this.modelindex) { - self.mins_x = ReadCoord(); - self.mins_y = ReadCoord(); - self.mins_z = ReadCoord(); - self.maxs_x = ReadCoord(); - self.maxs_y = ReadCoord(); - self.maxs_z = ReadCoord(); + this.mins_x = ReadCoord(); + this.mins_y = ReadCoord(); + this.mins_z = ReadCoord(); + this.maxs_x = ReadCoord(); + this.maxs_y = ReadCoord(); + this.maxs_z = ReadCoord(); } else { - self.mins = '0 0 0'; - self.maxs_x = ReadCoord(); - self.maxs_y = ReadCoord(); - self.maxs_z = ReadCoord(); + this.mins = '0 0 0'; + this.maxs_x = ReadCoord(); + this.maxs_y = ReadCoord(); + this.maxs_z = ReadCoord(); } - self.volume = ReadByte() / 255.0; - self.fade_time = ReadByte() / 16.0; - self.fade_rate = ReadByte() / 16.0; - string s = self.noise; - if(self.noise) - strunzone(self.noise); - self.noise = strzone(ReadString()); - if(self.noise != s) + this.volume = ReadByte() / 255.0; + this.fade_time = ReadByte() / 16.0; + this.fade_rate = ReadByte() / 16.0; + string s = this.noise; + if(this.noise) + strunzone(this.noise); + this.noise = strzone(ReadString()); + if(this.noise != s) { - precache_sound(self.noise); - _sound(self, CH_BGM_SINGLE, self.noise, 0, ATTEN_NONE); - if(getsoundtime(self, CH_BGM_SINGLE) < 0) + precache_sound(this.noise); + _sound(this, CH_BGM_SINGLE, this.noise, 0, ATTEN_NONE); + if(getsoundtime(this, CH_BGM_SINGLE) < 0) { - LOG_TRACEF("Cannot initialize sound %s\n", self.noise); - strunzone(self.noise); - self.noise = string_null; + LOG_TRACEF("Cannot initialize sound %s\n", this.noise); + strunzone(this.noise); + this.noise = string_null; } } } - setorigin(self, self.origin); - setsize(self, self.mins, self.maxs); - self.cnt = 1; - self.think = Ent_TriggerMusic_Think; - self.nextthink = time; + setorigin(this, this.origin); + setsize(this, this.mins, this.maxs); + this.cnt = 1; + this.think = Ent_TriggerMusic_Think; + this.nextthink = time; return true; } diff --git a/qcsrc/common/triggers/trigger/impulse.qc b/qcsrc/common/triggers/trigger/impulse.qc index a1ac1255f..cd98627c8 100644 --- a/qcsrc/common/triggers/trigger/impulse.qc +++ b/qcsrc/common/triggers/trigger/impulse.qc @@ -223,7 +223,7 @@ NET_HANDLE(ENT_CLIENT_TRIGGER_IMPULSE, bool isnew) this.falloff = ReadByte(); this.active = ReadByte(); - trigger_common_read(true); + trigger_common_read(this, true); return = true; this.classname = "trigger_impulse"; diff --git a/qcsrc/common/triggers/trigger/jumppads.qc b/qcsrc/common/triggers/trigger/jumppads.qc index 44413a9c4..67fd75220 100644 --- a/qcsrc/common/triggers/trigger/jumppads.qc +++ b/qcsrc/common/triggers/trigger/jumppads.qc @@ -443,7 +443,7 @@ NET_HANDLE(ENT_CLIENT_TRIGGER_PUSH, bool isnew) this.active = ReadByte(); this.height = ReadCoord(); - trigger_common_read(true); + trigger_common_read(this, true); this.entremove = trigger_remove_generic; this.solid = SOLID_TRIGGER; diff --git a/qcsrc/common/triggers/trigger/keylock.qc b/qcsrc/common/triggers/trigger/keylock.qc index 3a38a9ef8..1ac9a295a 100644 --- a/qcsrc/common/triggers/trigger/keylock.qc +++ b/qcsrc/common/triggers/trigger/keylock.qc @@ -184,17 +184,17 @@ void keylock_remove(entity this) NET_HANDLE(ENT_CLIENT_KEYLOCK, bool isnew) { - self.itemkeys = ReadInt24_t(); - self.height = ReadByte(); + this.itemkeys = ReadInt24_t(); + this.height = ReadByte(); - trigger_common_read(true); + trigger_common_read(this, true); return = true; - self.classname = "trigger_keylock"; - self.drawmask = MASK_NORMAL; - self.draw = trigger_draw_generic; - self.trigger_touch = trigger_keylock_touch; - self.entremove = keylock_remove; + this.classname = "trigger_keylock"; + this.drawmask = MASK_NORMAL; + this.draw = trigger_draw_generic; + this.trigger_touch = trigger_keylock_touch; + this.entremove = keylock_remove; } #endif diff --git a/qcsrc/common/triggers/trigger/swamp.qc b/qcsrc/common/triggers/trigger/swamp.qc index a65cdb0e2..4b66f723f 100644 --- a/qcsrc/common/triggers/trigger/swamp.qc +++ b/qcsrc/common/triggers/trigger/swamp.qc @@ -142,7 +142,7 @@ NET_HANDLE(ENT_CLIENT_SWAMP, bool isnew) this.swamp_slowdown = ReadByte(); this.swamp_interval = ReadByte(); - trigger_common_read(false); + trigger_common_read(this, false); return = true; diff --git a/qcsrc/common/triggers/trigger/teleport.qc b/qcsrc/common/triggers/trigger/teleport.qc index dcae83f0f..4666b71b7 100644 --- a/qcsrc/common/triggers/trigger/teleport.qc +++ b/qcsrc/common/triggers/trigger/teleport.qc @@ -104,24 +104,24 @@ spawnfunc(trigger_teleport) #elif defined(CSQC) NET_HANDLE(ENT_CLIENT_TRIGGER_TELEPORT, bool isnew) { - self.classname = "trigger_teleport"; - int mytm = ReadByte(); if(mytm) { self.team = mytm - 1; } - self.spawnflags = ReadInt24_t(); - self.active = ReadByte(); - self.speed = ReadCoord(); - - trigger_common_read(true); - - self.entremove = trigger_remove_generic; - self.solid = SOLID_TRIGGER; - //self.draw = trigger_draw_generic; - //self.move_touch = trigger_push_touch; - self.drawmask = MASK_NORMAL; - self.move_time = time; - defer(self, 0.25, teleport_findtarget); - - self.teleport_next = teleport_first; - teleport_first = self; + this.classname = "trigger_teleport"; + int mytm = ReadByte(); if(mytm) { this.team = mytm - 1; } + this.spawnflags = ReadInt24_t(); + this.active = ReadByte(); + this.speed = ReadCoord(); + + trigger_common_read(this, true); + + this.entremove = trigger_remove_generic; + this.solid = SOLID_TRIGGER; + //this.draw = trigger_draw_generic; + //this.move_touch = trigger_push_touch; + this.drawmask = MASK_NORMAL; + this.move_time = time; + defer(this, 0.25, teleport_findtarget); + + this.teleport_next = teleport_first; + teleport_first = this; return true; } diff --git a/qcsrc/common/triggers/triggers.qc b/qcsrc/common/triggers/triggers.qc index 776044573..fbf8ae59f 100644 --- a/qcsrc/common/triggers/triggers.qc +++ b/qcsrc/common/triggers/triggers.qc @@ -92,8 +92,8 @@ void trigger_common_write(entity this, bool withtarget) #elif defined(CSQC) -void trigger_common_read(bool withtarget) -{SELFPARAM(); +void trigger_common_read(entity this, bool withtarget) +{ int f = ReadByte(); this.warpzone_isboxy = (f & 1); diff --git a/qcsrc/common/triggers/triggers.qh b/qcsrc/common/triggers/triggers.qh index 69d53fba4..915e04866 100644 --- a/qcsrc/common/triggers/triggers.qh +++ b/qcsrc/common/triggers/triggers.qh @@ -39,7 +39,7 @@ void target_voicescript_clear(entity pl); void FixSize(entity e); #ifdef CSQC -void trigger_common_read(bool withtarget); +void trigger_common_read(entity this, bool withtarget); void trigger_remove_generic(entity this); .float active; diff --git a/qcsrc/common/turrets/cl_turrets.qc b/qcsrc/common/turrets/cl_turrets.qc index 079d6b3f0..310218689 100644 --- a/qcsrc/common/turrets/cl_turrets.qc +++ b/qcsrc/common/turrets/cl_turrets.qc @@ -6,16 +6,16 @@ void turret_remove(entity this) } .vector glowmod; -void turret_changeteam() -{SELFPARAM(); - self.glowmod = Team_ColorRGB(self.team - 1) * 2; - self.teamradar_color = Team_ColorRGB(self.team - 1); +void turret_changeteam(entity this) +{ + this.glowmod = Team_ColorRGB(this.team - 1) * 2; + this.teamradar_color = Team_ColorRGB(this.team - 1); - if(self.team) - self.colormap = 1024 + (self.team - 1) * 17; + if(this.team) + this.colormap = 1024 + (this.team - 1) * 17; - self.tur_head.colormap = self.colormap; - self.tur_head.glowmod = self.glowmod; + this.tur_head.colormap = this.colormap; + this.tur_head.glowmod = this.glowmod; } @@ -359,85 +359,85 @@ NET_HANDLE(ENT_CLIENT_TURRET, bool isnew) if(sf & TNSF_SETUP) { - self.m_id = ReadByte(); + this.m_id = ReadByte(); - self.origin_x = ReadCoord(); - self.origin_y = ReadCoord(); - self.origin_z = ReadCoord(); - setorigin(self, self.origin); + this.origin_x = ReadCoord(); + this.origin_y = ReadCoord(); + this.origin_z = ReadCoord(); + setorigin(this, this.origin); - self.angles_x = ReadAngle(); - self.angles_y = ReadAngle(); + this.angles_x = ReadAngle(); + this.angles_y = ReadAngle(); turret_construct(); - self.colormap = 1024; - self.glowmod = '0 1 1'; - self.tur_head.colormap = self.colormap; - self.tur_head.glowmod = self.glowmod; + this.colormap = 1024; + this.glowmod = '0 1 1'; + this.tur_head.colormap = this.colormap; + this.tur_head.glowmod = this.glowmod; } if(sf & TNSF_ANG) { - if(self.tur_head == world) // aparenly this can happpen before TNSF_SETUP. great. - self.tur_head = spawn(); + if(this.tur_head == world) // aparenly this can happpen before TNSF_SETUP. great. + this.tur_head = spawn(); - self.tur_head.move_angles_x = ReadShort(); - self.tur_head.move_angles_y = ReadShort(); - //self.tur_head.angles = self.angles + self.tur_head.move_angles; - self.tur_head.angles = self.tur_head.move_angles; + this.tur_head.move_angles_x = ReadShort(); + this.tur_head.move_angles_y = ReadShort(); + //this.tur_head.angles = this.angles + this.tur_head.move_angles; + this.tur_head.angles = this.tur_head.move_angles; } if(sf & TNSF_AVEL) { - if(self.tur_head == world) // aparenly this can happpen before TNSF_SETUP. great. - self.tur_head = spawn(); + if(this.tur_head == world) // aparenly this can happpen before TNSF_SETUP. great. + this.tur_head = spawn(); - self.tur_head.move_avelocity_x = ReadShort(); - self.tur_head.move_avelocity_y = ReadShort(); + this.tur_head.move_avelocity_x = ReadShort(); + this.tur_head.move_avelocity_y = ReadShort(); } if(sf & TNSF_MOVE) { - self.origin_x = ReadShort(); - self.origin_y = ReadShort(); - self.origin_z = ReadShort(); - setorigin(self, self.origin); + this.origin_x = ReadShort(); + this.origin_y = ReadShort(); + this.origin_z = ReadShort(); + setorigin(this, this.origin); - self.velocity_x = ReadShort(); - self.velocity_y = ReadShort(); - self.velocity_z = ReadShort(); + this.velocity_x = ReadShort(); + this.velocity_y = ReadShort(); + this.velocity_z = ReadShort(); - self.move_angles_y = ReadShort(); + this.move_angles_y = ReadShort(); - self.move_time = time; - self.move_velocity = self.velocity; - self.move_origin = self.origin; + this.move_time = time; + this.move_velocity = this.velocity; + this.move_origin = this.origin; } if(sf & TNSF_ANIM) { - self.frame1time = ReadCoord(); - self.frame = ReadByte(); + this.frame1time = ReadCoord(); + this.frame = ReadByte(); } if(sf & TNSF_STATUS) { float _tmp; _tmp = ReadByte(); - if(_tmp != self.team) + if(_tmp != this.team) { - self.team = _tmp; - turret_changeteam(); + this.team = _tmp; + turret_changeteam(this); } _tmp = ReadByte(); - if(_tmp == 0 && self.health != 0) + if(_tmp == 0 && this.health != 0) turret_die(); - else if(self.health && self.health != _tmp) - self.helpme = servertime + 10; + else if(this.health && this.health != _tmp) + this.helpme = servertime + 10; - self.health = _tmp; + this.health = _tmp; } - //self.enemy.health = self.health / 255; + //this.enemy.health = this.health / 255; return true; } diff --git a/qcsrc/common/vehicles/cl_vehicles.qc b/qcsrc/common/vehicles/cl_vehicles.qc index e2187290d..9659ea5f8 100644 --- a/qcsrc/common/vehicles/cl_vehicles.qc +++ b/qcsrc/common/vehicles/cl_vehicles.qc @@ -82,8 +82,8 @@ NET_HANDLE(TE_CSQC_VEHICLESETUP, bool isnew) // hud_id == 0 means we exited a vehicle, so stop alarm sound/s if(hud_id == 0) { - sound(self, CH_TRIGGER_SINGLE, SND_Null, VOL_BASEVOICE, ATTEN_NONE); - sound(self, CH_PAIN_SINGLE, SND_Null, VOL_BASEVOICE, ATTEN_NONE); + sound(this, CH_TRIGGER_SINGLE, SND_Null, VOL_BASEVOICE, ATTEN_NONE); + sound(this, CH_PAIN_SINGLE, SND_Null, VOL_BASEVOICE, ATTEN_NONE); return; } diff --git a/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc b/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc index 00b796dda..26a6ddd13 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc @@ -56,35 +56,35 @@ NET_HANDLE(ENT_CLIENT_BUMBLE_RAYGUN, bool isnew) if(sf & BRG_SETUP) { - self.cnt = ReadByte(); - self.team = ReadByte(); - self.cnt = ReadByte(); + this.cnt = ReadByte(); + this.team = ReadByte(); + this.cnt = ReadByte(); - if(self.cnt) - self.colormod = '1 0 0'; + if(this.cnt) + this.colormod = '1 0 0'; else - self.colormod = '0 1 0'; + this.colormod = '0 1 0'; - self.traileffect = EFFECT_BUMBLEBEE_HEAL_MUZZLEFLASH.m_id; - self.lip = particleeffectnum(EFFECT_BUMBLEBEE_HEAL_IMPACT); + this.traileffect = EFFECT_BUMBLEBEE_HEAL_MUZZLEFLASH.m_id; + this.lip = particleeffectnum(EFFECT_BUMBLEBEE_HEAL_IMPACT); - self.draw = bumble_raygun_draw; + this.draw = bumble_raygun_draw; } if(sf & BRG_START) { - self.origin_x = ReadCoord(); - self.origin_y = ReadCoord(); - self.origin_z = ReadCoord(); - setorigin(self, self.origin); + this.origin_x = ReadCoord(); + this.origin_y = ReadCoord(); + this.origin_z = ReadCoord(); + setorigin(this, this.origin); } if(sf & BRG_END) { - self.move_origin_x = ReadCoord(); - self.move_origin_y = ReadCoord(); - self.move_origin_z = ReadCoord(); + this.move_origin_x = ReadCoord(); + this.move_origin_y = ReadCoord(); + this.move_origin_z = ReadCoord(); } return true; } diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index cf391b034..19cf8a591 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -1289,308 +1289,308 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew) { int gunalign = W_GetGunAlignment(world); - self.beam_shotorigin = arc_shotorigin[gunalign]; + this.beam_shotorigin = arc_shotorigin[gunalign]; // set other main attributes of the beam - self.draw = Draw_ArcBeam; - self.entremove = Remove_ArcBeam; - self.move_time = time; - loopsound(self, CH_SHOTS_SINGLE, SND(ARC_LOOP), VOL_BASE, ATTEN_NORM); + this.draw = Draw_ArcBeam; + this.entremove = Remove_ArcBeam; + this.move_time = time; + loopsound(this, CH_SHOTS_SINGLE, SND(ARC_LOOP), VOL_BASE, ATTEN_NORM); flash = spawn(); - flash.owner = self; + flash.owner = this; flash.effects = EF_ADDITIVE | EF_FULLBRIGHT; flash.drawmask = MASK_NORMAL; flash.solid = SOLID_NOT; flash.avelocity_z = 5000; - setattachment(flash, self, ""); + setattachment(flash, this, ""); setorigin(flash, '0 0 0'); - self.beam_muzzleentity = flash; + this.beam_muzzleentity = flash; } else { - flash = self.beam_muzzleentity; + flash = this.beam_muzzleentity; } if(sf & ARC_SF_SETTINGS) // settings information { - self.beam_degreespersegment = ReadShort(); - self.beam_distancepersegment = ReadShort(); - self.beam_maxangle = ReadShort(); - self.beam_range = ReadCoord(); - self.beam_returnspeed = ReadShort(); - self.beam_tightness = (ReadByte() / 10); + this.beam_degreespersegment = ReadShort(); + this.beam_distancepersegment = ReadShort(); + this.beam_maxangle = ReadShort(); + this.beam_range = ReadCoord(); + this.beam_returnspeed = ReadShort(); + this.beam_tightness = (ReadByte() / 10); if(ReadByte()) { if(autocvar_chase_active) - { self.beam_usevieworigin = 1; } + { this.beam_usevieworigin = 1; } else // use view origin - { self.beam_usevieworigin = 2; } + { this.beam_usevieworigin = 2; } } else { - self.beam_usevieworigin = 0; + this.beam_usevieworigin = 0; } - self.sv_entnum = ReadByte(); + this.sv_entnum = ReadByte(); } - if(!self.beam_usevieworigin) + if(!this.beam_usevieworigin) { - // self.iflags = IFLAG_ORIGIN | IFLAG_ANGLES | IFLAG_V_ANGLE; // why doesn't this work? - self.iflags = IFLAG_ORIGIN; + // this.iflags = IFLAG_ORIGIN | IFLAG_ANGLES | IFLAG_V_ANGLE; // why doesn't this work? + this.iflags = IFLAG_ORIGIN; - InterpolateOrigin_Undo(self); + InterpolateOrigin_Undo(this); } if(sf & ARC_SF_START) // starting location { - self.origin_x = ReadCoord(); - self.origin_y = ReadCoord(); - self.origin_z = ReadCoord(); + this.origin_x = ReadCoord(); + this.origin_y = ReadCoord(); + this.origin_z = ReadCoord(); } - else if(self.beam_usevieworigin) // infer the location from player location + else if(this.beam_usevieworigin) // infer the location from player location { - if(self.beam_usevieworigin == 2) + if(this.beam_usevieworigin == 2) { // use view origin - self.origin = view_origin; + this.origin = view_origin; } else { // use player origin so that third person display still works - self.origin = entcs_receiver(player_localnum).origin + ('0 0 1' * STAT(VIEWHEIGHT)); + this.origin = entcs_receiver(player_localnum).origin + ('0 0 1' * STAT(VIEWHEIGHT)); } } - setorigin(self, self.origin); + setorigin(this, this.origin); if(sf & ARC_SF_WANTDIR) // want/aim direction { - self.v_angle_x = ReadCoord(); - self.v_angle_y = ReadCoord(); - self.v_angle_z = ReadCoord(); + this.v_angle_x = ReadCoord(); + this.v_angle_y = ReadCoord(); + this.v_angle_z = ReadCoord(); } if(sf & ARC_SF_BEAMDIR) // beam direction { - self.angles_x = ReadCoord(); - self.angles_y = ReadCoord(); - self.angles_z = ReadCoord(); + this.angles_x = ReadCoord(); + this.angles_y = ReadCoord(); + this.angles_z = ReadCoord(); } if(sf & ARC_SF_BEAMTYPE) // beam type { - self.beam_type = ReadByte(); + this.beam_type = ReadByte(); - vector beamcolor = ((autocvar_cl_arcbeam_teamcolor) ? colormapPaletteColor(stof(getplayerkeyvalue(self.sv_entnum - 1, "colors")) & 0x0F, true) : '1 1 1'); - switch(self.beam_type) + vector beamcolor = ((autocvar_cl_arcbeam_teamcolor) ? colormapPaletteColor(stof(getplayerkeyvalue(this.sv_entnum - 1, "colors")) & 0x0F, true) : '1 1 1'); + switch(this.beam_type) { case ARC_BT_MISS: { - self.beam_color = beamcolor; - self.beam_alpha = 0.5; - self.beam_thickness = 8; - self.beam_traileffect = (EFFECT_ARC_BEAM); - self.beam_hiteffect = (EFFECT_ARC_LIGHTNING); - self.beam_hitlight[0] = 0; - self.beam_hitlight[1] = 1; - self.beam_hitlight[2] = 1; - self.beam_hitlight[3] = 1; - self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); - self.beam_muzzlelight[0] = 0; - self.beam_muzzlelight[1] = 1; - self.beam_muzzlelight[2] = 1; - self.beam_muzzlelight[3] = 1; - if(self.beam_muzzleeffect) + this.beam_color = beamcolor; + this.beam_alpha = 0.5; + this.beam_thickness = 8; + this.beam_traileffect = (EFFECT_ARC_BEAM); + this.beam_hiteffect = (EFFECT_ARC_LIGHTNING); + this.beam_hitlight[0] = 0; + this.beam_hitlight[1] = 1; + this.beam_hitlight[2] = 1; + this.beam_hitlight[3] = 1; + this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); + this.beam_muzzlelight[0] = 0; + this.beam_muzzlelight[1] = 1; + this.beam_muzzlelight[2] = 1; + this.beam_muzzlelight[3] = 1; + if(this.beam_muzzleeffect) { setmodel(flash, MDL_ARC_MUZZLEFLASH); - flash.alpha = self.beam_alpha; - flash.colormod = self.beam_color; + flash.alpha = this.beam_alpha; + flash.colormod = this.beam_color; flash.scale = 0.5; } break; } case ARC_BT_WALL: // grenadelauncher_muzzleflash healray_muzzleflash { - self.beam_color = beamcolor; - self.beam_alpha = 0.5; - self.beam_thickness = 8; - self.beam_traileffect = (EFFECT_ARC_BEAM); - self.beam_hiteffect = (EFFECT_ARC_LIGHTNING); - self.beam_hitlight[0] = 0; - self.beam_hitlight[1] = 1; - self.beam_hitlight[2] = 1; - self.beam_hitlight[3] = 1; - self.beam_muzzleeffect = NULL; // (EFFECT_GRENADE_MUZZLEFLASH); - self.beam_muzzlelight[0] = 0; - self.beam_muzzlelight[1] = 1; - self.beam_muzzlelight[2] = 1; - self.beam_muzzlelight[3] = 1; - self.beam_image = "particles/lgbeam"; - if(self.beam_muzzleeffect) + this.beam_color = beamcolor; + this.beam_alpha = 0.5; + this.beam_thickness = 8; + this.beam_traileffect = (EFFECT_ARC_BEAM); + this.beam_hiteffect = (EFFECT_ARC_LIGHTNING); + this.beam_hitlight[0] = 0; + this.beam_hitlight[1] = 1; + this.beam_hitlight[2] = 1; + this.beam_hitlight[3] = 1; + this.beam_muzzleeffect = NULL; // (EFFECT_GRENADE_MUZZLEFLASH); + this.beam_muzzlelight[0] = 0; + this.beam_muzzlelight[1] = 1; + this.beam_muzzlelight[2] = 1; + this.beam_muzzlelight[3] = 1; + this.beam_image = "particles/lgbeam"; + if(this.beam_muzzleeffect) { setmodel(flash, MDL_ARC_MUZZLEFLASH); - flash.alpha = self.beam_alpha; - flash.colormod = self.beam_color; + flash.alpha = this.beam_alpha; + flash.colormod = this.beam_color; flash.scale = 0.5; } break; } case ARC_BT_HEAL: { - self.beam_color = beamcolor; - self.beam_alpha = 0.5; - self.beam_thickness = 8; - self.beam_traileffect = (EFFECT_ARC_BEAM_HEAL); - self.beam_hiteffect = (EFFECT_ARC_BEAM_HEAL_IMPACT); - self.beam_hitlight[0] = 0; - self.beam_hitlight[1] = 1; - self.beam_hitlight[2] = 1; - self.beam_hitlight[3] = 1; - self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); - self.beam_muzzlelight[0] = 0; - self.beam_muzzlelight[1] = 1; - self.beam_muzzlelight[2] = 1; - self.beam_muzzlelight[3] = 1; - self.beam_image = "particles/lgbeam"; - if(self.beam_muzzleeffect) + this.beam_color = beamcolor; + this.beam_alpha = 0.5; + this.beam_thickness = 8; + this.beam_traileffect = (EFFECT_ARC_BEAM_HEAL); + this.beam_hiteffect = (EFFECT_ARC_BEAM_HEAL_IMPACT); + this.beam_hitlight[0] = 0; + this.beam_hitlight[1] = 1; + this.beam_hitlight[2] = 1; + this.beam_hitlight[3] = 1; + this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); + this.beam_muzzlelight[0] = 0; + this.beam_muzzlelight[1] = 1; + this.beam_muzzlelight[2] = 1; + this.beam_muzzlelight[3] = 1; + this.beam_image = "particles/lgbeam"; + if(this.beam_muzzleeffect) { setmodel(flash, MDL_ARC_MUZZLEFLASH); - flash.alpha = self.beam_alpha; - flash.colormod = self.beam_color; + flash.alpha = this.beam_alpha; + flash.colormod = this.beam_color; flash.scale = 0.5; } break; } case ARC_BT_HIT: { - self.beam_color = beamcolor; - self.beam_alpha = 0.5; - self.beam_thickness = 8; - self.beam_traileffect = (EFFECT_ARC_BEAM); - self.beam_hiteffect = (EFFECT_ARC_LIGHTNING); - self.beam_hitlight[0] = 20; - self.beam_hitlight[1] = 1; - self.beam_hitlight[2] = 0; - self.beam_hitlight[3] = 0; - self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); - self.beam_muzzlelight[0] = 50; - self.beam_muzzlelight[1] = 1; - self.beam_muzzlelight[2] = 0; - self.beam_muzzlelight[3] = 0; - self.beam_image = "particles/lgbeam"; - if(self.beam_muzzleeffect) + this.beam_color = beamcolor; + this.beam_alpha = 0.5; + this.beam_thickness = 8; + this.beam_traileffect = (EFFECT_ARC_BEAM); + this.beam_hiteffect = (EFFECT_ARC_LIGHTNING); + this.beam_hitlight[0] = 20; + this.beam_hitlight[1] = 1; + this.beam_hitlight[2] = 0; + this.beam_hitlight[3] = 0; + this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); + this.beam_muzzlelight[0] = 50; + this.beam_muzzlelight[1] = 1; + this.beam_muzzlelight[2] = 0; + this.beam_muzzlelight[3] = 0; + this.beam_image = "particles/lgbeam"; + if(this.beam_muzzleeffect) { setmodel(flash, MDL_ARC_MUZZLEFLASH); - flash.alpha = self.beam_alpha; - flash.colormod = self.beam_color; + flash.alpha = this.beam_alpha; + flash.colormod = this.beam_color; flash.scale = 0.5; } break; } case ARC_BT_BURST_MISS: { - self.beam_color = beamcolor; - self.beam_alpha = 0.5; - self.beam_thickness = 14; - self.beam_traileffect = (EFFECT_ARC_BEAM); - self.beam_hiteffect = (EFFECT_ARC_LIGHTNING); - self.beam_hitlight[0] = 0; - self.beam_hitlight[1] = 1; - self.beam_hitlight[2] = 1; - self.beam_hitlight[3] = 1; - self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); - self.beam_muzzlelight[0] = 0; - self.beam_muzzlelight[1] = 1; - self.beam_muzzlelight[2] = 1; - self.beam_muzzlelight[3] = 1; - self.beam_image = "particles/lgbeam"; - if(self.beam_muzzleeffect) + this.beam_color = beamcolor; + this.beam_alpha = 0.5; + this.beam_thickness = 14; + this.beam_traileffect = (EFFECT_ARC_BEAM); + this.beam_hiteffect = (EFFECT_ARC_LIGHTNING); + this.beam_hitlight[0] = 0; + this.beam_hitlight[1] = 1; + this.beam_hitlight[2] = 1; + this.beam_hitlight[3] = 1; + this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); + this.beam_muzzlelight[0] = 0; + this.beam_muzzlelight[1] = 1; + this.beam_muzzlelight[2] = 1; + this.beam_muzzlelight[3] = 1; + this.beam_image = "particles/lgbeam"; + if(this.beam_muzzleeffect) { setmodel(flash, MDL_ARC_MUZZLEFLASH); - flash.alpha = self.beam_alpha; - flash.colormod = self.beam_color; + flash.alpha = this.beam_alpha; + flash.colormod = this.beam_color; flash.scale = 0.5; } break; } case ARC_BT_BURST_WALL: { - self.beam_color = beamcolor; - self.beam_alpha = 0.5; - self.beam_thickness = 14; - self.beam_traileffect = (EFFECT_ARC_BEAM); - self.beam_hiteffect = (EFFECT_ARC_LIGHTNING); - self.beam_hitlight[0] = 0; - self.beam_hitlight[1] = 1; - self.beam_hitlight[2] = 1; - self.beam_hitlight[3] = 1; - self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); - self.beam_muzzlelight[0] = 0; - self.beam_muzzlelight[1] = 1; - self.beam_muzzlelight[2] = 1; - self.beam_muzzlelight[3] = 1; - self.beam_image = "particles/lgbeam"; - if(self.beam_muzzleeffect) + this.beam_color = beamcolor; + this.beam_alpha = 0.5; + this.beam_thickness = 14; + this.beam_traileffect = (EFFECT_ARC_BEAM); + this.beam_hiteffect = (EFFECT_ARC_LIGHTNING); + this.beam_hitlight[0] = 0; + this.beam_hitlight[1] = 1; + this.beam_hitlight[2] = 1; + this.beam_hitlight[3] = 1; + this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); + this.beam_muzzlelight[0] = 0; + this.beam_muzzlelight[1] = 1; + this.beam_muzzlelight[2] = 1; + this.beam_muzzlelight[3] = 1; + this.beam_image = "particles/lgbeam"; + if(this.beam_muzzleeffect) { setmodel(flash, MDL_ARC_MUZZLEFLASH); - flash.alpha = self.beam_alpha; - flash.colormod = self.beam_color; + flash.alpha = this.beam_alpha; + flash.colormod = this.beam_color; flash.scale = 0.5; } break; } case ARC_BT_BURST_HEAL: { - self.beam_color = beamcolor; - self.beam_alpha = 0.5; - self.beam_thickness = 14; - self.beam_traileffect = (EFFECT_ARC_BEAM_HEAL); - self.beam_hiteffect = (EFFECT_ARC_BEAM_HEAL_IMPACT2); - self.beam_hitlight[0] = 0; - self.beam_hitlight[1] = 1; - self.beam_hitlight[2] = 1; - self.beam_hitlight[3] = 1; - self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); - self.beam_muzzlelight[0] = 0; - self.beam_muzzlelight[1] = 1; - self.beam_muzzlelight[2] = 1; - self.beam_muzzlelight[3] = 1; - self.beam_image = "particles/lgbeam"; - if(self.beam_muzzleeffect) + this.beam_color = beamcolor; + this.beam_alpha = 0.5; + this.beam_thickness = 14; + this.beam_traileffect = (EFFECT_ARC_BEAM_HEAL); + this.beam_hiteffect = (EFFECT_ARC_BEAM_HEAL_IMPACT2); + this.beam_hitlight[0] = 0; + this.beam_hitlight[1] = 1; + this.beam_hitlight[2] = 1; + this.beam_hitlight[3] = 1; + this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); + this.beam_muzzlelight[0] = 0; + this.beam_muzzlelight[1] = 1; + this.beam_muzzlelight[2] = 1; + this.beam_muzzlelight[3] = 1; + this.beam_image = "particles/lgbeam"; + if(this.beam_muzzleeffect) { setmodel(flash, MDL_ARC_MUZZLEFLASH); - flash.alpha = self.beam_alpha; - flash.colormod = self.beam_color; + flash.alpha = this.beam_alpha; + flash.colormod = this.beam_color; flash.scale = 0.5; } break; } case ARC_BT_BURST_HIT: { - self.beam_color = beamcolor; - self.beam_alpha = 0.5; - self.beam_thickness = 14; - self.beam_traileffect = (EFFECT_ARC_BEAM); - self.beam_hiteffect = (EFFECT_ARC_LIGHTNING); - self.beam_hitlight[0] = 0; - self.beam_hitlight[1] = 1; - self.beam_hitlight[2] = 1; - self.beam_hitlight[3] = 1; - self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); - self.beam_muzzlelight[0] = 0; - self.beam_muzzlelight[1] = 1; - self.beam_muzzlelight[2] = 1; - self.beam_muzzlelight[3] = 1; - self.beam_image = "particles/lgbeam"; - if(self.beam_muzzleeffect) + this.beam_color = beamcolor; + this.beam_alpha = 0.5; + this.beam_thickness = 14; + this.beam_traileffect = (EFFECT_ARC_BEAM); + this.beam_hiteffect = (EFFECT_ARC_LIGHTNING); + this.beam_hitlight[0] = 0; + this.beam_hitlight[1] = 1; + this.beam_hitlight[2] = 1; + this.beam_hitlight[3] = 1; + this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); + this.beam_muzzlelight[0] = 0; + this.beam_muzzlelight[1] = 1; + this.beam_muzzlelight[2] = 1; + this.beam_muzzlelight[3] = 1; + this.beam_image = "particles/lgbeam"; + if(this.beam_muzzleeffect) { setmodel(flash, MDL_ARC_MUZZLEFLASH); - flash.alpha = self.beam_alpha; - flash.colormod = self.beam_color; + flash.alpha = this.beam_alpha; + flash.colormod = this.beam_color; flash.scale = 0.5; } break; @@ -1599,26 +1599,26 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew) // shouldn't be possible, but lets make it colorful if it does :D default: { - self.beam_color = randomvec(); - self.beam_alpha = 1; - self.beam_thickness = 8; - self.beam_traileffect = NULL; - self.beam_hiteffect = NULL; - self.beam_hitlight[0] = 0; - self.beam_hitlight[1] = 1; - self.beam_hitlight[2] = 1; - self.beam_hitlight[3] = 1; - self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); - self.beam_muzzlelight[0] = 0; - self.beam_muzzlelight[1] = 1; - self.beam_muzzlelight[2] = 1; - self.beam_muzzlelight[3] = 1; - self.beam_image = "particles/lgbeam"; - if(self.beam_muzzleeffect) + this.beam_color = randomvec(); + this.beam_alpha = 1; + this.beam_thickness = 8; + this.beam_traileffect = NULL; + this.beam_hiteffect = NULL; + this.beam_hitlight[0] = 0; + this.beam_hitlight[1] = 1; + this.beam_hitlight[2] = 1; + this.beam_hitlight[3] = 1; + this.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); + this.beam_muzzlelight[0] = 0; + this.beam_muzzlelight[1] = 1; + this.beam_muzzlelight[2] = 1; + this.beam_muzzlelight[3] = 1; + this.beam_image = "particles/lgbeam"; + if(this.beam_muzzleeffect) { setmodel(flash, MDL_ARC_MUZZLEFLASH); - flash.alpha = self.beam_alpha; - flash.colormod = self.beam_color; + flash.alpha = this.beam_alpha; + flash.colormod = this.beam_color; flash.scale = 0.5; } break; @@ -1626,7 +1626,7 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew) } } - if(!self.beam_usevieworigin) + if(!this.beam_usevieworigin) { InterpolateOrigin_Note(this); } diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index fac16c487..9b923bd46 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -496,73 +496,73 @@ void Remove_GrapplingHook(entity this) NET_HANDLE(ENT_CLIENT_HOOK, bool bIsNew) { - self.HookType = NET_ENT_CLIENT_HOOK; + this.HookType = NET_ENT_CLIENT_HOOK; int sf = ReadByte(); - self.HookSilent = (sf & 0x80); - self.iflags = IFLAG_VELOCITY | IFLAG_ORIGIN; + this.HookSilent = (sf & 0x80); + this.iflags = IFLAG_VELOCITY | IFLAG_ORIGIN; - InterpolateOrigin_Undo(self); + InterpolateOrigin_Undo(this); if(sf & 1) { int myowner = ReadByte(); - self.owner = playerslots[myowner - 1]; - self.sv_entnum = myowner; + this.owner = playerslots[myowner - 1]; + this.sv_entnum = myowner; if(csqcplayer && myowner == player_localentnum) - csqcplayer.hook = self; - switch(self.HookType) + csqcplayer.hook = this; + switch(this.HookType) { default: case NET_ENT_CLIENT_HOOK: - self.HookRange = 0; + this.HookRange = 0; break; case NET_ENT_CLIENT_ARC_BEAM: - self.HookRange = ReadCoord(); + this.HookRange = ReadCoord(); break; } } if(sf & 2) { - self.origin_x = ReadCoord(); - self.origin_y = ReadCoord(); - self.origin_z = ReadCoord(); - setorigin(self, self.origin); + this.origin_x = ReadCoord(); + this.origin_y = ReadCoord(); + this.origin_z = ReadCoord(); + setorigin(this, this.origin); } if(sf & 4) { - self.velocity_x = ReadCoord(); - self.velocity_y = ReadCoord(); - self.velocity_z = ReadCoord(); + this.velocity_x = ReadCoord(); + this.velocity_y = ReadCoord(); + this.velocity_z = ReadCoord(); } InterpolateOrigin_Note(this); - if(bIsNew || !self.teleport_time) + if(bIsNew || !this.teleport_time) { - self.draw = Draw_GrapplingHook; - self.entremove = Remove_GrapplingHook; + this.draw = Draw_GrapplingHook; + this.entremove = Remove_GrapplingHook; - switch(self.HookType) + switch(this.HookType) { default: case NET_ENT_CLIENT_HOOK: // for the model - setmodel(self, MDL_HOOK); - self.drawmask = MASK_NORMAL; + setmodel(this, MDL_HOOK); + this.drawmask = MASK_NORMAL; break; case NET_ENT_CLIENT_ARC_BEAM: - sound (self, CH_SHOTS_SINGLE, SND_LGBEAM_FLY, VOL_BASE, ATTEN_NORM); + sound (this, CH_SHOTS_SINGLE, SND_LGBEAM_FLY, VOL_BASE, ATTEN_NORM); break; } } - self.teleport_time = time + 10; + this.teleport_time = time + 10; return true; } -// TODO: hook: temporarily transform self.origin for drawing the model along warpzones! +// TODO: hook: temporarily transform this.origin for drawing the model along warpzones! #endif #endif