void train_wait(entity this)
{
SUB_UseTargets(this.enemy, NULL, NULL);
void train_wait(entity this)
{
SUB_UseTargets(this.enemy, NULL, NULL);
- targ = find(world, targetname, self.target);
- if((self.spawnflags & 1) && targ.curvetarget)
+ targ = find(world, targetname, this.target);
+ if((this.spawnflags & 1) && targ.curvetarget)
cp = find(world, targetname, targ.curvetarget);
else
cp = world;
if(cp) // bezier curves movement
cp = find(world, targetname, targ.curvetarget);
else
cp = world;
if(cp) // bezier curves movement
- if(self.wait > 0) // slow turning
- SUB_CalcAngleMove(self, ang, TSPEED_TIME, self.SUB_LTIME - time + self.wait, train_wait);
+ if(this.wait > 0) // slow turning
+ SUB_CalcAngleMove(this, ang, TSPEED_TIME, this.SUB_LTIME - time + this.wait, train_wait);
- SUB_CalcAngleMove(self, ang, TSPEED_TIME, 0.0000001, train_wait);
- self.train_wait_turning = true;
+ SUB_CalcAngleMove(this, ang, TSPEED_TIME, 0.0000001, train_wait);
+ this.train_wait_turning = true;
- if(self.noise != "")
- stopsoundto(MSG_BROADCAST, self, CH_TRIGGER_SINGLE); // send this as unreliable only, as the train will resume operation shortly anyway
+ if(this.noise != "")
+ stopsoundto(MSG_BROADCAST, this, CH_TRIGGER_SINGLE); // send this as unreliable only, as the train will resume operation shortly anyway
- self.use = train_use;
- SUB_THINK(self, func_null);
- self.SUB_NEXTTHINK = 0;
+ this.use = train_use;
+ SUB_THINK(this, func_null);
+ this.SUB_NEXTTHINK = 0;
- SUB_THINK(self, train_next);
- self.SUB_NEXTTHINK = self.SUB_LTIME + self.wait;
+ SUB_THINK(this, train_next);
+ this.SUB_NEXTTHINK = this.SUB_LTIME + this.wait;
- targ = find(world, targetname, self.target);
- self.target = targ.target;
- if (self.spawnflags & 1)
+ targ = find(world, targetname, this.target);
+ this.target = targ.target;
+ if (this.spawnflags & 1)
- self.platmovetype_start = targ.platmovetype_start;
- self.platmovetype_end = targ.platmovetype_end;
+ this.platmovetype_start = targ.platmovetype_start;
+ this.platmovetype_end = targ.platmovetype_end;
- self.platmovetype_start = self.platmovetype_start_default;
- self.platmovetype_end = self.platmovetype_end_default;
+ this.platmovetype_start = this.platmovetype_start_default;
+ this.platmovetype_end = this.platmovetype_end_default;
- SUB_CalcMove_Bezier(self, cp_org, targ.origin - self.view_ofs, TSPEED_LINEAR, targ.speed, train_wait);
+ SUB_CalcMove_Bezier(this, cp_org, targ.origin - this.view_ofs, TSPEED_LINEAR, targ.speed, train_wait);
- SUB_CalcMove(self, targ.origin - self.view_ofs, TSPEED_LINEAR, targ.speed, train_wait);
+ SUB_CalcMove(this, targ.origin - this.view_ofs, TSPEED_LINEAR, targ.speed, train_wait);
- SUB_CalcMove_Bezier(self, cp_org, targ.origin - self.view_ofs, TSPEED_LINEAR, self.speed, train_wait);
+ SUB_CalcMove_Bezier(this, cp_org, targ.origin - this.view_ofs, TSPEED_LINEAR, this.speed, train_wait);
- SUB_CalcMove(self, targ.origin - self.view_ofs, TSPEED_LINEAR, self.speed, train_wait);
+ SUB_CalcMove(this, targ.origin - this.view_ofs, TSPEED_LINEAR, this.speed, train_wait);
- if(self.noise != "")
- _sound(self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_IDLE);
+ if(this.noise != "")
+ _sound(this, CH_TRIGGER_SINGLE, this.noise, VOL_BASE, ATTEN_IDLE);
- WriteString(MSG_ENTITY, self.platmovetype);
- WriteByte(MSG_ENTITY, self.platmovetype_turn);
- WriteByte(MSG_ENTITY, self.spawnflags);
+ WriteString(MSG_ENTITY, this.platmovetype);
+ WriteByte(MSG_ENTITY, this.platmovetype_turn);
+ WriteByte(MSG_ENTITY, this.spawnflags);
- WriteCoord(MSG_ENTITY, self.pos1_x);
- WriteCoord(MSG_ENTITY, self.pos1_y);
- WriteCoord(MSG_ENTITY, self.pos1_z);
- WriteCoord(MSG_ENTITY, self.pos2_x);
- WriteCoord(MSG_ENTITY, self.pos2_y);
- WriteCoord(MSG_ENTITY, self.pos2_z);
+ WriteCoord(MSG_ENTITY, this.pos1_x);
+ WriteCoord(MSG_ENTITY, this.pos1_y);
+ WriteCoord(MSG_ENTITY, this.pos1_z);
+ WriteCoord(MSG_ENTITY, this.pos2_x);
+ WriteCoord(MSG_ENTITY, this.pos2_y);
+ WriteCoord(MSG_ENTITY, this.pos2_z);
- WriteCoord(MSG_ENTITY, self.size_x);
- WriteCoord(MSG_ENTITY, self.size_y);
- WriteCoord(MSG_ENTITY, self.size_z);
+ WriteCoord(MSG_ENTITY, this.size_x);
+ WriteCoord(MSG_ENTITY, this.size_y);
+ WriteCoord(MSG_ENTITY, this.size_z);
- WriteCoord(MSG_ENTITY, self.view_ofs_x);
- WriteCoord(MSG_ENTITY, self.view_ofs_y);
- WriteCoord(MSG_ENTITY, self.view_ofs_z);
+ WriteCoord(MSG_ENTITY, this.view_ofs_x);
+ WriteCoord(MSG_ENTITY, this.view_ofs_y);
+ WriteCoord(MSG_ENTITY, this.view_ofs_z);
- WriteAngle(MSG_ENTITY, self.mangle_x);
- WriteAngle(MSG_ENTITY, self.mangle_y);
- WriteAngle(MSG_ENTITY, self.mangle_z);
+ WriteAngle(MSG_ENTITY, this.mangle_x);
+ WriteAngle(MSG_ENTITY, this.mangle_y);
+ WriteAngle(MSG_ENTITY, this.mangle_z);
- WriteShort(MSG_ENTITY, self.speed);
- WriteShort(MSG_ENTITY, self.height);
- WriteByte(MSG_ENTITY, self.lip);
- WriteByte(MSG_ENTITY, self.state);
- WriteByte(MSG_ENTITY, self.wait);
+ WriteShort(MSG_ENTITY, this.speed);
+ WriteShort(MSG_ENTITY, this.height);
+ WriteByte(MSG_ENTITY, this.lip);
+ WriteByte(MSG_ENTITY, this.state);
+ WriteByte(MSG_ENTITY, this.wait);
- WriteShort(MSG_ENTITY, self.dmg);
- WriteByte(MSG_ENTITY, self.dmgtime);
+ WriteShort(MSG_ENTITY, this.dmg);
+ WriteByte(MSG_ENTITY, this.dmgtime);
- //Net_LinkEntity(self, 0, false, train_send);
+ //Net_LinkEntity(this, 0, false, train_send);
- targ = find(world, targetname, self.target);
- self.target = targ.target;
- if (self.target == "")
+ targ = find(world, targetname, this.target);
+ this.target = targ.target;
+ if (this.target == "")
- self.SUB_NEXTTHINK = self.SUB_LTIME + 1;
- SUB_THINK(self, train_next);
+ this.SUB_NEXTTHINK = this.SUB_LTIME + 1;
+ SUB_THINK(this, train_next);