X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Ftturrets%2Fsystem%2Fsystem_main.qc;fp=qcsrc%2Fserver%2Ftturrets%2Fsystem%2Fsystem_main.qc;h=8442af17cd1b04e882a3b1efb5748500155fd09c;hp=d56a81bbf06b029c389010de5629bf4fd7e66012;hb=6c4f62990980e74d4a0963b7179c7c964f535398;hpb=9cb8f5c0cdd70570f3694d8f0ccb079753c78e7c diff --git a/qcsrc/server/tturrets/system/system_main.qc b/qcsrc/server/tturrets/system/system_main.qc index d56a81bbf0..8442af17cd 100644 --- a/qcsrc/server/tturrets/system/system_main.qc +++ b/qcsrc/server/tturrets/system/system_main.qc @@ -24,37 +24,37 @@ float turret_send(entity to, float sf) { WriteByte(MSG_ENTITY, self.turret_type); - WriteCoord(MSG_ENTITY, self.origin_x); - WriteCoord(MSG_ENTITY, self.origin_y); - WriteCoord(MSG_ENTITY, self.origin_z); + WriteCoord(MSG_ENTITY, self.origin.x); + WriteCoord(MSG_ENTITY, self.origin.y); + WriteCoord(MSG_ENTITY, self.origin.z); - WriteAngle(MSG_ENTITY, self.angles_x); - WriteAngle(MSG_ENTITY, self.angles_y); + WriteAngle(MSG_ENTITY, self.angles.x); + WriteAngle(MSG_ENTITY, self.angles.y); } if(sf & TNSF_ANG) { - WriteShort(MSG_ENTITY, rint(self.tur_head.angles_x)); - WriteShort(MSG_ENTITY, rint(self.tur_head.angles_y)); + WriteShort(MSG_ENTITY, rint(self.tur_head.angles.x)); + WriteShort(MSG_ENTITY, rint(self.tur_head.angles.y)); } if(sf & TNSF_AVEL) { - WriteShort(MSG_ENTITY, rint(self.tur_head.avelocity_x)); - WriteShort(MSG_ENTITY, rint(self.tur_head.avelocity_y)); + WriteShort(MSG_ENTITY, rint(self.tur_head.avelocity.x)); + WriteShort(MSG_ENTITY, rint(self.tur_head.avelocity.y)); } if(sf & TNSF_MOVE) { - WriteShort(MSG_ENTITY, rint(self.origin_x)); - WriteShort(MSG_ENTITY, rint(self.origin_y)); - WriteShort(MSG_ENTITY, rint(self.origin_z)); + WriteShort(MSG_ENTITY, rint(self.origin.x)); + WriteShort(MSG_ENTITY, rint(self.origin.y)); + WriteShort(MSG_ENTITY, rint(self.origin.z)); - WriteShort(MSG_ENTITY, rint(self.velocity_x)); - WriteShort(MSG_ENTITY, rint(self.velocity_y)); - WriteShort(MSG_ENTITY, rint(self.velocity_z)); + WriteShort(MSG_ENTITY, rint(self.velocity.x)); + WriteShort(MSG_ENTITY, rint(self.velocity.y)); + WriteShort(MSG_ENTITY, rint(self.velocity.z)); - WriteShort(MSG_ENTITY, rint(self.angles_y)); + WriteShort(MSG_ENTITY, rint(self.angles.y)); } if(sf & TNSF_ANIM) @@ -346,8 +346,8 @@ void turret_stdproc_track() target_angle = vectoangles(normalize(self.tur_aimpos - self.tur_shotorg)); } - self.tur_head.angles_x = anglemods(self.tur_head.angles_x); - self.tur_head.angles_y = anglemods(self.tur_head.angles_y); + self.tur_head.angles_x = anglemods(self.tur_head.angles.x); + self.tur_head.angles_y = anglemods(self.tur_head.angles.y); // Find the diffrence between where we currently aim and where we want to aim //move_angle = target_angle - (self.angles + self.tur_head.angles); @@ -362,21 +362,21 @@ void turret_stdproc_track() f_tmp = self.aim_speed * self.ticrate; // dgr/sec -> dgr/tic if (self.track_flags & TFL_TRACK_PITCH) { - self.tur_head.angles_x += bound(-f_tmp,move_angle_x, f_tmp); - if(self.tur_head.angles_x > self.aim_maxpitch) + self.tur_head.angles_x += bound(-f_tmp,move_angle.x, f_tmp); + if(self.tur_head.angles.x > self.aim_maxpitch) self.tur_head.angles_x = self.aim_maxpitch; - if(self.tur_head.angles_x < -self.aim_maxpitch) + if(self.tur_head.angles.x < -self.aim_maxpitch) self.tur_head.angles_x = self.aim_maxpitch; } if (self.track_flags & TFL_TRACK_ROT) { - self.tur_head.angles_y += bound(-f_tmp, move_angle_y, f_tmp); - if(self.tur_head.angles_y > self.aim_maxrot) + self.tur_head.angles_y += bound(-f_tmp, move_angle.y, f_tmp); + if(self.tur_head.angles.y > self.aim_maxrot) self.tur_head.angles_y = self.aim_maxrot; - if(self.tur_head.angles_y < -self.aim_maxrot) + if(self.tur_head.angles.y < -self.aim_maxrot) self.tur_head.angles_y = self.aim_maxrot; } @@ -387,15 +387,15 @@ void turret_stdproc_track() case TFL_TRACKTYPE_FLUIDINERTIA: f_tmp = self.aim_speed * self.ticrate; // dgr/sec -> dgr/tic - move_angle_x = bound(-self.aim_speed, move_angle_x * self.track_accel_pitch * f_tmp, self.aim_speed); - move_angle_y = bound(-self.aim_speed, move_angle_y * self.track_accel_rot * f_tmp, self.aim_speed); + move_angle_x = bound(-self.aim_speed, move_angle.x * self.track_accel_pitch * f_tmp, self.aim_speed); + move_angle_y = bound(-self.aim_speed, move_angle.y * self.track_accel_rot * f_tmp, self.aim_speed); move_angle = (self.tur_head.avelocity * self.track_blendrate) + (move_angle * (1 - self.track_blendrate)); break; case TFL_TRACKTYPE_FLUIDPRECISE: - move_angle_y = bound(-self.aim_speed, move_angle_y, self.aim_speed); - move_angle_x = bound(-self.aim_speed, move_angle_x, self.aim_speed); + move_angle_y = bound(-self.aim_speed, move_angle.y, self.aim_speed); + move_angle_x = bound(-self.aim_speed, move_angle.x, self.aim_speed); break; } @@ -403,8 +403,8 @@ void turret_stdproc_track() // pitch if (self.track_flags & TFL_TRACK_PITCH) { - self.tur_head.avelocity_x = move_angle_x; - if((self.tur_head.angles_x + self.tur_head.avelocity_x * self.ticrate) > self.aim_maxpitch) + self.tur_head.avelocity_x = move_angle.x; + if((self.tur_head.angles.x + self.tur_head.avelocity.x * self.ticrate) > self.aim_maxpitch) { self.tur_head.avelocity_x = 0; self.tur_head.angles_x = self.aim_maxpitch; @@ -412,7 +412,7 @@ void turret_stdproc_track() self.SendFlags |= TNSF_ANG; } - if((self.tur_head.angles_x + self.tur_head.avelocity_x * self.ticrate) < -self.aim_maxpitch) + if((self.tur_head.angles.x + self.tur_head.avelocity.x * self.ticrate) < -self.aim_maxpitch) { self.tur_head.avelocity_x = 0; self.tur_head.angles_x = -self.aim_maxpitch; @@ -424,9 +424,9 @@ void turret_stdproc_track() // rot if (self.track_flags & TFL_TRACK_ROT) { - self.tur_head.avelocity_y = move_angle_y; + self.tur_head.avelocity_y = move_angle.y; - if((self.tur_head.angles_y + self.tur_head.avelocity_y * self.ticrate) > self.aim_maxrot) + if((self.tur_head.angles.y + self.tur_head.avelocity.y * self.ticrate) > self.aim_maxrot) { self.tur_head.avelocity_y = 0; self.tur_head.angles_y = self.aim_maxrot; @@ -434,7 +434,7 @@ void turret_stdproc_track() self.SendFlags |= TNSF_ANG; } - if((self.tur_head.angles_y + self.tur_head.avelocity_y * self.ticrate) < -self.aim_maxrot) + if((self.tur_head.angles.y + self.tur_head.avelocity.y * self.ticrate) < -self.aim_maxrot) { self.tur_head.avelocity_y = 0; self.tur_head.angles_y = -self.aim_maxrot; @@ -677,10 +677,10 @@ float turret_validate_target(entity e_turret, entity e_target, float validate_fl if (validate_flags & TFL_TARGETSELECT_ANGLELIMITS) { - if (fabs(tvt_tadv_x) > e_turret.aim_maxpitch) + if (fabs(tvt_tadv.x) > e_turret.aim_maxpitch) return -17; - if (fabs(tvt_tadv_y) > e_turret.aim_maxrot) + if (fabs(tvt_tadv.y) > e_turret.aim_maxrot) return -18; } @@ -1349,9 +1349,9 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa while (vlen(self.tur_dbg_rvec) < 2) self.tur_dbg_rvec = randomvec() * 4; - self.tur_dbg_rvec_x = fabs(self.tur_dbg_rvec_x); - self.tur_dbg_rvec_y = fabs(self.tur_dbg_rvec_y); - self.tur_dbg_rvec_z = fabs(self.tur_dbg_rvec_z); + self.tur_dbg_rvec_x = fabs(self.tur_dbg_rvec.x); + self.tur_dbg_rvec_y = fabs(self.tur_dbg_rvec.y); + self.tur_dbg_rvec_z = fabs(self.tur_dbg_rvec.z); #endif // Its all good.