From d1142de373be99768650001d5482167a24d51990 Mon Sep 17 00:00:00 2001 From: TimePath Date: Sun, 23 Aug 2015 22:08:28 +1000 Subject: [PATCH] Trim spaces --- qcsrc/client/command/cl_cmd.qc | 2 +- qcsrc/client/controlpoint.qc | 12 +- qcsrc/client/generator.qc | 8 +- qcsrc/client/hud.qc | 28 +-- qcsrc/client/teamradar.qc | 6 +- qcsrc/client/view.qc | 4 +- qcsrc/common/command/generic.qc | 6 +- qcsrc/common/csqcmodel_settings.qh | 2 +- qcsrc/common/effects.qc | 4 +- qcsrc/common/effects.qh | 2 +- qcsrc/common/movetypes/movetypes.qc | 2 +- qcsrc/common/movetypes/push.qh | 2 +- qcsrc/common/movetypes/toss.qh | 2 +- qcsrc/common/p2mathlib.qc | 40 ++--- qcsrc/common/p2mathlib.qh | 8 +- qcsrc/common/physics.qc | 6 +- qcsrc/common/triggers/func/door.qc | 2 +- qcsrc/common/triggers/func/pointparticles.qh | 2 +- qcsrc/common/triggers/func/train.qc | 2 +- qcsrc/common/triggers/trigger/viewloc.qh | 2 +- qcsrc/common/turrets/cl_turrets.qc | 4 +- qcsrc/common/turrets/config.qc | 4 +- qcsrc/common/turrets/sv_turrets.qc | 50 +++--- qcsrc/common/turrets/turrets.qc | 6 +- qcsrc/common/vehicles/sv_vehicles.qc | 6 +- qcsrc/common/vehicles/unit/bumblebee.qc | 42 ++--- qcsrc/common/vehicles/unit/racer.qc | 20 +-- qcsrc/common/vehicles/unit/raptor.qc | 24 +-- qcsrc/common/vehicles/unit/spiderbot.qc | 14 +- qcsrc/common/viewloc.qc | 20 +-- qcsrc/csqcmodellib/cl_player.qc | 2 +- qcsrc/dpdefs/upstream/dpextensions.qc | 14 +- qcsrc/dpdefs/upstream/menudefs.qc | 2 +- qcsrc/menu/xonotic/maplist.qc | 2 +- qcsrc/server/command/cmd.qc | 6 +- qcsrc/server/mutators/gamemode_ctf.qc | 30 ++-- qcsrc/server/mutators/gamemode_onslaught.qc | 178 +++++++++---------- 37 files changed, 283 insertions(+), 283 deletions(-) diff --git a/qcsrc/client/command/cl_cmd.qc b/qcsrc/client/command/cl_cmd.qc index d8e39a80f..e80130c59 100644 --- a/qcsrc/client/command/cl_cmd.qc +++ b/qcsrc/client/command/cl_cmd.qc @@ -287,7 +287,7 @@ void LocalCommand_hud(int request, int argc) HUD_Radar_Show_Maximized(!hud_panel_radar_maximized,0); return; } - + case "clickradar": { HUD_Radar_Show_Maximized(!hud_panel_radar_mouse,1); diff --git a/qcsrc/client/controlpoint.qc b/qcsrc/client/controlpoint.qc index 0eb49899d..a579f93aa 100644 --- a/qcsrc/client/controlpoint.qc +++ b/qcsrc/client/controlpoint.qc @@ -43,9 +43,9 @@ void cpicon_draw() self.cp_bob_origin_z = 4 * PI * (1 - cos(self.cp_bob_spd)); self.cp_bob_spd = self.cp_bob_spd + 1.875 * frametime; self.colormod = '1 1 1' * (2 - bound(0, (self.pain_finished - time) / 10, 1)); - + if(!self.iscaptured) self.alpha = self.health / self.max_health; - + if(self.iscaptured) { if (self.punchangle_x > 0) @@ -92,7 +92,7 @@ void cpicon_draw() self.angles_z = self.punchangle_z; self.move_angles_y = self.move_angles_y + 45 * frametime; } - + setorigin(self, self.cp_origin + self.cp_bob_origin + self.cp_bob_dmg); } @@ -108,7 +108,7 @@ void cpicon_damage(float hp) setmodel(self, "models/onslaught/controlpoint_icon_dmg1.md3"); else if(hp <= self.max_health || hp >= self.max_health) setmodel(self, "models/onslaught/controlpoint_icon.md3"); - + self.punchangle = (2 * randomvec() - '1 1 1') * 45; self.cp_bob_dmg_z = (2 * random() - 1) * 15; @@ -124,7 +124,7 @@ void cpicon_construct() setmodel(self, "models/onslaught/controlpoint_icon.md3"); setsize(self, CPICON_MIN, CPICON_MAX); - + if(self.icon_realmodel == world) { self.icon_realmodel = spawn(); @@ -135,7 +135,7 @@ void cpicon_construct() self.icon_realmodel.solid = SOLID_NOT; self.icon_realmodel.move_origin = self.icon_realmodel.origin; } - + if(self.iscaptured) { self.icon_realmodel.solid = SOLID_BBOX; } self.move_movetype = MOVETYPE_NOCLIP; diff --git a/qcsrc/client/generator.qc b/qcsrc/client/generator.qc index fe19cc65c..0c2ce4681 100644 --- a/qcsrc/client/generator.qc +++ b/qcsrc/client/generator.qc @@ -45,7 +45,7 @@ void ons_generator_ray_draw() { if(time < self.move_time) return; - + self.move_time = time + 0.05; if(self.count > 10) @@ -96,9 +96,9 @@ void generator_draw() } else pointparticles(particleeffectnum("torch_small"), self.origin + randompos('-60 -60 -20', '60 60 60'), '0 0 0', 1); - + self.move_time = time + 0.1; - + return; } @@ -114,7 +114,7 @@ void generator_draw() sound(self, CH_TRIGGER, "onslaught/shockwave.wav", VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum("electro_combo"), self.origin, '0 0 0', 6); } - + // rays if(random() > 0.25) { diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 08703095c..cfa00a1af 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -2030,14 +2030,14 @@ void HUD_Radar_Show_Maximized(bool doshow,float clickable) { hud_panel_radar_maximized = doshow; hud_panel_radar_temp_hidden = 0; - + if ( doshow ) { if (clickable) { if(autocvar_hud_cursormode) setcursormode(1); - hud_panel_radar_mouse = 1; + hud_panel_radar_mouse = 1; } } else if ( hud_panel_radar_mouse ) @@ -2057,7 +2057,7 @@ void HUD_Radar_Hide_Maximized() float HUD_Radar_InputEvent(float bInputType, float nPrimary, float nSecondary) { - if(!hud_panel_radar_maximized || !hud_panel_radar_mouse || + if(!hud_panel_radar_maximized || !hud_panel_radar_mouse || autocvar__hud_configure || mv_active) return false; @@ -2099,7 +2099,7 @@ float HUD_Radar_InputEvent(float bInputType, float nPrimary, float nSecondary) if(nPrimary == stof(argv(i))) return false; } - + if ( getstati(STAT_HEALTH) <= 0 ) { // Show scoreboard @@ -2119,7 +2119,7 @@ float HUD_Radar_InputEvent(float bInputType, float nPrimary, float nSecondary) } else if ( bInputType == 0 ) HUD_Radar_Hide_Maximized(); - + return false; } @@ -2130,19 +2130,19 @@ void HUD_Radar_Mouse() { if ( !hud_panel_radar_mouse ) return; if(mv_active) return; - + if ( intermission ) { HUD_Radar_Hide_Maximized(); return; } - + if(mouseClicked & S_MOUSE2) { HUD_Radar_Hide_Maximized(); return; } - + if(!autocvar_hud_cursormode) { mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed; @@ -2152,14 +2152,14 @@ void HUD_Radar_Mouse() } HUD_Panel_UpdateCvars(); - - + + panel_size = autocvar_hud_panel_radar_maximized_size; panel_size_x = bound(0.2, panel_size_x, 1) * vid_conwidth; panel_size_y = bound(0.2, panel_size_y, 1) * vid_conheight; panel_pos_x = (vid_conwidth - panel_size_x) / 2; panel_pos_y = (vid_conheight - panel_size_y) / 2; - + if(mouseClicked & S_MOUSE1) { // click outside @@ -2171,11 +2171,11 @@ void HUD_Radar_Mouse() } vector pos = teamradar_texcoord_to_3dcoord(teamradar_2dcoord_to_texcoord(mousepos),view_origin_z); localcmd(sprintf("cmd ons_spawn %f %f %f",pos_x,pos_y,pos_z)); - + HUD_Radar_Hide_Maximized(); return; } - + const vector cursor_size = '32 32 0'; drawpic(mousepos-'8 4 0', strcat("gfx/menu/", autocvar_menu_skin, "/cursor.tga"), cursor_size, '1 1 1', 0.8, DRAWFLAG_NORMAL); @@ -2390,7 +2390,7 @@ void HUD_Radar(void) drawresetcliparea(); if ( hud_panel_radar_mouse ) - { + { string message = "Click to select teleport destination"; if ( getstati(STAT_HEALTH) <= 0 ) diff --git a/qcsrc/client/teamradar.qc b/qcsrc/client/teamradar.qc index e1f118c2c..874fec1f5 100644 --- a/qcsrc/client/teamradar.qc +++ b/qcsrc/client/teamradar.qc @@ -51,15 +51,15 @@ vector teamradar_2dcoord_to_texcoord(vector in) { vector out; out = in; - + out -= teamradar_origin2d; if(v_flipped) out_x = -out_x; out = out / teamradar_size; - + out_y = - out_y; // screen space is reversed out = rotate(out, -teamradar_angle * DEG2RAD); - + out += teamradar_origin3d_in_texcoord; return out; diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 970cf6234..e846a662b 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -1115,7 +1115,7 @@ void CSQC_UpdateView(float w, float h) float vehicle_chase = (hud != HUD_NORMAL && (autocvar_cl_eventchase_vehicle || spectatee_status > 0)); float ons_roundlost = (gametype == MAPINFO_TYPE_ONSLAUGHT && getstati(STAT_ROUNDLOST)); entity gen = world; - + if(ons_roundlost) { entity e; @@ -1835,7 +1835,7 @@ void CSQC_UpdateView(float w, float h) if(autocvar__hud_configure) HUD_Panel_Mouse(); - else + else HUD_Radar_Mouse(); if(hud && !intermission) diff --git a/qcsrc/common/command/generic.qc b/qcsrc/common/command/generic.qc index 9fa9872a2..d12cc064e 100644 --- a/qcsrc/common/command/generic.qc +++ b/qcsrc/common/command/generic.qc @@ -373,7 +373,7 @@ void GenericCommand_dumpturrets(float request) tur_config_file = -1; tur_config_alsoprint = -1; string filename = argv(1); - + if(filename == "") { filename = "turrets_dump.cfg"; @@ -385,7 +385,7 @@ void GenericCommand_dumpturrets(float request) tur_config_alsoprint = TRUE; } tur_config_file = fopen(filename, FILE_WRITE); - + if(tur_config_file >= 0) { Dump_Turret_Settings(); @@ -403,7 +403,7 @@ void GenericCommand_dumpturrets(float request) #endif return; } - + default: case CMD_REQUEST_USAGE: { diff --git a/qcsrc/common/csqcmodel_settings.qh b/qcsrc/common/csqcmodel_settings.qh index ac14969f2..e11604aae 100644 --- a/qcsrc/common/csqcmodel_settings.qh +++ b/qcsrc/common/csqcmodel_settings.qh @@ -61,7 +61,7 @@ CSQCMODEL_PROPERTY(1024, float, ReadAngle, WriteAngle, v_angle_x) \ CSQCMODEL_PROPERTY_SCALED(4096, float, ReadByte, WriteByte, scale, 16, 0, 255) \ CSQCMODEL_PROPERTY(8192, int, ReadInt24_t, WriteInt24_t, dphitcontentsmask) \ - CSQCMODEL_PROPERTY(16384, TAG_VIEWLOC_TYPE, ReadShort, WriteEntity, TAG_VIEWLOC_NAME) + CSQCMODEL_PROPERTY(16384, TAG_VIEWLOC_TYPE, ReadShort, WriteEntity, TAG_VIEWLOC_NAME) // TODO get rid of colormod/glowmod here, find good solution for vortex charge glowmod hack; also get rid of some useless properties on non-players that only exist for CopyBody // add hook function calls here diff --git a/qcsrc/common/effects.qc b/qcsrc/common/effects.qc index 81dbd704f..349fdffbf 100644 --- a/qcsrc/common/effects.qc +++ b/qcsrc/common/effects.qc @@ -34,7 +34,7 @@ void Read_Effect(bool is_new) vel_y = ReadCoord(); vel_z = ReadCoord(); } - + if(!eff_trail) eff_cnt = ReadByte(); @@ -117,4 +117,4 @@ void Send_Effect(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt) Net_LinkEntity(net_eff, false, 0, Net_Write_Effect); } -#endif \ No newline at end of file +#endif diff --git a/qcsrc/common/effects.qh b/qcsrc/common/effects.qh index 5262dee54..790d8a7db 100644 --- a/qcsrc/common/effects.qh +++ b/qcsrc/common/effects.qh @@ -91,7 +91,7 @@ EFFECT(0, EFFECT_ITEM_PICKUP, "item_pickup") \ EFFECT(0, EFFECT_ITEM_RESPAWN, "item_respawn") \ EFFECT(0, EFFECT_JUMPPAD, "jumppad_activate") \ - EFFECT(1, EFFECT_BULLET, "tr_bullet") + EFFECT(1, EFFECT_BULLET, "tr_bullet") diff --git a/qcsrc/common/movetypes/movetypes.qc b/qcsrc/common/movetypes/movetypes.qc index 3dd286e00..90be7738c 100644 --- a/qcsrc/common/movetypes/movetypes.qc +++ b/qcsrc/common/movetypes/movetypes.qc @@ -42,7 +42,7 @@ int _Movetype_FlyMove(float dt, bool applygravity, vector stepnormal, float step for(i = 0; i <= MAX_CLIP_PLANES; ++i) planes[i] = '0 0 0'; - + grav = 0; restore_velocity = self.move_velocity; diff --git a/qcsrc/common/movetypes/push.qh b/qcsrc/common/movetypes/push.qh index 44d5442ea..685982b14 100644 --- a/qcsrc/common/movetypes/push.qh +++ b/qcsrc/common/movetypes/push.qh @@ -3,4 +3,4 @@ void _Movetype_Physics_Pusher(float dt); -#endif \ No newline at end of file +#endif diff --git a/qcsrc/common/movetypes/toss.qh b/qcsrc/common/movetypes/toss.qh index 9e1159535..63152e007 100644 --- a/qcsrc/common/movetypes/toss.qh +++ b/qcsrc/common/movetypes/toss.qh @@ -3,4 +3,4 @@ void _Movetype_Physics_Toss(float dt); -#endif \ No newline at end of file +#endif diff --git a/qcsrc/common/p2mathlib.qc b/qcsrc/common/p2mathlib.qc index ad569ffbc..85c5396d7 100644 --- a/qcsrc/common/p2mathlib.qc +++ b/qcsrc/common/p2mathlib.qc @@ -1,22 +1,22 @@ /* Copyright (C) 2015 Micah Talkiewicz. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - + See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - + vector vec_bias(vector v, float f){ vector c; c_x = v_x + f; @@ -31,7 +31,7 @@ vector vec_to_min (vector a, vector b) { c_z = min (a_z, b_z); return c; } - + vector vec_to_max (vector a, vector b) { vector c; c_x = max (a_x, b_x); @@ -39,46 +39,46 @@ vector vec_to_max (vector a, vector b) { c_z = max (a_z, b_z); return c; } - + // there may already be a function for bounding a vector in this manner, however my very quick search did not reveal one -- Player_2 vector vec_bounds_in (vector point, vector a, vector b) { vector c, d, e; - + d = vec_to_min(a,b); e = vec_to_max(a,b); - + c = vec_to_max(point, d); c = vec_to_min(c, e); - + return c; - + } - + vector vec_bounds_out (vector point, vector a, vector b) { vector c, d, e; - + d = vec_to_max(a,b); e = vec_to_min(a,b); - + c = vec_to_max(point, d); c = vec_to_min(c, e); - + return c; - + } - + float angle_snap_f (float f, float increment){ - + float i; for (i = 0; i <= 360; ){ if (f <= i - increment) return i - increment; i = i + increment; } - + return 0; } - + vector angle_snap_vec (vector v, float increment) { vector c; c_x = angle_snap_f (v_x, increment); diff --git a/qcsrc/common/p2mathlib.qh b/qcsrc/common/p2mathlib.qh index a8dc7ab44..c92f26a91 100644 --- a/qcsrc/common/p2mathlib.qh +++ b/qcsrc/common/p2mathlib.qh @@ -1,17 +1,17 @@ /* Copyright (C) 2015 Micah Talkiewicz. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - + See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. diff --git a/qcsrc/common/physics.qc b/qcsrc/common/physics.qc index 6c0bd616b..e5b83443f 100644 --- a/qcsrc/common/physics.qc +++ b/qcsrc/common/physics.qc @@ -327,7 +327,7 @@ void PM_ClientMovement_Move() vector trace1_plane_normal = '0 0 0'; vector trace2_plane_normal = '0 0 0'; vector trace3_plane_normal = '0 0 0'; - + PM_ClientMovement_UpdateStatus(false); primalvelocity = self.velocity; @@ -1668,7 +1668,7 @@ void PM_Main() PM_ClientMovement_UpdateStatus(true); #endif - + #ifdef SVQC WarpZone_PlayerPhysics_FixVAngle(); @@ -1936,7 +1936,7 @@ void CSQC_ClientMovement_PlayerMove_Frame(void) PM_Main(); #ifdef CSQC - self.pmove_flags = + self.pmove_flags = ((self.flags & FL_DUCKED) ? PMF_DUCKED : 0) | (!(self.flags & FL_JUMPRELEASED) ? 0 : PMF_JUMP_HELD) | ((self.flags & FL_ONGROUND) ? PMF_ONGROUND : 0); diff --git a/qcsrc/common/triggers/func/door.qc b/qcsrc/common/triggers/func/door.qc index 1b6216341..04f8f2416 100644 --- a/qcsrc/common/triggers/func/door.qc +++ b/qcsrc/common/triggers/func/door.qc @@ -27,7 +27,7 @@ void() door_rotating_go_up; void door_blocked() { - if((self.spawnflags & 8) + if((self.spawnflags & 8) #ifdef SVQC && (other.takedamage != DAMAGE_NO) #elif defined(CSQC) diff --git a/qcsrc/common/triggers/func/pointparticles.qh b/qcsrc/common/triggers/func/pointparticles.qh index d446e7225..f08ea4875 100644 --- a/qcsrc/common/triggers/func/pointparticles.qh +++ b/qcsrc/common/triggers/func/pointparticles.qh @@ -2,4 +2,4 @@ void Ent_PointParticles(); -#endif \ No newline at end of file +#endif diff --git a/qcsrc/common/triggers/func/train.qc b/qcsrc/common/triggers/func/train.qc index 001a75985..0de348938 100644 --- a/qcsrc/common/triggers/func/train.qc +++ b/qcsrc/common/triggers/func/train.qc @@ -200,7 +200,7 @@ void spawnfunc_func_train() if (!InitMovingBrushTrigger()) return; self.effects |= EF_LOWPRECISION; - + if (self.spawnflags & 2) { self.platmovetype_turn = true; diff --git a/qcsrc/common/triggers/trigger/viewloc.qh b/qcsrc/common/triggers/trigger/viewloc.qh index c7fd150d5..6708a8e47 100644 --- a/qcsrc/common/triggers/trigger/viewloc.qh +++ b/qcsrc/common/triggers/trigger/viewloc.qh @@ -12,4 +12,4 @@ void ent_viewloc(); void ent_viewloc_trigger(); #endif -#endif \ No newline at end of file +#endif diff --git a/qcsrc/common/turrets/cl_turrets.qc b/qcsrc/common/turrets/cl_turrets.qc index c39b938b8..f0b3bdf0e 100644 --- a/qcsrc/common/turrets/cl_turrets.qc +++ b/qcsrc/common/turrets/cl_turrets.qc @@ -240,7 +240,7 @@ void turret_construct() self.maxdistance = autocvar_g_waypointsprite_turrets_maxdist; self.teamradar_color = '1 0 0'; self.alpha = 1; - + TUR_ACTION(self.turretid, TR_SETUP); } @@ -371,7 +371,7 @@ void ent_turret() self.angles_x = ReadAngle(); self.angles_y = ReadAngle(); - + turret_construct(); self.colormap = 1024; self.glowmod = '0 1 1'; diff --git a/qcsrc/common/turrets/config.qc b/qcsrc/common/turrets/config.qc index 895b469f7..547b5c6f2 100644 --- a/qcsrc/common/turrets/config.qc +++ b/qcsrc/common/turrets/config.qc @@ -21,7 +21,7 @@ float T_Config_Queue_Compare(float root, float child, entity pass) else if(c > r) { return -1; } else { return 1; } } - + return 0; } @@ -40,7 +40,7 @@ void Dump_Turret_Settings(void) // step 3: sort queue heapsort(TUR_CONFIG_COUNT, T_Config_Queue_Swap, T_Config_Queue_Compare, world); - + // step 4: write queue TUR_CONFIG_WRITETOFILE(sprintf("// {{{ #%d: %s\n", i, TUR_NAME(i))) for(x = 0; x <= TUR_CONFIG_COUNT; ++x) diff --git a/qcsrc/common/turrets/sv_turrets.qc b/qcsrc/common/turrets/sv_turrets.qc index 4c309b240..fa5318dc2 100644 --- a/qcsrc/common/turrets/sv_turrets.qc +++ b/qcsrc/common/turrets/sv_turrets.qc @@ -24,7 +24,7 @@ vector turret_aim_generic() if (self.aim_flags & TFL_AIM_SHOTTIMECOMPENSATE) // Need to conpensate for shot traveltime { prep = pre_pos; - + distance = vlen(prep - self.tur_shotorg); impact_time = distance / self.shot_speed; @@ -274,7 +274,7 @@ void turret_respawn() self.think = turret_think; self.SendFlags = TNSF_FULL_UPDATE; - + TUR_ACTION(self.turretid, TR_SETUP); } @@ -978,7 +978,7 @@ void turret_fire() { if (autocvar_g_turrets_nofire != 0) return; - + TUR_ACTION(self.turretid, TR_ATTACK); self.attack_finished_single = time + self.shot_refire; @@ -1106,7 +1106,7 @@ void turret_think() // Fire! if (self.turret_firecheckfunc() != 0) turret_fire(); - + TUR_ACTION(self.turretid, TR_THINK); return; @@ -1144,7 +1144,7 @@ void turret_think() // Turn & pitch if(!(self.track_flags & TFL_TRACK_NO)) turret_track(); - + TUR_ACTION(self.turretid, TR_THINK); // And bail. @@ -1244,7 +1244,7 @@ float turret_initialize(float tur_id) self.cvar_basename = tur.cvar_basename; load_unit_settings(self, self.cvar_basename, 0); - + if(!self.team || !teamplay) { self.team = MAX_SHOT_DISTANCE; } if(!self.ticrate) { self.ticrate = ((self.turret_flags & TUR_FLAG_SUPPORT) ? 0.2 : 0.1); } if(!self.health) { self.health = 1000; } @@ -1259,19 +1259,19 @@ float turret_initialize(float tur_id) if(!self.target_select_flags) { self.target_select_flags = TFL_TARGETSELECT_LOS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_RANGELIMITS | TFL_TARGETSELECT_ANGLELIMITS; } if(!self.firecheck_flags) { self.firecheck_flags = TFL_FIRECHECK_DEAD | TFL_FIRECHECK_DISTANCES | TFL_FIRECHECK_LOS | TFL_FIRECHECK_AIMDIST | TFL_FIRECHECK_TEAMCHECK | TFL_FIRECHECK_AMMO_OWN | TFL_FIRECHECK_REFIRE; } - + if(self.track_type != TFL_TRACKTYPE_STEPMOTOR) { // Fluid / Ineria mode. Looks mutch nicer. // Can reduce aim preformance alot, needs a bit diffrent aimspeed - + self.aim_speed = bound(0.1, ((!self.aim_speed) ? 180 : self.aim_speed), 1000); - + if(!self.track_accel_pitch) { self.track_accel_pitch = 0.5; } if(!self.track_accel_rotate) { self.track_accel_rotate = 0.5; } if(!self.track_blendrate) { self.track_blendrate = 0.35; } } - + self.respawntime = max(-1, ((!self.respawntime) ? 60 : self.respawntime)); self.shot_refire = bound(0.01, ((!self.shot_refire) ? 1 : self.shot_refire), 9999); self.shot_dmg = max(1, ((!self.shot_dmg) ? self.shot_refire * 50 : self.shot_dmg)); @@ -1295,31 +1295,31 @@ float turret_initialize(float tur_id) self.target_select_playerbias = bound(-10, ((!self.target_select_playerbias) ? 1 : self.target_select_playerbias), 10); self.ammo_max = max(self.shot_dmg, ((!self.ammo_max) ? self.shot_dmg * 10 : self.ammo_max)); self.ammo_recharge = max(0, ((!self.ammo_recharge) ? self.shot_dmg * 0.5 : self.ammo_recharge)); - + self.turret_flags = TUR_FLAG_ISTURRET | (tur.spawnflags); - + if(self.turret_flags & TUR_FLAG_SPLASH) self.aim_flags |= TFL_AIM_SPLASH; - + if(self.turret_flags & TUR_FLAG_MISSILE) self.target_select_flags |= TFL_TARGETSELECT_MISSILES; if(self.turret_flags & TUR_FLAG_PLAYER) self.target_select_flags |= TFL_TARGETSELECT_PLAYERS; - + if(self.spawnflags & TSL_NO_RESPAWN) self.damage_flags |= TFL_DMG_DEATH_NORESPAWN; - + if (self.turret_flags & TUR_FLAG_SUPPORT) self.turret_score_target = turret_targetscore_support; else self.turret_score_target = turret_targetscore_generic; - + ++turret_count; - + setmodel(self, tur.model); setsize(self, tur.mins, tur.maxs); - + self.turretid = tur_id; self.classname = "turret_main"; self.active = ACTIVE_ACTIVE; @@ -1340,20 +1340,20 @@ float turret_initialize(float tur_id) self.bot_attack = true; self.nextthink = time + 1; self.nextthink += turret_count * sys_frametime; - + self.tur_head = spawn(); setmodel(self.tur_head, tur.head_model); setsize(self.tur_head, '0 0 0', '0 0 0'); setorigin(self.tur_head, '0 0 0'); setattachment(self.tur_head, self, "tag_head"); - + self.tur_head.netname = self.tur_head.classname = "turret_head"; self.tur_head.team = self.team; self.tur_head.owner = self; self.tur_head.takedamage = DAMAGE_NO; self.tur_head.solid = SOLID_NOT; self.tur_head.movetype = self.movetype; - + if(!self.tur_defend) if(self.target != "") { @@ -1364,12 +1364,12 @@ float turret_initialize(float tur_id) dprint("Turret has invalid defendpoint!\n"); } } - + if (self.tur_defend) self.idle_aim = self.tur_head.angles + angleofs(self.tur_head, self.tur_defend); else self.idle_aim = '0 0 0'; - + #ifdef TURRET_DEBUG self.tur_debug_start = self.nextthink; while (vlen(self.tur_debug_rvec) < 2) @@ -1383,9 +1383,9 @@ float turret_initialize(float tur_id) turret_link(); turret_respawn(); turret_tag_fire_update(); - + TUR_ACTION(tur_id, TR_SETUP); - + if(MUTATOR_CALLHOOK(TurretSpawn, self)) return false; diff --git a/qcsrc/common/turrets/turrets.qc b/qcsrc/common/turrets/turrets.qc index a99d1f1e9..a47b97569 100644 --- a/qcsrc/common/turrets/turrets.qc +++ b/qcsrc/common/turrets/turrets.qc @@ -17,10 +17,10 @@ void turrets_common_precache() precache_model ("models/turrets/head-gib4.md3"); precache_model ("models/turrets/base.md3"); precache_model ("models/turrets/rocket.md3"); - + precache_model ("models/turrets/c512.md3"); precache_model ("models/marker.md3"); - + #ifdef TURRET_DEBUG precache_model ("models/turrets/c512.md3"); precache_model ("models/pathlib/goodsquare.md3"); @@ -46,7 +46,7 @@ void register_turret(float id, float(float) func, float turretflags, vector min_ e.maxs = max_s; e.model = strzone(strcat("models/turrets/", modelname)); e.head_model = strzone(strcat("models/turrets/", headmodelname)); - + #ifndef MENUQC turrets_common_precache(); #endif diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index 79f59018d..d4b1e1acf 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -1123,10 +1123,10 @@ void vehicles_enter(entity pl, entity veh) void vehicles_think() { self.nextthink = time; - + if(self.owner) self.owner.vehicle_weapon2mode = self.vehicle_weapon2mode; - + VEH_ACTION(self.vehicleid, VR_THINK); CSQCMODEL_AUTOUPDATE(); @@ -1190,7 +1190,7 @@ bool vehicle_initialize(entity veh, bool nodrop) if(!veh.vehicleid) return false; - + if(!veh.tur_head) { VEH_ACTION(veh.vehicleid, VR_PRECACHE); } if(self.targetname && self.targetname != "") diff --git a/qcsrc/common/vehicles/unit/bumblebee.qc b/qcsrc/common/vehicles/unit/bumblebee.qc index 25e274ea6..f6cfb65fe 100644 --- a/qcsrc/common/vehicles/unit/bumblebee.qc +++ b/qcsrc/common/vehicles/unit/bumblebee.qc @@ -430,7 +430,7 @@ float bumblebee_pilot_frame() { entity pilot, vehic; vector newvel; - + if(intermission_running) { self.vehicle.velocity = '0 0 0'; @@ -661,7 +661,7 @@ void bumblebee_land() self.think = vehicles_think; self.nextthink = time; - + CSQCMODEL_AUTOUPDATE(); } @@ -680,7 +680,7 @@ void bumblebee_exit(float eject) self.think = bumblebee_land; self.nextthink = time; } - + self.movetype = MOVETYPE_TOSS; if(!self.owner) @@ -782,7 +782,7 @@ float v_bumblebee(float req) { if(autocvar_g_vehicle_bumblebee_bouncepain) vehicles_impact(autocvar_g_vehicle_bumblebee_bouncepain_x, autocvar_g_vehicle_bumblebee_bouncepain_y, autocvar_g_vehicle_bumblebee_bouncepain_z); - + return true; } case VR_ENTER: @@ -796,12 +796,12 @@ float v_bumblebee(float req) { self.angles_z *= 0.8; self.angles_x *= 0.8; - + self.nextthink = time; - + if(!self.owner) { - entity oldself = self; + entity oldself = self; if(self.gunner1) { self = self.gunner1; @@ -814,7 +814,7 @@ float v_bumblebee(float req) other = oldother; return true; } - + if(self.gunner2) { self = self.gunner2; @@ -826,9 +826,9 @@ float v_bumblebee(float req) self.touch(); other = oldother; return true; - } + } } - + return true; } case VR_DEATH: @@ -840,7 +840,7 @@ float v_bumblebee(float req) // Hide beam if(self.gun3.enemy || !wasfreed(self.gun3.enemy)) self.gun3.enemy.effects |= EF_NODRAW; - + if(self.gunner1) { self = self.gunner1; @@ -868,7 +868,7 @@ float v_bumblebee(float req) _body.touch = bumblebee_blowup; else _body.touch = func_null; - + _body.think = bumblebee_diethink; _body.nextthink = time; _body.wait = time + 2 + (random() * 8); @@ -878,7 +878,7 @@ float v_bumblebee(float req) _body.angles = self.angles; Send_Effect("explosion_medium", findbetterlocation(self.origin, 16), '0 0 0', 1); - + self.health = 0; self.event_damage = func_null; self.solid = SOLID_NOT; @@ -952,14 +952,14 @@ float v_bumblebee(float req) setorigin(self.gun2.vehicle_viewport, '-85 0 50'); self.scale = 1.5; - + // Raygun beam if(self.gun3.enemy == world) - { + { self.gun3.enemy = spawn(); Net_LinkEntity(self.gun3.enemy, true, 0, bumble_raygun_send); - self.gun3.enemy.SendFlags = BRG_SETUP; - self.gun3.enemy.cnt = autocvar_g_vehicle_bumblebee_raygun; + self.gun3.enemy.SendFlags = BRG_SETUP; + self.gun3.enemy.cnt = autocvar_g_vehicle_bumblebee_raygun; self.gun3.enemy.effects = EF_NODRAW | EF_LOWPRECISION; } } @@ -969,9 +969,9 @@ float v_bumblebee(float req) self.solid = SOLID_BBOX; self.movetype = MOVETYPE_TOSS; self.damageforcescale = 0.025; - + self.PlayerPhysplug = bumblebee_pilot_frame; - + setorigin(self, self.origin + '0 0 25'); return true; } @@ -989,13 +989,13 @@ float v_bumblebee(float req) if(autocvar_g_vehicle_bumblebee_health_regen) self.vehicle_flags |= VHF_HEALTHREGEN; - + self.vehicle_exit = bumblebee_exit; self.respawntime = autocvar_g_vehicle_bumblebee_respawntime; self.vehicle_health = autocvar_g_vehicle_bumblebee_health; self.max_health = self.vehicle_health; self.vehicle_shield = autocvar_g_vehicle_bumblebee_shield; - + return true; } case VR_PRECACHE: diff --git a/qcsrc/common/vehicles/unit/racer.qc b/qcsrc/common/vehicles/unit/racer.qc index a73c74680..d6fbbcc2f 100644 --- a/qcsrc/common/vehicles/unit/racer.qc +++ b/qcsrc/common/vehicles/unit/racer.qc @@ -134,7 +134,7 @@ void racer_align4point(float _delta) self.velocity += push_vector * _delta; float uforce = autocvar_g_vehicle_racer_upforcedamper; - + int cont = pointcontents(self.origin - '0 0 64'); if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME) { @@ -145,7 +145,7 @@ void racer_align4point(float _delta) else self.velocity_z += 200; } - + // Anti ocilation if(self.velocity_z > 0) @@ -228,7 +228,7 @@ void racer_rocket_groundhugger() self.velocity = olddir * newvel; self.velocity_z -= 1600 * sys_frametime; // 2x grav looks better for this one } - + int cont = pointcontents(self.origin - '0 0 32'); if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME) self.velocity_z += 200; @@ -578,7 +578,7 @@ void racer_think() self.angles_x *= 1 - (autocvar_g_vehicle_racer_anglestabilizer * pushdeltatime); self.angles_z *= 1 - (autocvar_g_vehicle_racer_anglestabilizer * pushdeltatime); - + CSQCMODEL_AUTOUPDATE(); } @@ -652,10 +652,10 @@ void racer_blowup() void racer_blowup_think() { self.nextthink = time; - + if(time >= self.delay) racer_blowup(); - + CSQCMODEL_AUTOUPDATE(); } @@ -704,7 +704,7 @@ void racer_draw() self.move_angles_x *= 1 - (getstatf(STAT_VEH_RACER_ANGLESTABILIZER) * pushdeltatime); self.move_angles_z *= 1 - (getstatf(STAT_VEH_RACER_ANGLESTABILIZER) * pushdeltatime); - + Movetype_Physics_MatchServer(false); } #endif @@ -736,7 +736,7 @@ bool v_racer(int req) self.move_movetype = MOVETYPE_BOUNCE; #endif - + return true; } @@ -767,9 +767,9 @@ bool v_racer(int req) self.solid = SOLID_SLIDEBOX; self.delay = time; self.scale = 0.5; - + self.PlayerPhysplug = racer_frame; - + self.bouncefactor = autocvar_g_vehicle_racer_bouncefactor; self.bouncestop = autocvar_g_vehicle_racer_bouncestop; self.damageforcescale = 0.5; diff --git a/qcsrc/common/vehicles/unit/raptor.qc b/qcsrc/common/vehicles/unit/raptor.qc index 320b89345..93e1605ae 100644 --- a/qcsrc/common/vehicles/unit/raptor.qc +++ b/qcsrc/common/vehicles/unit/raptor.qc @@ -225,7 +225,7 @@ void raptor_land() } self.nextthink = time; - + CSQCMODEL_AUTOUPDATE(); } @@ -321,7 +321,7 @@ float raptor_frame() player = self; raptor = self.vehicle; self = raptor; - + vehicles_painframe(); /* ftmp = vlen(self.velocity); @@ -653,11 +653,11 @@ float raptor_takeoff() player = self; raptor = self.vehicle; self = raptor; - + self.nextthink = time; CSQCMODEL_AUTOUPDATE(); self.nextthink = 0; // will this work? - + if(self.sound_nexttime < time) { self.sound_nexttime = time + 7.955812; //soundlength("vehicles/raptor_fly.wav"); @@ -731,7 +731,7 @@ void raptor_diethink() Send_Effect("explosion_small", randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1); } self.nextthink = time; - + CSQCMODEL_AUTOUPDATE(); } @@ -803,7 +803,7 @@ float v_raptor(float req) { if(autocvar_g_vehicle_raptor_bouncepain) vehicles_impact(autocvar_g_vehicle_raptor_bouncepain_x, autocvar_g_vehicle_raptor_bouncepain_y, autocvar_g_vehicle_raptor_bouncepain_z); - + return true; } case VR_ENTER: @@ -930,12 +930,12 @@ float v_raptor(float req) self.movetype = MOVETYPE_TOSS; self.solid = SOLID_SLIDEBOX; self.vehicle_energy = 1; - + self.PlayerPhysplug = raptor_frame; self.bomb1.gun1.avelocity_y = 90; self.bomb1.gun2.avelocity_y = -90; - + self.delay = time; self.bouncefactor = autocvar_g_vehicle_raptor_bouncefactor; @@ -958,13 +958,13 @@ float v_raptor(float req) if(autocvar_g_vehicle_raptor_energy_regen) self.vehicle_flags |= VHF_ENERGYREGEN; - + self.vehicle_exit = raptor_exit; self.respawntime = autocvar_g_vehicle_raptor_respawntime; self.vehicle_health = autocvar_g_vehicle_raptor_health; self.vehicle_shield = autocvar_g_vehicle_raptor_shield; self.max_health = self.vehicle_health; - + return true; } case VR_PRECACHE: @@ -979,7 +979,7 @@ float v_raptor(float req) precache_sound ("vehicles/raptor_fly.wav"); precache_sound ("vehicles/raptor_speed.wav"); precache_sound ("vehicles/missile_alarm.wav"); - + return true; } } @@ -1048,7 +1048,7 @@ float v_raptor(float req) case RSM_BOMB: crosshair = vCROSS_BURST; break; default: crosshair = vCROSS_BURST; } - + Vehicles_drawHUD(VEH_RAPTOR.m_icon, "vehicle_raptor_weapon1", "vehicle_raptor_weapon2", "vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color, "vehicle_icon_ammo2", autocvar_hud_progressbar_vehicles_ammo2_color, diff --git a/qcsrc/common/vehicles/unit/spiderbot.qc b/qcsrc/common/vehicles/unit/spiderbot.qc index ca65dc992..0ad0da41d 100644 --- a/qcsrc/common/vehicles/unit/spiderbot.qc +++ b/qcsrc/common/vehicles/unit/spiderbot.qc @@ -260,7 +260,7 @@ void spiderbot_rocket_do() if(self.wait != -10) if(!self.owner.BUTTON_ATCK2) return; - + if(forbidWeaponUse(self.owner)) return; @@ -825,7 +825,7 @@ float v_spiderbot(float req) { if(autocvar_g_vehicle_spiderbot_bouncepain) vehicles_impact(autocvar_g_vehicle_spiderbot_bouncepain_x, autocvar_g_vehicle_spiderbot_bouncepain_y, autocvar_g_vehicle_spiderbot_bouncepain_z); - + return true; } case VR_ENTER: @@ -841,14 +841,14 @@ float v_spiderbot(float req) setattachment(self.owner.flagcarried, self.tur_head, ""); setorigin(self.owner.flagcarried, '-20 0 120'); } - + return true; } case VR_THINK: { if(self.flags & FL_ONGROUND) movelib_beak_simple(autocvar_g_vehicle_spiderbot_speed_stop); - + return true; } case VR_DEATH: @@ -866,7 +866,7 @@ float v_spiderbot(float req) self.colormod = self.tur_head.colormod = '-1 -1 -1'; self.frame = 10; self.movetype = MOVETYPE_TOSS; - + CSQCModel_UnlinkEntity(); // networking the death scene would be a nightmare return true; @@ -899,7 +899,7 @@ float v_spiderbot(float req) self.damageforcescale = 0.03; self.vehicle_health = autocvar_g_vehicle_spiderbot_health; self.vehicle_shield = autocvar_g_vehicle_spiderbot_shield; - + self.PlayerPhysplug = spiderbot_frame; return true; @@ -979,7 +979,7 @@ float v_spiderbot(float req) { AuxiliaryXhair[0].axh_image = vCROSS_HINT; // Minigun1 AuxiliaryXhair[1].axh_image = vCROSS_HINT; // Minigun2 - + return true; } case VR_PRECACHE: diff --git a/qcsrc/common/viewloc.qc b/qcsrc/common/viewloc.qc index ebcdc05c6..24e6d08eb 100644 --- a/qcsrc/common/viewloc.qc +++ b/qcsrc/common/viewloc.qc @@ -83,7 +83,7 @@ void viewloc_SetViewLocation() position_a = view.viewloc.enemy.origin; position_b = view.viewloc.goalentity.origin; -#if 0 +#if 0 /*TODO: have the camera only move when a player moves too much from the center of the camera * basically the player can move around in a "box" in the center of th screen with out changing the camera position or angles */ @@ -97,22 +97,22 @@ void viewloc_SetViewLocation() camera_angle = '0 0 0'; - // a tracking camera follows the player when it leaves the world box + // a tracking camera follows the player when it leaves the world box if (cvar("cam_track")) { camera_angle = aim_vec (camera_position, view.origin); } - + // hard snap changes the angle as soon as it crosses over the nearest 90 degree mark if (cvar("cam_snap_hard")){ camera_angle = angle_snap_vec(aim_vec(camera_position, view.origin), 90); } - + // tries to avoid snapping unless it *really* needs to if (cvar("cam_snap_close")){ - + // like hard snap, but don't snap angles yet. camera_angle = aim_vec(camera_position, view.origin); - + /* if the difference between the old and new angle is 60 degrees or more, switch angles. * NOTE: bug/feature: this will use non-snaped angles for one frame. * doing this resualts in less code, faster code, and a smoother transisition between angles. @@ -124,13 +124,13 @@ void viewloc_SetViewLocation() else camera_angle_y = old_camera_angle_y; } - + //unlocking this allows the camera to look up and down. this also allows a top-down view. if (!cvar("cam_snap_unlock")) { camera_angle_x = 0; camera_angle_z = 0; } - + #if 0 dprint(vtos(camera_position), "\n"); dprint(vtos(old_camera_angle), "\n"); @@ -141,10 +141,10 @@ void viewloc_SetViewLocation() freeze_ang = getpropertyvec(VF_ANGLES); setproperty(VF_ORIGIN, camera_position); setproperty(VF_ANGLES, camera_angle); - + forward = vectoangles(normalize(vec_to_min(position_b, position_a) - vec_to_max(position_b, position_a))); backward = vectoangles(normalize(vec_to_max(position_b, position_a) - vec_to_min(position_b, position_a))); - + if(input_movevalues_y < 0) // left view.angles_y = backward_y; if(input_movevalues_y > 0) // favour right diff --git a/qcsrc/csqcmodellib/cl_player.qc b/qcsrc/csqcmodellib/cl_player.qc index ee0340dd5..30dab91f2 100644 --- a/qcsrc/csqcmodellib/cl_player.qc +++ b/qcsrc/csqcmodellib/cl_player.qc @@ -143,7 +143,7 @@ void PM_Movement_Move() { runstandardplayerphysics(self); #ifdef CSQC - self.flags = + self.flags = ((self.pmove_flags & PMF_DUCKED) ? FL_DUCKED : 0) | (!(self.pmove_flags & PMF_JUMP_HELD) ? FL_JUMPRELEASED : 0) | ((self.pmove_flags & PMF_ONGROUND) ? FL_ONGROUND : 0); diff --git a/qcsrc/dpdefs/upstream/dpextensions.qc b/qcsrc/dpdefs/upstream/dpextensions.qc index 07142e943..fb3dcda7c 100644 --- a/qcsrc/dpdefs/upstream/dpextensions.qc +++ b/qcsrc/dpdefs/upstream/dpextensions.qc @@ -436,7 +436,7 @@ void(entity e, entity tagentity, string tagname) setattachment = #443; // attach //darkplaces implementation: Blub\0 //cvar definitions: // utf8_enable: enable utf8 encoding -//description: utf8 characters are allowed inside cvars, protocol strings, files, progs strings, etc., +//description: utf8 characters are allowed inside cvars, protocol strings, files, progs strings, etc., //and count as 1 char for string functions like strlen, substring, etc. // note: utf8_enable is run-time cvar, could be changed during execution // note: beware that str2chr() could return value bigger than 255 once utf8 is enabled @@ -498,7 +498,7 @@ void(entity e, entity tagentity, string tagname) setattachment = #443; // attach // description: allows alternative 'static' lightstyle syntax : "=value" // examples: "=0.5", "=2.0", "=2.75" // could be used to control switchable lights or making styled lights with brightness > 2 -// Warning: this extension is experimental. It safely works in CSQC, but SVQC use is limited by the fact +// Warning: this extension is experimental. It safely works in CSQC, but SVQC use is limited by the fact // that other engines (which do not support this extension) could connect to a game and misunderstand this kind of lightstyle syntax //DP_LITSPRITES @@ -1360,14 +1360,14 @@ float(string sample) soundlength = #534; // returns length of sound sample in se //syntax of .dpsubs files: each line in .dpsubs file defines 1 subtitle, there are three tokens: // "string" // start: subtitle start time in seconds -// end: subtitle time-to-show in seconds, if 0 - subtitle will be showed until next subtitle is started, +// end: subtitle time-to-show in seconds, if 0 - subtitle will be showed until next subtitle is started, // if below 0 - show until next subtitles minus this number of seconds // text: subtitle text, color codes (Q3-style and ^xRGB) are allowed //example of subtitle file: // 3 0 "Vengeance! Vengeance for my eternity of suffering!" // 9 0 "Whelp! As if you knew what eternity was!" // 13 0 "Grovel before your true master." -// 17 0 "Never!" +// 17 0 "Never!" // 18 7 "I'll hack you from crotch to gizzard and feed what's left of you to your brides..." //DP_SOLIDCORPSE @@ -1734,11 +1734,11 @@ const float FORCETYPE_TORQUE = 3; .vector massofs; // offsets a mass center out of object center, if not set a center of model bounds is used .float friction; // a friction of object, get multiplied by second objects's friction on contact .float bouncefactor; -.float bouncestop; +.float bouncestop; .float jointtype; // type of joint .float forcetype; // type of force -.float erp; // error restitution parameter, makes ODE solver attempt to fix errors in contacts, - // bringing together 2 joints or fixing object being stuch in other object, +.float erp; // error restitution parameter, makes ODE solver attempt to fix errors in contacts, + // bringing together 2 joints or fixing object being stuch in other object, // a value of 0.1 will fix slightly, a value of 1.0 attempts to fix whole error in one frame // use with care as high values makes system unstable and likely to explode //builtin definitions: diff --git a/qcsrc/dpdefs/upstream/menudefs.qc b/qcsrc/dpdefs/upstream/menudefs.qc index 8caab4a92..d1a67ab08 100644 --- a/qcsrc/dpdefs/upstream/menudefs.qc +++ b/qcsrc/dpdefs/upstream/menudefs.qc @@ -304,7 +304,7 @@ float drawstring(vector position, string text, vector scale, vector rgb, float a float drawcolorcodedstring(vector position, string text, vector scale, float alpha, float flag) = #467; vector drawcolorcodedstring2(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #467; - + float drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #456; float drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #457; diff --git a/qcsrc/menu/xonotic/maplist.qc b/qcsrc/menu/xonotic/maplist.qc index 384272ac8..a9379e7e8 100644 --- a/qcsrc/menu/xonotic/maplist.qc +++ b/qcsrc/menu/xonotic/maplist.qc @@ -280,7 +280,7 @@ void MapList_StringFilterBox_Change(entity box, entity me) me.stringFilter = strzone(box.text); else me.stringFilter = string_null; - + me.refilter(me); } diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index a9bd70763..c6d122eed 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -384,7 +384,7 @@ void ClientCommand_physics(float request, float argc) case CMD_REQUEST_COMMAND: { string command = strtolower(argv(1)); - + if(!autocvar_g_physics_clientselect) { sprint(self, "Client physics selection is currently disabled.\n"); @@ -396,7 +396,7 @@ void ClientCommand_physics(float request, float argc) sprint(self, strcat("Available physics sets: \n\n", autocvar_g_physics_clientselect_options, " default\n")); return; } - + if(Physics_Valid(command) || command == "default") { stuffcmd(self, strcat("\nseta cl_physics ", command, "\nsendcvar cl_physics\n")); @@ -404,7 +404,7 @@ void ClientCommand_physics(float request, float argc) return; } } - + default: sprint(self, strcat("Current physics set: ^3", self.cvar_cl_physics, "\n")); case CMD_REQUEST_USAGE: diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 4ebd27a45..87bbb3b99 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -418,7 +418,7 @@ void ctf_Handle_Capture(entity flag, entity toucher, int capturetype) if(!player) { return; } // without someone to give the reward to, we can't possibly cap if(CTF_DIFFTEAM(player, flag)) { return; } - + if(ctf_oneflag) for(tmp_entity = ctf_worldflaglist; tmp_entity; tmp_entity = tmp_entity.ctf_worldflagnext) if(SAME_TEAM(tmp_entity, player)) @@ -556,13 +556,13 @@ void ctf_Handle_Pickup(entity flag, entity player, int pickuptype) else { Send_Notification(NOTIF_ONE, player, MSG_CENTER, ((SAME_TEAM(player, flag)) ? CENTER_CTF_PICKUP_TEAM : CENTER_CTF_PICKUP_TEAM_ENEMY), Team_ColorCode(flag.team)); } Send_Notification(NOTIF_TEAM_EXCEPT, player, MSG_CHOICE, ((flag.team) ? APP_TEAM_ENT_4(flag, CHOICE_CTF_PICKUP_TEAM_) : CHOICE_CTF_PICKUP_TEAM_NEUTRAL), Team_ColorCode(player.team), player.netname); - + if(!flag.team) FOR_EACH_PLAYER(tmp_entity) if(tmp_entity != player) if(DIFF_TEAM(player, tmp_entity)) Send_Notification(NOTIF_ONE, tmp_entity, MSG_CHOICE, CHOICE_CTF_PICKUP_ENEMY_NEUTRAL, Team_ColorCode(player.team), player.netname); - + if(flag.team) FOR_EACH_PLAYER(tmp_entity) if(tmp_entity != player) @@ -1184,7 +1184,7 @@ void ctf_FlagSetup(int teamnumber, entity flag) // called when spawning a flag e default: flag.effects |= EF_DIMLIGHT; break; } } - + // flag placement if((flag.spawnflags & 1) || flag.noalign) // don't drop to floor, just stay at fixed location { @@ -1900,7 +1900,7 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerPreThink) int t = 0, t2 = 0, t3 = 0; // initially clear items so they can be set as necessary later. - self.ctf_flagstatus &= ~(CTF_RED_FLAG_CARRYING | CTF_RED_FLAG_TAKEN | CTF_RED_FLAG_LOST + self.ctf_flagstatus &= ~(CTF_RED_FLAG_CARRYING | CTF_RED_FLAG_TAKEN | CTF_RED_FLAG_LOST | CTF_BLUE_FLAG_CARRYING | CTF_BLUE_FLAG_TAKEN | CTF_BLUE_FLAG_LOST | CTF_YELLOW_FLAG_CARRYING | CTF_YELLOW_FLAG_TAKEN | CTF_YELLOW_FLAG_LOST | CTF_PINK_FLAG_CARRYING | CTF_PINK_FLAG_TAKEN | CTF_PINK_FLAG_LOST @@ -1923,7 +1923,7 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerPreThink) { if((flag.owner == self) || (flag.pass_sender == self)) self.ctf_flagstatus |= t; // carrying: self is currently carrying the flag - else + else self.ctf_flagstatus |= t2; // taken: someone else is carrying the flag break; } @@ -2325,13 +2325,13 @@ void spawnfunc_item_flag_team2() /*QUAKED spawnfunc_item_flag_team3 (0 0.5 0.8) (-48 -48 -37) (48 48 37) CTF flag for team three (Yellow). -Keys: -"angle" Angle the flag will point (minus 90 degrees)... +Keys: +"angle" Angle the flag will point (minus 90 degrees)... "model" model to use, note this needs red, blue yellow and pink as skins 0, 1, 2 and 3... "noise" sound played when flag is picked up... "noise1" sound played when flag is returned by a teammate... "noise2" sound played when flag is captured... -"noise3" sound played when flag is lost in the field and respawns itself... +"noise3" sound played when flag is lost in the field and respawns itself... "noise4" sound played when flag is dropped by a player... "noise5" sound played when flag touches the ground... */ void spawnfunc_item_flag_team3() @@ -2343,13 +2343,13 @@ void spawnfunc_item_flag_team3() /*QUAKED spawnfunc_item_flag_team4 (0 0.5 0.8) (-48 -48 -37) (48 48 37) CTF flag for team four (Pink). -Keys: -"angle" Angle the flag will point (minus 90 degrees)... +Keys: +"angle" Angle the flag will point (minus 90 degrees)... "model" model to use, note this needs red, blue yellow and pink as skins 0, 1, 2 and 3... "noise" sound played when flag is picked up... "noise1" sound played when flag is returned by a teammate... "noise2" sound played when flag is captured... -"noise3" sound played when flag is lost in the field and respawns itself... +"noise3" sound played when flag is lost in the field and respawns itself... "noise4" sound played when flag is dropped by a player... "noise5" sound played when flag touches the ground... */ void spawnfunc_item_flag_team4() @@ -2361,13 +2361,13 @@ void spawnfunc_item_flag_team4() /*QUAKED spawnfunc_item_flag_neutral (0 0.5 0.8) (-48 -48 -37) (48 48 37) CTF flag (Neutral). -Keys: -"angle" Angle the flag will point (minus 90 degrees)... +Keys: +"angle" Angle the flag will point (minus 90 degrees)... "model" model to use, note this needs red, blue yellow and pink as skins 0, 1, 2 and 3... "noise" sound played when flag is picked up... "noise1" sound played when flag is returned by a teammate... "noise2" sound played when flag is captured... -"noise3" sound played when flag is lost in the field and respawns itself... +"noise3" sound played when flag is lost in the field and respawns itself... "noise4" sound played when flag is dropped by a player... "noise5" sound played when flag touches the ground... */ void spawnfunc_item_flag_neutral() diff --git a/qcsrc/server/mutators/gamemode_onslaught.qc b/qcsrc/server/mutators/gamemode_onslaught.qc index 28532528d..fb6e0c10e 100644 --- a/qcsrc/server/mutators/gamemode_onslaught.qc +++ b/qcsrc/server/mutators/gamemode_onslaught.qc @@ -73,7 +73,7 @@ void ons_CaptureShield_Spawn(entity generator, bool is_generator) shield.avelocity = '7 0 11'; shield.scale = 1; shield.model = ((is_generator) ? "models/onslaught/generator_shield.md3" : "models/onslaught/controlpoint_shield.md3"); - + precache_model(shield.model); setorigin(shield, generator.origin); setmodel(shield, shield.model); @@ -265,10 +265,10 @@ void ons_Link_CheckUpdate() { // TODO check if the two sides have moved (currently they won't move anyway) float cc = 0, cc1 = 0, cc2 = 0; - + if(self.goalentity.islinked || self.goalentity.iscaptured) { cc1 = (self.goalentity.team - 1) * 0x01; } if(self.enemy.islinked || self.enemy.iscaptured) { cc2 = (self.enemy.team - 1) * 0x10; } - + cc = cc1 + cc2; if(cc != self.clientcolors) @@ -356,7 +356,7 @@ int ons_ControlPoint_Attackable(entity cp, int teamnumber) void ons_ControlPoint_Icon_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force) { entity oself; - + if(damage <= 0) { return; } if (self.owner.isshielded) @@ -399,10 +399,10 @@ void ons_ControlPoint_Icon_Damage(entity inflictor, entity attacker, float damag sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1); Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM_4(self.team, INFO_ONSLAUGHT_CPDESTROYED_), self.owner.message, attacker.netname); - + PlayerScore_Add(attacker, SP_ONS_TAKES, 1); PlayerScore_Add(attacker, SP_SCORE, 10); - + self.owner.goalentity = world; self.owner.islinked = false; self.owner.iscaptured = false; @@ -427,7 +427,7 @@ void ons_ControlPoint_Icon_Damage(entity inflictor, entity attacker, float damag remove(self); } - + self.SendFlags |= CPSF_STATUS; } @@ -524,7 +524,7 @@ void ons_ControlPoint_Icon_BuildThink() return; self.health = self.health + self.count; - + self.SendFlags |= CPSF_STATUS; if (self.health >= self.max_health) @@ -549,7 +549,7 @@ void ons_ControlPoint_Icon_BuildThink() PlayerScore_Add(self.owner.ons_toucher, SP_ONS_CAPS, 1); PlayerTeamScore_AddScore(self.owner.ons_toucher, 10); } - + self.owner.ons_toucher = world; onslaught_updatelinks(); @@ -560,12 +560,12 @@ void ons_ControlPoint_Icon_BuildThink() activator = self; SUB_UseTargets (); self = oself; - + self.SendFlags |= CPSF_SETUP; } if(self.owner.model != "models/onslaught/controlpoint_pad2.md3") setmodel_fixsize(self.owner, "models/onslaught/controlpoint_pad2.md3"); - + if(random() < 0.9 - self.health / self.max_health) Send_Effect("rage", self.origin + 10 * randomvec(), '0 0 -1', 1); } @@ -573,10 +573,10 @@ void ons_ControlPoint_Icon_BuildThink() void ons_ControlPoint_Icon_Spawn(entity cp, entity player) { entity e = spawn(); - + setsize(e, CPICON_MIN, CPICON_MAX); setorigin(e, cp.origin + CPICON_OFFSET); - + e.classname = "onslaught_controlpoint_icon"; e.owner = cp; e.max_health = autocvar_g_onslaught_cp_health; @@ -588,9 +588,9 @@ void ons_ControlPoint_Icon_Spawn(entity cp, entity player) e.team = player.team; e.colormap = 1024 + (e.team - 1) * 17; e.count = (e.max_health - e.health) * ONS_CP_THINKRATE / autocvar_g_onslaught_cp_buildtime; // how long it takes to build - + sound(e, CH_TRIGGER, "onslaught/controlpoint_build.wav", VOL_BASE, ATTEN_NORM); - + cp.goalentity = e; cp.team = e.team; cp.colormap = e.colormap; @@ -609,7 +609,7 @@ string ons_ControlPoint_Waypoint(entity e) if(e.team) { int a = ons_ControlPoint_Attackable(e, e.team); - + if(a == -2) { return "ons-cp-dfnd"; } // defend now if(a == -1 || a == 1 || a == 2) { return "ons-cp"; } // touch if(a == 3 || a == 4) { return "ons-cp-atck"; } // attack @@ -669,17 +669,17 @@ void ons_ControlPoint_Touch() { entity toucher = other; int attackable; - + if(IS_VEHICLE(toucher) && toucher.owner) if(autocvar_g_onslaught_allow_vehicle_touch) toucher = toucher.owner; else return; - + if(!IS_PLAYER(toucher)) { return; } if(toucher.frozen) { return; } if(toucher.deadflag != DEAD_NO) { return; } - + if ( SAME_TEAM(self,toucher) ) if ( self.iscaptured ) { @@ -688,7 +688,7 @@ void ons_ControlPoint_Touch() else Send_Notification(NOTIF_ONE, toucher, MSG_CENTER, CENTER_ONS_TELEPORT); } - + attackable = ons_ControlPoint_Attackable(self, toucher.team); if(attackable != 2 && attackable != 4) return; @@ -696,7 +696,7 @@ void ons_ControlPoint_Touch() // so start building the captured point icon (which only captures this // point if it successfully builds without being destroyed first) ons_ControlPoint_Icon_Spawn(self, toucher); - + self.ons_toucher = toucher; onslaught_updatelinks(); @@ -738,7 +738,7 @@ void ons_ControlPoint_Reset() void ons_DelayedControlPoint_Setup(void) { onslaught_updatelinks(); - + // captureshield setup ons_CaptureShield_Spawn(self, false); @@ -749,11 +749,11 @@ void ons_ControlPoint_Setup(entity cp) { // declarations self = cp; // for later usage with droptofloor() - + // main setup cp.ons_worldcpnext = ons_worldcplist; // link control point into ons_worldcplist ons_worldcplist = cp; - + cp.netname = "Control point"; cp.team = 0; cp.solid = SOLID_BBOX; @@ -766,7 +766,7 @@ void ons_ControlPoint_Setup(entity cp) cp.iscaptured = false; cp.islinked = false; cp.isshielded = true; - + if(cp.message == "") { cp.message = "a"; } // precache - TODO: clean up! @@ -787,10 +787,10 @@ void ons_ControlPoint_Setup(entity cp) precache_sound("onslaught/controlpoint_underattack.wav"); precache_sound("onslaught/ons_spark1.wav"); precache_sound("onslaught/ons_spark2.wav"); - + // appearence setmodel_fixsize(cp, "models/onslaught/controlpoint_pad.md3"); - + // control point placement if((cp.spawnflags & 1) || cp.noalign) // don't drop to floor, just stay at fixed location { @@ -805,11 +805,11 @@ void ons_ControlPoint_Setup(entity cp) droptofloor(); cp.movetype = MOVETYPE_TOSS; } - + // waypointsprites WaypointSprite_SpawnFixed(string_null, self.origin + CPGEN_WAYPOINT_OFFSET, self, sprite, RADARICON_NONE, '0 0 0'); WaypointSprite_UpdateRule(self.sprite, self.team, SPRITERULE_TEAMPLAY); - + InitializeEntity(cp, ons_DelayedControlPoint_Setup, INITPRIO_SETLOCATION); } @@ -970,16 +970,16 @@ void ons_GeneratorReset() self.event_damage = ons_GeneratorDamage; self.think = ons_GeneratorThink; self.nextthink = time + GEN_THINKRATE; - + Net_LinkEntity(self, false, 0, generator_send); - + self.SendFlags = GSF_SETUP; // just incase self.SendFlags |= GSF_STATUS; WaypointSprite_UpdateMaxHealth(self.sprite, self.max_health); WaypointSprite_UpdateHealth(self.sprite, self.health); WaypointSprite_UpdateRule(self.sprite,self.team,SPRITERULE_TEAMPLAY); - + onslaught_updatelinks(); } @@ -992,9 +992,9 @@ void ons_DelayedGeneratorSetup() // captureshield setup ons_CaptureShield_Spawn(self, true); - + onslaught_updatelinks(); - + Net_LinkEntity(self, false, 0, generator_send); } @@ -1014,11 +1014,11 @@ void ons_GeneratorSetup(entity gen) // called when spawning a generator entity o // declarations int teamnumber = gen.team; self = gen; // for later usage with droptofloor() - + // main setup gen.ons_worldgeneratornext = ons_worldgeneratorlist; // link generator into ons_worldgeneratorlist ons_worldgeneratorlist = gen; - + gen.netname = sprintf("%s generator", Team_ColoredFullName(teamnumber)); gen.classname = "onslaught_generator"; gen.solid = SOLID_BBOX; @@ -1035,7 +1035,7 @@ void ons_GeneratorSetup(entity gen) // called when spawning a generator entity o gen.islinked = true; gen.isshielded = true; gen.touch = onslaught_generator_touch; - + // precache - TODO: clean up! precache_model("models/onslaught/generator_shield.md3"); precache_model("models/onslaught/gen_gib1.md3"); @@ -1049,23 +1049,23 @@ void ons_GeneratorSetup(entity gen) // called when spawning a generator entity o precache_sound("onslaught/ons_hit1.wav"); precache_sound("onslaught/ons_hit2.wav"); precache_sound("onslaught/generator_underattack.wav"); - + // appearence // model handled by CSQC setsize(gen, GENERATOR_MIN, GENERATOR_MAX); setorigin(gen, (gen.origin + CPGEN_SPAWN_OFFSET)); gen.colormap = 1024 + (teamnumber - 1) * 17; - + // generator placement self = gen; droptofloor(); - + // waypointsprites WaypointSprite_SpawnFixed(string_null, self.origin + CPGEN_WAYPOINT_OFFSET, self, sprite, RADARICON_NONE, '0 0 0'); WaypointSprite_UpdateRule(self.sprite, self.team, SPRITERULE_TEAMPLAY); WaypointSprite_UpdateMaxHealth(self.sprite, self.max_health); WaypointSprite_UpdateHealth(self.sprite, self.health); - + InitializeEntity(gen, ons_DelayedGeneratorSetup, INITPRIO_SETLOCATION); } @@ -1119,7 +1119,7 @@ int Onslaught_GetWinnerTeam() bool Onslaught_CheckWinner() { entity e; - + if ((autocvar_timelimit && time > game_starttime + autocvar_timelimit * 60) || (round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0)) { ons_stalemate = true; @@ -1152,7 +1152,7 @@ bool Onslaught_CheckWinner() d = d * tmp_entity.max_health / max(30, 60 * autocvar_timelimit_suddendeath); Damage(tmp_entity, tmp_entity, tmp_entity, d, DEATH_HURTTRIGGER, tmp_entity.origin, '0 0 0'); - + tmp_entity.sprite.SendFlags |= 16; tmp_entity.ons_overtime_damagedelay = time + 1; @@ -1161,7 +1161,7 @@ bool Onslaught_CheckWinner() else { wpforenemy_announced = false; ons_stalemate = false; } Onslaught_count_generators(); - + if(ONS_OWNED_GENERATORS_OK()) return 0; @@ -1178,13 +1178,13 @@ bool Onslaught_CheckWinner() Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_TIED); Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_TIED); } - + ons_stalemate = false; play2all(sprintf("ctf/%s_capture.wav", Static_Team_ColorName_Lower(winner_team))); - + round_handler_Init(7, autocvar_g_onslaught_warmup, autocvar_g_onslaught_round_timelimit); - + FOR_EACH_PLAYER(e) { e.ons_roundlost = true; @@ -1580,7 +1580,7 @@ entity ons_Nearest_ControlPoint(vector pos, float max_dist) closest_target = tmp_entity; tmp_entity = tmp_entity.chain; } - + return closest_target; } @@ -1594,14 +1594,14 @@ entity ons_Nearest_ControlPoint_2D(vector pos, float max_dist) entity tmp_entity, closest_target = world; vector delta; float smallest_distance = 0, distance; - + tmp_entity = findchain(classname, "onslaught_controlpoint"); while(tmp_entity) { delta = tmp_entity.origin - pos; delta_z = 0; distance = vlen(delta); - + if(SAME_TEAM(tmp_entity, self)) if(tmp_entity.iscaptured) if(max_dist <= 0 || distance <= max_dist) @@ -1610,7 +1610,7 @@ entity ons_Nearest_ControlPoint_2D(vector pos, float max_dist) closest_target = tmp_entity; smallest_distance = distance; } - + tmp_entity = tmp_entity.chain; } tmp_entity = findchain(classname, "onslaught_generator"); @@ -1619,7 +1619,7 @@ entity ons_Nearest_ControlPoint_2D(vector pos, float max_dist) delta = tmp_entity.origin - pos; delta_z = 0; distance = vlen(delta); - + if(SAME_TEAM(tmp_entity, self)) if(max_dist <= 0 || distance <= max_dist) if(closest_target == world || distance <= smallest_distance ) @@ -1627,10 +1627,10 @@ entity ons_Nearest_ControlPoint_2D(vector pos, float max_dist) closest_target = tmp_entity; smallest_distance = distance; } - + tmp_entity = tmp_entity.chain; } - + return closest_target; } /** @@ -1667,7 +1667,7 @@ bool ons_Teleport(entity player, entity tele_target, float range, bool tele_effe { if ( !tele_target ) return false; - + int i; vector loc; float theta; @@ -1678,9 +1678,9 @@ bool ons_Teleport(entity player, entity tele_target, float range, bool tele_effe loc_x = cos(theta); loc_z = 0; loc *= random() * range; - + loc += tele_target.origin + '0 0 128'; - + tracebox(loc, PL_MIN, PL_MAX, loc, MOVE_NORMAL, player); if(trace_fraction == 1.0 && !trace_startsolid) { @@ -1704,7 +1704,7 @@ bool ons_Teleport(entity player, entity tele_target, float range, bool tele_effe } } } - + return false; } @@ -1736,7 +1736,7 @@ MUTATOR_HOOKFUNCTION(ons_PlayerSpawn) self.player_blocked = true; return false; } - + entity l; for(l = ons_worldgeneratorlist; l; l = l.ons_worldgeneratornext) { @@ -1756,14 +1756,14 @@ MUTATOR_HOOKFUNCTION(ons_PlayerSpawn) self.ons_spawn_by = world; return false; } - + if(autocvar_g_onslaught_spawn_at_controlpoints) if(random() <= autocvar_g_onslaught_spawn_at_controlpoints_chance) { float random_target = autocvar_g_onslaught_spawn_at_controlpoints_random; entity tmp_entity, closest_target = world; vector spawn_loc = self.ons_deathloc; - + // new joining player or round reset, don't bother checking if(spawn_loc == '0 0 0') { return false; } @@ -1777,9 +1777,9 @@ MUTATOR_HOOKFUNCTION(ons_PlayerSpawn) else if(vlen(tmp_entity.origin - spawn_loc) <= vlen(closest_target.origin - spawn_loc) || closest_target == world) closest_target = tmp_entity; } - + if(random_target) { closest_target = RandomSelection_chosen_ent; } - + if(closest_target) { float i; @@ -1802,17 +1802,17 @@ MUTATOR_HOOKFUNCTION(ons_PlayerSpawn) } } } - + if(autocvar_g_onslaught_spawn_at_generator) if(random() <= autocvar_g_onslaught_spawn_at_generator_chance) { float random_target = autocvar_g_onslaught_spawn_at_generator_random; entity tmp_entity, closest_target = world; vector spawn_loc = self.ons_deathloc; - + // new joining player or round reset, don't bother checking if(spawn_loc == '0 0 0') { return false; } - + if(random_target) { RandomSelection_Init(); } for(tmp_entity = ons_worldgeneratorlist; tmp_entity; tmp_entity = tmp_entity.ons_worldgeneratornext) @@ -1826,9 +1826,9 @@ MUTATOR_HOOKFUNCTION(ons_PlayerSpawn) closest_target = tmp_entity; } } - + if(random_target) { closest_target = RandomSelection_chosen_ent; } - + if(closest_target) { float i; @@ -1867,11 +1867,11 @@ MUTATOR_HOOKFUNCTION(ons_PlayerDies) { l.sprite.SendFlags |= 16; } - + if ( autocvar_g_onslaught_spawn_choose ) if ( ons_Count_SelfControlPoints() > 1 ) stuffcmd(self, "qc_cmd_cl hud clickradar\n"); - + return false; } @@ -1887,21 +1887,21 @@ MUTATOR_HOOKFUNCTION(ons_MonsterThink) void ons_MonsterSpawn_Delayed() { entity e, own = self.owner; - + if(!own) { remove(self); return; } - + if(own.targetname) { e = find(world, target, own.targetname); if(e != world) { own.team = e.team; - + activator = e; own.use(); } } - + remove(self); } @@ -1927,7 +1927,7 @@ void ons_TurretSpawn_Delayed() { own.team = e.team; own.active = ACTIVE_NOT; - + activator = e; own.use(); } @@ -1989,28 +1989,28 @@ MUTATOR_HOOKFUNCTION(ons_SV_ParseClientCommand) pos_y = stof(argv(2)); if(cmd_argc > 3) pos_z = stof(argv(3)); - + if ( IS_PLAYER(self) ) { if ( !self.frozen ) { entity source_point = ons_Nearest_ControlPoint(self.origin, autocvar_g_onslaught_teleport_radius); - + if ( !source_point && self.health > 0 ) { sprint(self, "\nYou need to be next to a control point\n"); return 1; } - - + + entity closest_target = ons_Nearest_ControlPoint_2D(pos, autocvar_g_onslaught_click_radius); - + if ( closest_target == world ) { sprint(self, "\nNo control point found\n"); return 1; } - + if ( self.health <= 0 ) { self.ons_spawn_by = closest_target; @@ -2023,17 +2023,17 @@ MUTATOR_HOOKFUNCTION(ons_SV_ParseClientCommand) sprint(self, "\nTeleporting to the same point\n"); return 1; } - + if ( !ons_Teleport(self,closest_target,autocvar_g_onslaught_teleport_radius,true) ) sprint(self, "\nUnable to teleport there\n"); } - + return 1; } - + sprint(self, "\nNo teleportation for you\n"); } - + return 1; } return 0; @@ -2042,7 +2042,7 @@ MUTATOR_HOOKFUNCTION(ons_SV_ParseClientCommand) MUTATOR_HOOKFUNCTION(ons_PlayerUseKey) { if(MUTATOR_RETURNVALUE || gameover) { return false; } - + if((time > self.teleport_antispam) && (self.deadflag == DEAD_NO) && !self.vehicle) { entity source_point = ons_Nearest_ControlPoint(self.origin, autocvar_g_onslaught_teleport_radius); @@ -2052,7 +2052,7 @@ MUTATOR_HOOKFUNCTION(ons_PlayerUseKey) return true; } } - + return false; } @@ -2103,7 +2103,7 @@ keys: void spawnfunc_onslaught_controlpoint() { if(!g_onslaught) { remove(self); return; } - + ons_ControlPoint_Setup(self); } @@ -2138,7 +2138,7 @@ void ons_ScoreRules() void ons_DelayedInit() // Do this check with a delay so we can wait for teams to be set up { ons_ScoreRules(); - + round_handler_Spawn(Onslaught_CheckPlayers, Onslaught_CheckWinner, Onslaught_RoundStart); round_handler_Init(5, autocvar_g_onslaught_warmup, autocvar_g_onslaught_round_timelimit); } -- 2.39.2