X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ffunc%2Ftrain.qc;h=ead086708196889075c18ae958df185dccb02606;hb=05d2779856eda44ed6c8779ab55380fa006cfcb4;hp=838632b750a7a97ca1a2c0e426a2fd724614e399;hpb=30648cd6167b20ad5924c03cd39efff9ef5b62df;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/func/train.qc b/qcsrc/common/triggers/func/train.qc index 838632b75..ead086708 100644 --- a/qcsrc/common/triggers/func/train.qc +++ b/qcsrc/common/triggers/func/train.qc @@ -29,7 +29,7 @@ void train_wait(entity this) ang_x = -ang_x; // flip up / down orientation if(this.wait > 0) // slow turning - SUB_CalcAngleMove(this, ang, TSPEED_TIME, this.SUB_LTIME - time + this.wait, train_wait); + SUB_CalcAngleMove(this, ang, TSPEED_TIME, this.ltime - time + this.wait, train_wait); else // instant turning SUB_CalcAngleMove(this, ang, TSPEED_TIME, 0.0000001, train_wait); this.train_wait_turning = true; @@ -46,8 +46,8 @@ void train_wait(entity this) if(tg.spawnflags & 4) { this.use = train_use; - SUB_THINK(this, func_null); - this.SUB_NEXTTHINK = 0; + setthink(this, func_null); + this.nextthink = 0; } else #endif @@ -58,8 +58,8 @@ void train_wait(entity this) } else { - SUB_THINK(this, train_next); - this.SUB_NEXTTHINK = this.SUB_LTIME + this.wait; + setthink(this, train_next); + this.nextthink = this.ltime + this.wait; } } @@ -157,20 +157,12 @@ float train_send(entity this, entity to, float sf) WriteString(MSG_ENTITY, this.curvetarget); - 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); + WriteVector(MSG_ENTITY, this.pos1); + WriteVector(MSG_ENTITY, this.pos2); - WriteCoord(MSG_ENTITY, this.size_x); - WriteCoord(MSG_ENTITY, this.size_y); - WriteCoord(MSG_ENTITY, this.size_z); + WriteVector(MSG_ENTITY, this.size); - WriteCoord(MSG_ENTITY, this.view_ofs_x); - WriteCoord(MSG_ENTITY, this.view_ofs_y); - WriteCoord(MSG_ENTITY, this.view_ofs_z); + WriteVector(MSG_ENTITY, this.view_ofs); WriteAngle(MSG_ENTITY, this.mangle_x); WriteAngle(MSG_ENTITY, this.mangle_y); @@ -201,8 +193,8 @@ void train_link(entity this) void train_use(entity this, entity actor, entity trigger) { - this.SUB_NEXTTHINK = this.SUB_LTIME + 1; - SUB_THINK(this, train_next); + this.nextthink = this.ltime + 1; + setthink(this, train_next); this.use = func_null; // not again if(trigger.target2 && trigger.target2 != "") this.future_target = find(NULL, targetname, trigger.target2); @@ -217,12 +209,12 @@ void func_train_find(entity this) this.future_target = train_next_find(targ); if (this.target == "") objerror(this, "func_train_find: no next target"); - SUB_SETORIGIN(this, targ.origin - this.view_ofs); + setorigin(this, targ.origin - this.view_ofs); if(!(this.spawnflags & 4)) { - this.SUB_NEXTTHINK = this.SUB_LTIME + 1; - SUB_THINK(this, train_next); + this.nextthink = this.ltime + 1; + setthink(this, train_next); } train_link(this); @@ -304,20 +296,12 @@ NET_HANDLE(ENT_CLIENT_TRAIN, bool isnew) this.curvetarget = strzone(ReadString()); - this.pos1_x = ReadCoord(); - this.pos1_y = ReadCoord(); - this.pos1_z = ReadCoord(); - this.pos2_x = ReadCoord(); - this.pos2_y = ReadCoord(); - this.pos2_z = ReadCoord(); + this.pos1 = ReadVector(); + this.pos2 = ReadVector(); - this.size_x = ReadCoord(); - this.size_y = ReadCoord(); - this.size_z = ReadCoord(); + this.size = ReadVector(); - this.view_ofs_x = ReadCoord(); - this.view_ofs_y = ReadCoord(); - this.view_ofs_z = ReadCoord(); + this.view_ofs = ReadVector(); this.mangle_x = ReadAngle(); this.mangle_y = ReadAngle();