From: Rudolf Polzer Date: Mon, 4 Nov 2013 19:30:42 +0000 (+0100) Subject: Start of uncrusticracy script, and kill trailing whitespace in all sources. X-Git-Tag: xonotic-v0.8.0~270 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ef3193f7a8b94d570b83a09e5f75ba2c87fe2bb9;p=xonotic%2Fxonotic-data.pk3dir.git Start of uncrusticracy script, and kill trailing whitespace in all sources. --- diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index e43320256..a06eb5e65 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -81,7 +81,7 @@ void CSQC_Init(void) //registercommand("hud_configure"); //registercommand("hud_save"); //registercommand("menu_action"); - + ConsoleCommand_macro_init(); registercvar("hud_usecsqc", "1"); @@ -125,13 +125,13 @@ void CSQC_Init(void) turrets_precache(); Tuba_Precache(); CSQCPlayer_Precache(); - + if(autocvar_cl_reticle) { if(autocvar_cl_reticle_item_normal) { precache_pic("gfx/reticle_normal"); } if(autocvar_cl_reticle_item_nex) { precache_pic("gfx/reticle_nex"); } } - + get_mi_min_max_texcoords(1); // try the CLEVER way first minimapname = strcat("gfx/", mi_shortname, "_radar.tga"); shortmapname = mi_shortname; @@ -651,7 +651,7 @@ void Ent_ReadSpawnPoint(float is_new) // entity for spawnpoint spn_origin_x = ReadShort(); spn_origin_y = ReadShort(); spn_origin_z = ReadShort(); - + if(is_new) { self.origin = spn_origin; @@ -682,7 +682,7 @@ void Ent_ReadSpawnPoint(float is_new) // entity for spawnpoint } } else { self.cnt = particleeffectnum("spawn_point_neutral"); } - + self.draw = Spawn_Draw; } } @@ -696,7 +696,7 @@ void Ent_ReadSpawnEvent(float is_new) // this way the server can disable the sending of // spawn origin or such to clients if wanted. float entnum = ReadByte(); - + if(entnum) { self.origin_x = ReadShort(); @@ -724,7 +724,7 @@ void Ent_ReadSpawnEvent(float is_new) } } } - + // local spawn actions if(is_new && (!entnum || (entnum == player_localentnum))) { @@ -737,7 +737,7 @@ void Ent_ReadSpawnEvent(float is_new) button_zoom = FALSE; } } - + //print(sprintf("Ent_ReadSpawnEvent(is_new = %d); origin = %s, entnum = %d, localentnum = %d\n", is_new, vtos(self.origin), entnum, player_localentnum)); } @@ -822,9 +822,9 @@ void CSQC_Ent_Update(float bIsNewEntity) case ENT_CLIENT_GAUNTLET: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_GAUNTLET); break; case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break; case ENT_CLIENT_AUXILIARYXHAIR: Net_AuXair2(bIsNewEntity); break; - case ENT_CLIENT_TURRET: ent_turret(); break; + case ENT_CLIENT_TURRET: ent_turret(); break; case ENT_CLIENT_MODEL: CSQCModel_Read(bIsNewEntity); break; - case ENT_CLIENT_ITEM: ItemRead(bIsNewEntity); break; + case ENT_CLIENT_ITEM: ItemRead(bIsNewEntity); break; case ENT_CLIENT_BUMBLE_RAYGUN: bumble_raygun_read(bIsNewEntity); break; case ENT_CLIENT_SPAWNPOINT: Ent_ReadSpawnPoint(bIsNewEntity); break; case ENT_CLIENT_SPAWNEVENT: Ent_ReadSpawnEvent(bIsNewEntity); break; diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 486d763da..8c9d59dd9 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -127,8 +127,8 @@ vector GetCurrentFov(float fov) else if(autocvar_cl_spawnzoom && zoomin_effect) { float spawnzoomfactor = bound(1, autocvar_cl_spawnzoom_factor, 16); - - current_viewzoom += (autocvar_cl_spawnzoom_speed * (spawnzoomfactor - current_viewzoom) * drawframetime); + + current_viewzoom += (autocvar_cl_spawnzoom_speed * (spawnzoomfactor - current_viewzoom) * drawframetime); current_viewzoom = bound(1 / spawnzoomfactor, current_viewzoom, 1); if(current_viewzoom == 1) { zoomin_effect = 0; } } @@ -161,7 +161,7 @@ vector GetCurrentFov(float fov) setsensitivityscale(pow(current_viewzoom, 1 - zoomsensitivity)); else setsensitivityscale(1); - + makevectors(view_angles); if(autocvar_cl_velocityzoom && autocvar_cl_velocityzoom_type) // _type = 0 disables velocity zoom too @@ -180,11 +180,11 @@ vector GetCurrentFov(float fov) case 1: default: curspeed = vlen(v); break; } } - + velocityzoom = bound(0, drawframetime / max(0.000000001, autocvar_cl_velocityzoom_time), 1); // speed at which the zoom adapts to player velocity avgspeed = avgspeed * (1 - velocityzoom) + (curspeed / autocvar_cl_velocityzoom_speed) * velocityzoom; velocityzoom = exp(float2range11(avgspeed * -autocvar_cl_velocityzoom / 1) * 1); - + //print(ftos(avgspeed), " avgspeed, ", ftos(curspeed), " curspeed, ", ftos(velocityzoom), " return\n"); // for debugging } else @@ -797,7 +797,7 @@ void CSQC_UpdateView(float w, float h) R_PolygonVertex(autocvar_vid_conheight * '0 1 0', tc_01, rgb, a); R_EndPolygon(); } - + // Draw the aiming reticle for weapons that use it // reticle_type is changed to the item we are zooming / aiming with, to decide which reticle to use // It must be a persisted float for fading out to work properly (you let go of the zoom button for @@ -810,7 +810,7 @@ void CSQC_UpdateView(float w, float h) reticle_type = 1; // normal zoom else if((activeweapon == WEP_NEX) && button_attack2) reticle_type = 2; // nex zoom - + if(reticle_type && autocvar_cl_reticle) { if(autocvar_cl_reticle_stretch) @@ -1022,13 +1022,13 @@ void CSQC_UpdateView(float w, float h) old_bluralpha = 0; } - // edge detection postprocess handling done second (used by hud_powerup) + // edge detection postprocess handling done second (used by hud_powerup) float sharpen_intensity = 0, strength_finished = getstatf(STAT_STRENGTH_FINISHED), invincible_finished = getstatf(STAT_INVINCIBLE_FINISHED); if (strength_finished - time > 0) { sharpen_intensity += (strength_finished - time); } if (invincible_finished - time > 0) { sharpen_intensity += (invincible_finished - time); } - + sharpen_intensity = bound(0, ((getstati(STAT_HEALTH) > 0) ? sharpen_intensity : 0), 5); // Check to see if player is alive (if not, set 0) - also bound to fade out starting at 5 seconds. - + if(autocvar_hud_powerup && sharpen_intensity > 0) { if(sharpen_intensity != old_sharpen_intensity) // reduce cvar_set spam as much as possible @@ -1072,15 +1072,15 @@ void CSQC_UpdateView(float w, float h) { if(time - hit_time < MAX_TIME_DIFF) // don't play the sound if it's too old. sound(world, CH_INFO, "misc/hit.wav", VOL_BASE, ATTEN_NONE); - + nextsound_hit_time = time + autocvar_cl_hitsound_antispam_time; } typehit_time = getstatf(STAT_TYPEHIT_TIME); - if(typehit_time > nextsound_typehit_time) + if(typehit_time > nextsound_typehit_time) { if(time - typehit_time < MAX_TIME_DIFF) // don't play the sound if it's too old. sound(world, CH_INFO, "misc/typehit.wav", VOL_BASE, ATTEN_NONE); - + nextsound_typehit_time = time + autocvar_cl_hitsound_antispam_time; } @@ -1102,11 +1102,11 @@ void CSQC_UpdateView(float w, float h) CSQC_common_hud(); // crosshair goes VERY LAST - if(!scoreboard_active && !camera_active && intermission != 2 && spectatee_status != -1 && hud == HUD_NORMAL) + if(!scoreboard_active && !camera_active && intermission != 2 && spectatee_status != -1 && hud == HUD_NORMAL) { if (!autocvar_crosshair_enabled) // main toggle for crosshair rendering return; - + string wcross_style; float wcross_alpha, wcross_resolution; wcross_style = autocvar_crosshair; @@ -1259,12 +1259,12 @@ void CSQC_UpdateView(float w, float h) if(autocvar_crosshair_pickup) { float stat_pickup_time = getstatf(STAT_LAST_PICKUP); - + if(pickup_crosshair_time < stat_pickup_time) { if(time - stat_pickup_time < MAX_TIME_DIFF) // don't trigger the animation if it's too old pickup_crosshair_size = 1; - + pickup_crosshair_time = stat_pickup_time; } @@ -1279,12 +1279,12 @@ void CSQC_UpdateView(float w, float h) if(autocvar_crosshair_hitindication) { vector hitindication_color = ((autocvar_crosshair_color_special == 1) ? stov(autocvar_crosshair_hitindication_per_weapon_color) : stov(autocvar_crosshair_hitindication_color)); - + if(hitindication_crosshair_time < hit_time) { if(time - hit_time < MAX_TIME_DIFF) // don't trigger the animation if it's too old hitindication_crosshair_size = 1; - + hitindication_crosshair_time = hit_time; } @@ -1379,12 +1379,12 @@ void CSQC_UpdateView(float w, float h) // handle the values if (autocvar_crosshair_ring && activeweapon == WEP_NEX && nex_charge && autocvar_crosshair_ring_nex) // ring around crosshair representing velocity-dependent damage for the nex { - if (nex_chargepool || use_nex_chargepool) { - use_nex_chargepool = 1; + if (nex_chargepool || use_nex_chargepool) { + use_nex_chargepool = 1; ring_inner_value = nex_chargepool; - } else { + } else { nex_charge_movingavg = (1 - autocvar_crosshair_ring_nex_currentcharge_movingavg_rate) * nex_charge_movingavg + autocvar_crosshair_ring_nex_currentcharge_movingavg_rate * nex_charge; - ring_inner_value = bound(0, autocvar_crosshair_ring_nex_currentcharge_scale * (nex_charge - nex_charge_movingavg), 1); + ring_inner_value = bound(0, autocvar_crosshair_ring_nex_currentcharge_scale * (nex_charge - nex_charge_movingavg), 1); } ring_inner_alpha = autocvar_crosshair_ring_nex_inner_alpha; @@ -1397,7 +1397,7 @@ void CSQC_UpdateView(float w, float h) ring_rgb = wcross_color; ring_image = "gfx/crosshair_ring_nexgun.tga"; } - else if (autocvar_crosshair_ring && activeweapon == WEP_MINE_LAYER && minelayer_maxmines && autocvar_crosshair_ring_minelayer) + else if (autocvar_crosshair_ring && activeweapon == WEP_MINE_LAYER && minelayer_maxmines && autocvar_crosshair_ring_minelayer) { ring_value = bound(0, getstati(STAT_LAYED_MINES) / minelayer_maxmines, 1); // if you later need to use the count of bullets in another place, then add a float for it. For now, no need to. ring_alpha = autocvar_crosshair_ring_minelayer_alpha; @@ -1412,7 +1412,7 @@ void CSQC_UpdateView(float w, float h) ring_image = "gfx/crosshair_ring.tga"; } - if(autocvar_crosshair_ring_reload && weapon_clipsize) // forces there to be only an ammo ring + if(autocvar_crosshair_ring_reload && weapon_clipsize) // forces there to be only an ammo ring { ring_value = bound(0, weapon_clipload / weapon_clipsize, 1); ring_scale = autocvar_crosshair_ring_reload_size; @@ -1435,7 +1435,7 @@ void CSQC_UpdateView(float w, float h) { wcross_ring_prev = ((ring_image) ? TRUE : FALSE); } - + if(wcross_ring_prev) { if(f < 1) @@ -1497,10 +1497,10 @@ void CSQC_UpdateView(float w, float h) { vector wcross_color_old; wcross_color_old = wcross_color; - + if((autocvar_crosshair_dot_color_custom) && (autocvar_crosshair_dot_color != "0")) wcross_color = stov(autocvar_crosshair_dot_color); - + CROSSHAIR_DRAW(wcross_resolution * autocvar_crosshair_dot_size, "gfx/crosshairdot.tga", f * autocvar_crosshair_dot_alpha); // FIXME why don't we use wcross_alpha here?cl_notice_run(); wcross_color = wcross_color_old; @@ -1564,9 +1564,9 @@ void CSQC_UpdateView(float w, float h) if(autocvar__hud_configure) HUD_Panel_Mouse(); - + if(hud && !intermission) - { + { if(hud == HUD_SPIDERBOT) CSQC_SPIDER_HUD(); else if(hud == HUD_WAKIZASHI) @@ -1578,9 +1578,9 @@ void CSQC_UpdateView(float w, float h) else if(hud == HUD_BUMBLEBEE_GUN) CSQC_BUMBLE_GUN_HUD(); } - + cl_notice_run(); - + // let's reset the view back to normal for the end setproperty(VF_MIN, '0 0 0'); setproperty(VF_SIZE, '1 0 0' * w + '0 1 0' * h); diff --git a/qcsrc/client/announcer.qc b/qcsrc/client/announcer.qc index 24be944d2..350774969 100644 --- a/qcsrc/client/announcer.qc +++ b/qcsrc/client/announcer.qc @@ -1,6 +1,6 @@ float announcer_1min; float announcer_5min; -void Announcer_Countdown() +void Announcer_Countdown() { float starttime = getstatf(STAT_GAMESTARTTIME); float roundstarttime = getstatf(STAT_ROUNDSTARTTIME); @@ -20,8 +20,8 @@ void Announcer_Countdown() if(countdown <= 0) // countdown has finished, starttime is now { - Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_BEGIN); - Local_Notification(MSG_MULTI, MULTI_COUNTDOWN_BEGIN); + Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_BEGIN); + Local_Notification(MSG_MULTI, MULTI_COUNTDOWN_BEGIN); remove(self); return; } @@ -50,19 +50,19 @@ void Announcer_Countdown() * and STAT_FRAGLIMIT to be auto-sent) */ float previous_game_starttime; -void Announcer_Gamestart() +void Announcer_Gamestart() { float startTime = getstatf(STAT_GAMESTARTTIME); float roundstarttime = getstatf(STAT_ROUNDSTARTTIME); if(roundstarttime > startTime) startTime = roundstarttime; - if(previous_game_starttime != startTime) + if(previous_game_starttime != startTime) { if((time + 5.0) < startTime) // if connecting to server while restart was active don't always play prepareforbattle Local_Notification(MSG_ANNCE, ANNCE_PREPARE); - if(time < startTime) + if(time < startTime) { entity e = find(world, classname, "announcer_countdown"); if (!e) @@ -74,35 +74,35 @@ void Announcer_Gamestart() e.nextthink = startTime - floor(startTime - time); //synchronize nextthink to startTime } } - + previous_game_starttime = startTime; } // Plays the 1 minute or 5 minutes (of maptime) remaining sound, if client wants it -void Announcer_Time() +void Announcer_Time() { float timelimit = getstatf(STAT_TIMELIMIT); float timeleft = max(0, timelimit * 60 + getstatf(STAT_GAMESTARTTIME) - time); float warmup_timeleft = 0; - - if(warmup_stage) + + if(warmup_stage) if(autocvar_g_warmup_limit > 0) - warmup_timeleft = max(0, autocvar_g_warmup_limit + getstatf(STAT_GAMESTARTTIME) - time); + warmup_timeleft = max(0, autocvar_g_warmup_limit + getstatf(STAT_GAMESTARTTIME) - time); // 5 minute check - if(autocvar_cl_announcer_maptime >= 2) + if(autocvar_cl_announcer_maptime >= 2) { // make sure that after connect (and e.g. 4 minutes left) we will not get a wrong sound if(announcer_5min) { - if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timeleft > 300) + if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timeleft > 300) || (warmup_stage && autocvar_g_warmup_limit > 0 && warmup_timeleft > 300)) announcer_5min = FALSE; } - else + else { - if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timelimit > 0 && timeleft < 300 && timeleft > 299) + if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timelimit > 0 && timeleft < 300 && timeleft > 299) || (warmup_stage && autocvar_g_warmup_limit > 0 && warmup_timeleft < 300 && warmup_timeleft > 299)) { //if we're in warmup mode, check whether there's a warmup timelimit @@ -120,11 +120,11 @@ void Announcer_Time() { if (announcer_1min) { - if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timeleft > 60) + if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timeleft > 60) || (warmup_stage && autocvar_g_warmup_limit > 0 && warmup_timeleft > 60)) announcer_1min = FALSE; } - else if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timelimit > 0 && timeleft < 60) + else if(((!warmup_stage || autocvar_g_warmup_limit == 0) && timelimit > 0 && timeleft < 60) || (warmup_stage && autocvar_g_warmup_limit > 0 && warmup_timeleft < 60)) { // if we're in warmup mode, check whether there's a warmup timelimit diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 8175695ab..403792020 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -337,7 +337,7 @@ float autocvar_hud_panel_weapons_timeout; float autocvar_hud_panel_weapons_timeout_effect; float autocvar_hud_panel_weapons_timeout_fadebgmin; float autocvar_hud_panel_weapons_timeout_fadefgmin; -var float autocvar_hud_panel_weapons_timeout_speed_in = 0.25; +var float autocvar_hud_panel_weapons_timeout_speed_in = 0.25; var float autocvar_hud_panel_weapons_timeout_speed_out = 0.75; float autocvar_hud_progressbar_alpha; float autocvar_hud_showbinds; diff --git a/qcsrc/client/bgmscript.qc b/qcsrc/client/bgmscript.qc index 694bc0cc6..fda38b125 100644 --- a/qcsrc/client/bgmscript.qc +++ b/qcsrc/client/bgmscript.qc @@ -17,10 +17,10 @@ float GetAttackDecaySustainAmplitude(float a, float d, float s, float t) // attack: from 0 to 1, in time a for a full length // decay: from 1 to s, in time d // sustain: s - + if(t < 0) return 0; - + if(a) if(t <= a) return t / a; @@ -38,10 +38,10 @@ float GetReleaseAmplitude(float d, float s, float r, float t) if(!r) return 0; - + if(t > r) return 0; - + releaseval = s * (1 - t / r); if(t < -d) @@ -70,7 +70,7 @@ float GetReleaseTime(float d, float s, float r, float amp) if(!s) return 0; - + // if amp > s, we may be in the attack or in the prolonged decay curve releasetime = (1 - amp / s) * r; @@ -172,7 +172,7 @@ float BGMScript(entity e) if(e.bgmscript == "") return 1; - + if(autocvar_bgmvolume <= 0) return -1; diff --git a/qcsrc/client/command/cl_cmd.qc b/qcsrc/client/command/cl_cmd.qc index cbf294fa8..9aae77dde 100644 --- a/qcsrc/client/command/cl_cmd.qc +++ b/qcsrc/client/command/cl_cmd.qc @@ -37,9 +37,9 @@ void LocalCommand_blurtest(float request) blurtest_radius = stof(argv(2)); blurtest_power = stof(argv(3)); print("Enabled blurtest\n"); - return; + return; } - + default: case CMD_REQUEST_USAGE: { @@ -117,7 +117,7 @@ void LocalCommand_create_scrshot_ent(float request) float fh; string filename = strcat(MapInfo_Map_bspname, "_scrshot_ent.txt"); fh = fopen(filename, FILE_WRITE); - + if(fh >= 0) { fputs(fh, "{\n"); @@ -125,9 +125,9 @@ void LocalCommand_create_scrshot_ent(float request) fputs(fh, strcat("\"origin\" \"", strcat(ftos(view_origin_x), " ", ftos(view_origin_y), " ", ftos(view_origin_z)), "\"\n")); fputs(fh, strcat("\"angles\" \"", strcat(ftos(view_angles_x), " ", ftos(view_angles_y), " ", ftos(view_angles_z)), "\"\n")); fputs(fh, "}\n"); - + print("Completed screenshot entity dump in ^2data/data/", MapInfo_Map_bspname, "_scrshot_ent.txt^7.\n"); - + fclose(fh); } else @@ -136,7 +136,7 @@ void LocalCommand_create_scrshot_ent(float request) } return; } - + default: case CMD_REQUEST_USAGE: { @@ -155,7 +155,7 @@ void LocalCommand_debugmodel(float request, float argc) { string modelname = argv(1); entity debugmodel_entity; - + debugmodel_entity = spawn(); precache_model(modelname); setmodel(debugmodel_entity, modelname); @@ -163,10 +163,10 @@ void LocalCommand_debugmodel(float request, float argc) debugmodel_entity.angles = view_angles; debugmodel_entity.draw = DrawDebugModel; debugmodel_entity.classname = "debugmodel"; - - return; + + return; } - + default: case CMD_REQUEST_USAGE: { @@ -185,18 +185,18 @@ void LocalCommand_handlevote(float request, float argc) { float vote_selection; string vote_string; - + if(InterpretBoolean(argv(1))) { - vote_selection = 2; + vote_selection = 2; vote_string = "yes"; } else { - vote_selection = 1; - vote_string = "no"; + vote_selection = 1; + vote_string = "no"; } - + if(vote_selection) { if(uid2name_dialog) // handled by "uid2name" option @@ -208,11 +208,11 @@ void LocalCommand_handlevote(float request, float argc) uid2name_dialog = 0; } else { localcmd(strcat("cmd vote ", vote_string, "\n")); } - + return; } } - + default: print("Incorrect parameters for ^2handlevote^7\n"); case CMD_REQUEST_USAGE: @@ -237,7 +237,7 @@ void LocalCommand_hud(float request, float argc) cvar_set("_hud_configure", ftos(!autocvar__hud_configure)); return; } - + case "save": { if(argv(2)) @@ -250,10 +250,10 @@ void LocalCommand_hud(float request, float argc) break; // go to usage, we're missing the paramater needed here. } } - + case "scoreboard_columns_set": { - Cmd_HUD_SetFields(argc); + Cmd_HUD_SetFields(argc); return; } @@ -262,7 +262,7 @@ void LocalCommand_hud(float request, float argc) Cmd_HUD_Help(); return; } - + case "radar": { if(argv(2)) @@ -273,7 +273,7 @@ void LocalCommand_hud(float request, float argc) } } } - + default: print("Incorrect parameters for ^2hud^7\n"); case CMD_REQUEST_USAGE: @@ -298,10 +298,10 @@ void LocalCommand_localprint(float request, float argc) if(argv(1)) { centerprint_hud(argv(1)); - return; + return; } } - + default: print("Incorrect parameters for ^2localprint^7\n"); case CMD_REQUEST_USAGE: @@ -322,10 +322,10 @@ void LocalCommand_mv_download(float request, float argc) if(argv(1)) { Cmd_MapVote_MapDownload(argc); - return; + return; } } - + default: print("Incorrect parameters for ^2mv_download^7\n"); case CMD_REQUEST_USAGE: @@ -348,18 +348,18 @@ void LocalCommand_sendcvar(float request, float argc) // W_FixWeaponOrder will trash argv, so save what we need. string thiscvar = strzone(argv(1)); string s = cvar_string(thiscvar); - + if(thiscvar == "cl_weaponpriority") s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 1); else if(substring(thiscvar, 0, 17) == "cl_weaponpriority" && strlen(thiscvar) == 18) s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 0); - + localcmd("cmd sentcvar ", thiscvar, " \"", s, "\"\n"); strunzone(thiscvar); - return; + return; } } - + default: print("Incorrect parameters for ^2sendcvar^7\n"); case CMD_REQUEST_USAGE: @@ -379,10 +379,10 @@ void LocalCommand_(float request) { case CMD_REQUEST_COMMAND: { - - return; + + return; } - + default: case CMD_REQUEST_USAGE: { @@ -411,15 +411,15 @@ void LocalCommand_(float request) CLIENT_COMMAND("mv_download", LocalCommand_mv_download(request, arguments), "Retrieve mapshot picture from the server") \ CLIENT_COMMAND("sendcvar", LocalCommand_sendcvar(request, arguments), "Send a cvar to the server (like weaponpriority)") \ /* nothing */ - + void LocalCommand_macro_help() { #define CLIENT_COMMAND(name,function,description) \ { if(strtolower(description) != "") { print(" ^2", name, "^7: ", description, "\n"); } } - + CLIENT_COMMANDS(0, 0) #undef CLIENT_COMMAND - + return; } @@ -427,10 +427,10 @@ float LocalCommand_macro_command(float argc) { #define CLIENT_COMMAND(name,function,description) \ { if(name == strtolower(argv(0))) { function; return TRUE; } } - + CLIENT_COMMANDS(CMD_REQUEST_COMMAND, argc) #undef CLIENT_COMMAND - + return FALSE; } @@ -438,10 +438,10 @@ float LocalCommand_macro_usage(float argc) { #define CLIENT_COMMAND(name,function,description) \ { if(name == strtolower(argv(1))) { function; return TRUE; } } - + CLIENT_COMMANDS(CMD_REQUEST_USAGE, argc) #undef CLIENT_COMMAND - + return FALSE; } @@ -449,10 +449,10 @@ void LocalCommand_macro_write_aliases(float fh) { #define CLIENT_COMMAND(name,function,description) \ { if(strtolower(description) != "") { CMD_Write_Alias("qc_cmd_cl", name, description); } } - + CLIENT_COMMANDS(0, 0) #undef CLIENT_COMMAND - + return; } @@ -468,24 +468,24 @@ void GameCommand(string command) // Guide for working with argc arguments by example: // argc: 1 - 2 - 3 - 4 - // argv: 0 - 1 - 2 - 3 + // argv: 0 - 1 - 2 - 3 // cmd vote - master - login - password - if(strtolower(argv(0)) == "help") + if(strtolower(argv(0)) == "help") { - if(argc == 1) + if(argc == 1) { print("\nClient console commands:\n"); LocalCommand_macro_help(); print("\nGeneric commands shared by all programs:\n"); GenericCommand_macro_help(); - + print("\nUsage:^3 cl_cmd COMMAND...^7, where possible commands are listed above.\n"); print("For help about a specific command, type cl_cmd help COMMAND\n"); - + return; - } + } else if(GenericCommand_macro_usage(argc)) // Instead of trying to call a command, we're going to see detailed information about it { return; @@ -494,8 +494,8 @@ void GameCommand(string command) { return; } - } - else if(GenericCommand(command)) + } + else if(GenericCommand(command)) { return; // handled by common/command/generic.qc } @@ -503,10 +503,10 @@ void GameCommand(string command) { return; // handled by one of the above LocalCommand_* functions } - + // nothing above caught the command, must be invalid print(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.\n"); - + return; } @@ -523,7 +523,7 @@ void GameCommand(string command) CONSOLE_COMMAND("+showaccuracy", { scoreboard_showaccuracy = TRUE; }) \ CONSOLE_COMMAND("-showaccuracy", { scoreboard_showaccuracy = FALSE; }) \ /* nothing */ - + #define CONSOLE_COMMANDS_MOVEMENT \ CONSOLE_COMMAND("+forward", { ++camera_direction_x; }) \ CONSOLE_COMMAND("-forward", { --camera_direction_x; }) \ @@ -551,7 +551,7 @@ void ConsoleCommand_macro_init() CONSOLE_COMMANDS_NORMAL #undef CONSOLE_COMMAND - + // then init movement commands #ifndef CAMERATEST if(isdemo()) @@ -565,7 +565,7 @@ void ConsoleCommand_macro_init() #ifndef CAMERATEST } #endif - + return; } @@ -573,10 +573,10 @@ float ConsoleCommand_macro_normal(float argc) { #define CONSOLE_COMMAND(name,execution) \ { if(name == strtolower(argv(0))) { { execution } return TRUE; } } - + CONSOLE_COMMANDS_NORMAL #undef CONSOLE_COMMAND - + return FALSE; } @@ -590,7 +590,7 @@ float ConsoleCommand_macro_movement(float argc) CONSOLE_COMMANDS_MOVEMENT #undef CONSOLE_COMMAND } - + return FALSE; } @@ -612,7 +612,7 @@ float CSQC_ConsoleCommand(string command) { return TRUE; } - + // Return value should be 1 if CSQC handled the command, otherwise return 0 to have the engine handle it. return FALSE; diff --git a/qcsrc/client/csqc_constants.qc b/qcsrc/client/csqc_constants.qc index 0016196ba..3889603aa 100644 --- a/qcsrc/client/csqc_constants.qc +++ b/qcsrc/client/csqc_constants.qc @@ -39,7 +39,7 @@ const float VF_PERSPECTIVE = 200; //(float) const float VF_CL_VIEWANGLES = 33; //(vector) const float VF_CL_VIEWANGLES_X = 34; //(float) const float VF_CL_VIEWANGLES_Y = 35; //(float) -const float VF_CL_VIEWANGLES_Z = 36; //(float) +const float VF_CL_VIEWANGLES_Z = 36; //(float) // Server Autosent Stat Constants const float STAT_HEALTH = 0; diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index 03c7eedd7..848c63277 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -93,7 +93,7 @@ string forceplayermodels_goodmodel; float forceplayermodels_goodmodelindex; .vector glowmod; -.vector old_glowmod; +.vector old_glowmod; void CSQCPlayer_ModelAppearance_PreUpdate(void) { @@ -283,7 +283,7 @@ void CSQCPlayer_ModelAppearance_Apply(float islocalplayer) // Fade out to black now... if(self.old_glowmod == '0 0 0') { self.old_glowmod = self.glowmod; } self.colormap = 0; - + self.glowmod = self.old_glowmod * bound(0, 1 - (time - self.death_time) / autocvar_cl_deathglow, 1); self.glowmod_x = max(self.glowmod_x, 0.0001); self.glowmod_y = max(self.glowmod_y, 0.0001); @@ -493,7 +493,7 @@ void CSQCModel_Effects_Apply(void) self.renderflags &= ~(RF_DEPTHHACK | RF_ADDITIVE | RF_FULLBRIGHT | EF_NOSHADOW | RF_USEAXIS); self.effects = 0; self.traileffect = 0; - + if(eff & EF_BRIGHTFIELD) self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); // ignoring EF_MUZZLEFLASH diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc index 9f5e32e95..cc3653db4 100644 --- a/qcsrc/client/damage.qc +++ b/qcsrc/client/damage.qc @@ -85,7 +85,7 @@ void DamageEffect(vector hitorg, float dmg, float type, float specnum) e = get_weaponinfo(type); effectname = strcat("damage_", e.netname); - + // if damage was dealt with a bullet weapon, our effect is blood // since blood is species dependent, include the species tag if(type == WEP_SHOTGUN || type == WEP_UZI || type == WEP_RIFLE) @@ -143,7 +143,7 @@ void Ent_DamageInfo(float isNew) } else forcemul = 1; - + for(self = findradius(w_org, rad + MAX_DAMAGEEXTRARADIUS); self; self = self.chain) { // attached ents suck @@ -198,7 +198,7 @@ void Ent_DamageInfo(float isNew) } self = oldself; - + if(DEATH_ISVEHICLE(w_deathtype)) { traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world); @@ -206,14 +206,14 @@ void Ent_DamageInfo(float isNew) w_backoff = trace_plane_normal; else w_backoff = -1 * normalize(w_org - (w_org + normalize(force) * 16)); - + setorigin(self, w_org + w_backoff * 2); // for sound() calls - + switch(w_deathtype) { case DEATH_VH_CRUSH: break; - + // spiderbot case DEATH_VH_SPID_MINIGUN: string _snd; @@ -229,7 +229,7 @@ void Ent_DamageInfo(float isNew) sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1); break; - + case DEATH_VH_WAKI_GUN: sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum("wakizashi_gun_impact"), self.origin, w_backoff * 1000, 1); @@ -242,7 +242,7 @@ void Ent_DamageInfo(float isNew) sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1); break; - + case DEATH_VH_RAPT_CANNON: sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum("raptor_cannon_impact"), self.origin, w_backoff * 1000, 1); @@ -273,8 +273,8 @@ void Ent_DamageInfo(float isNew) break; } } - - + + if(DEATH_ISTURRET(w_deathtype)) { string _snd; @@ -283,22 +283,22 @@ void Ent_DamageInfo(float isNew) w_backoff = trace_plane_normal; else w_backoff = -1 * normalize(w_org - (w_org + normalize(force) * 16)); - + setorigin(self, w_org + w_backoff * 2); // for sound() calls - + switch(w_deathtype) - { + { case DEATH_TURRET_EWHEEL: sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum("laser_impact"), self.origin, w_backoff * 1000, 1); break; - + case DEATH_TURRET_FLAC: pointparticles(particleeffectnum("hagar_explode"), w_org, '0 0 0', 1); _snd = strcat("weapons/hagexp", ftos(1 + rint(random() * 2)), ".waw"); sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM); break; - + case DEATH_TURRET_MLRS: case DEATH_TURRET_HK: case DEATH_TURRET_WALK_ROCKET: @@ -306,19 +306,19 @@ void Ent_DamageInfo(float isNew) sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum("rocket_explode"), self.origin, w_backoff * 1000, 1); break; - + case DEATH_TURRET_MACHINEGUN: case DEATH_TURRET_WALK_GUN: _snd = strcat("weapons/ric", ftos(1 + rint(random() * 2)), ".waw"); sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum("machinegun_impact"), self.origin, w_backoff * 1000, 1); break; - + case DEATH_TURRET_PLASMA: sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum("electro_impact"), self.origin, w_backoff * 1000, 1); break; - + case DEATH_TURRET_WALK_MEELE: sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum("TE_SPARK"), self.origin, w_backoff * 1000, 1); @@ -326,14 +326,14 @@ void Ent_DamageInfo(float isNew) case DEATH_TURRET_PHASER: break; - + case DEATH_TURRET_TESLA: te_smallflash(self.origin); break; } } - + // TODO spawn particle effects and sounds based on w_deathtype if(!DEATH_ISSPECIAL(w_deathtype)) if(!hitplayer || rad) // don't show ground impacts for hitscan weapons if a player was hit diff --git a/qcsrc/client/gibs.qc b/qcsrc/client/gibs.qc index 8c4081674..835d14a1e 100644 --- a/qcsrc/client/gibs.qc +++ b/qcsrc/client/gibs.qc @@ -176,7 +176,7 @@ void Ent_GibSplash(float isNew) { if(cl_gentle_gibs == 2) gentle_prefix = ""; - else if(cl_gentle_gibs == 3) + else if(cl_gentle_gibs == 3) gentle_prefix = "happy_"; } else if(autocvar_cl_particlegibs) diff --git a/qcsrc/client/hook.qc b/qcsrc/client/hook.qc index ab4891530..196730a72 100644 --- a/qcsrc/client/hook.qc +++ b/qcsrc/client/hook.qc @@ -8,7 +8,7 @@ void Draw_CylindricLine(vector from, vector to, float thickness, string texture, { // I want to draw a quad... // from and to are MIDPOINTS. - + vector axis, thickdir, A, B, C, D; float length_tex; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 293ad379e..80803df45 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -738,8 +738,8 @@ void HUD_Weapons(void) continue; // figure out the drawing position of weapon - weapon_pos = (panel_pos - + eX * column * weapon_size_x + weapon_pos = (panel_pos + + eX * column * weapon_size_x + eY * row * weapon_size_y); // draw background behind currently selected weapon @@ -1543,7 +1543,7 @@ void HUD_HealthArmor(void) { float BLINK_FACTOR = 0.15; float BLINK_BASE = 0.85; - float BLINK_FREQ = 9; + float BLINK_FREQ = 9; pain_health_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); } } @@ -1664,7 +1664,7 @@ void HUD_Notify(void) float entries, height; entries = bound(1, floor(KN_MAX_ENTRIES * mySize_y/mySize_x), KN_MAX_ENTRIES); height = mySize_y/entries; - + vector fontsize; float fontheight = height * autocvar_hud_panel_notify_fontsize; fontsize = '0.5 0.5 0' * fontheight; @@ -1726,7 +1726,7 @@ void HUD_Notify(void) { break; } - + attacker = notify_attackers[j]; victim = notify_victims[j]; icon = notify_icon[j]; @@ -1865,10 +1865,10 @@ void HUD_Radar(void) 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; - + panel_bg = strcat(hud_skin_path, "/border_default"); // always use the default border when maximized if(precache_pic(panel_bg) == "") { panel_bg = "gfx/hud/default/border_default"; } // fallback - + switch(hud_panel_radar_maximized_zoommode) { default: @@ -1885,7 +1885,7 @@ void HUD_Radar(void) f = 1; break; } - + switch(hud_panel_radar_maximized_rotation) { case 0: @@ -1914,7 +1914,7 @@ void HUD_Radar(void) f = 1; break; } - + switch(hud_panel_radar_rotation) { case 0: @@ -2297,7 +2297,7 @@ void HUD_Score(void) score = tm.(teamscores[ts_primary]); if(autocvar__hud_configure) score = 123; - + if (score > max_fragcount) max_fragcount = score; @@ -2752,7 +2752,7 @@ void HUD_Mod_CTF(vector pos, vector mySize) stat_items = getstati(STAT_ITEMS, 0, 24); redflag = (stat_items/IT_RED_FLAG_TAKEN) & 3; blueflag = (stat_items/IT_BLUE_FLAG_TAKEN) & 3; - + if(redflag || blueflag) mod_active = 1; else @@ -3029,29 +3029,29 @@ void HUD_Mod_KH(vector pos, vector mySize) float kaball_prevstatus; // last remembered status float kaball_statuschange_time; // time when the status changed -// we don't need to reset for keepaway since it immediately +// we don't need to reset for keepaway since it immediately // autocorrects prevstatus as to if the player has the ball or not void HUD_Mod_Keepaway(vector pos, vector mySize) { mod_active = 1; // keepaway should always show the mod HUD - + float BLINK_FACTOR = 0.15; float BLINK_BASE = 0.85; - float BLINK_FREQ = 5; + float BLINK_FREQ = 5; float kaball_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); - + float stat_items = getstati(STAT_ITEMS, 0, 24); float kaball = (stat_items/IT_KEY1) & 1; - + if(kaball != kaball_prevstatus) { kaball_statuschange_time = time; kaball_prevstatus = kaball; } - + vector kaball_pos, kaball_size; - + if(mySize_x > mySize_y) { kaball_pos = pos + eX * 0.25 * mySize_x; kaball_size = eX * 0.5 * mySize_x + eY * mySize_y; @@ -3059,13 +3059,13 @@ void HUD_Mod_Keepaway(vector pos, vector mySize) kaball_pos = pos + eY * 0.25 * mySize_y; kaball_size = eY * 0.5 * mySize_y + eX * mySize_x; } - + float kaball_statuschange_elapsedtime = time - kaball_statuschange_time; float f = bound(0, kaball_statuschange_elapsedtime*2, 1); - + if(kaball_prevstatus && f < 1) drawpic_aspect_skin_expanding(kaball_pos, "keepawayball_carrying", kaball_size, '1 1 1', panel_fg_alpha * kaball_alpha, DRAWFLAG_NORMAL, f); - + if(kaball) drawpic_aspect_skin(pos, "keepawayball_carrying", eX * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha * kaball_alpha * f, DRAWFLAG_NORMAL); } @@ -3591,7 +3591,7 @@ void HUD_EngineInfo(void) frametimeavg = (frametimeavg + frametimeavg1 + frametimeavg2 + currentframetime)/4; // average three frametimes into framecounter for slightly more stable fps readings :P frametimeavg2 = frametimeavg1; frametimeavg1 = frametimeavg; - + float weight; weight = cvar("hud_panel_engineinfo_framecounter_exponentialmovingaverage_new_weight"); if(currentframetime > 0.0001) // filter out insane values which sometimes seem to occur and throw off the average? If you are getting 10,000 fps or more, then you don't need a framerate counter. @@ -3669,7 +3669,7 @@ void HUD_InfoMessages(void) vector fontsize; fontsize = '0.20 0.20 0' * mySize_y; - + float a; a = panel_fg_alpha; @@ -3795,7 +3795,7 @@ void HUD_InfoMessages(void) } } } - else + else { s = _("^7Press ^3ESC ^7to show HUD options."); drawInfoMessage(s) @@ -3871,7 +3871,7 @@ void HUD_Physics(void) conversion_factor = 0.0254 * 1.943844492; // 1 m/s = 1.943844492 knots, because 1 knot = 1.852 km/h break; } - + vector vel = (csqcplayer ? csqcplayer.velocity : pmove_vel); float max_speed = floor( autocvar_hud_panel_physics_speed_max * conversion_factor + 0.5 ); @@ -3894,9 +3894,9 @@ void HUD_Physics(void) acceleration = (vlen(vel) - vlen(acc_prevspeed)); else acceleration = (vlen(vel - '0 0 1' * vel_z) - vlen(acc_prevspeed - '0 0 1' * acc_prevspeed_z)); - + acceleration = acceleration * (1 / max(0.0001, f)) * (0.0254 / 9.80665); - + acc_prevspeed = vel; acc_prevtime = time; @@ -4229,9 +4229,9 @@ void HUD_CenterPrint (void) if (scoreboard_bottom >= 0.96 * vid_conheight) return; vector target_pos; - + target_pos = eY * scoreboard_bottom + eX * 0.5 * (vid_conwidth - panel_size_x); - + if(target_pos_y > panel_pos_y) { panel_pos = panel_pos + (target_pos - panel_pos) * sqrt(scoreboard_fade_alpha); @@ -4288,7 +4288,7 @@ void HUD_CenterPrint (void) } - // fade the centerprint_hud in/out + // fade the centerprint_hud in/out if(centerprint_time[j] < 0) a = bound(0, (time - centerprint_expire_time[j]) / max(0.0001, autocvar_hud_panel_centerprint_fade_in), 1); else if(centerprint_expire_time[j] - autocvar_hud_panel_centerprint_fade_out > time) @@ -4297,21 +4297,21 @@ void HUD_CenterPrint (void) a = (centerprint_expire_time[j] - time) / max(0.0001, autocvar_hud_panel_centerprint_fade_out); else a = 0; - + // set the size from fading in/out before subsequent fading - sz = autocvar_hud_panel_centerprint_fade_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_minfontsize); - + sz = autocvar_hud_panel_centerprint_fade_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_minfontsize); + // also fade it based on positioning if(autocvar_hud_panel_centerprint_fade_subsequent) { a = a * bound(autocvar_hud_panel_centerprint_fade_subsequent_passone_minalpha, (1 - (g / max(1, autocvar_hud_panel_centerprint_fade_subsequent_passone))), 1); // pass one: all messages after the first have half theAlpha a = a * bound(autocvar_hud_panel_centerprint_fade_subsequent_passtwo_minalpha, (1 - (g / max(1, autocvar_hud_panel_centerprint_fade_subsequent_passtwo))), 1); // pass two: after that, gradually lower theAlpha even more for each message } - + // finally set the size based on the new theAlpha from subsequent fading - sz = sz * (autocvar_hud_panel_centerprint_fade_subsequent_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_subsequent_minfontsize)); + sz = sz * (autocvar_hud_panel_centerprint_fade_subsequent_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_subsequent_minfontsize)); drawfontscale = sz * '1 1 0'; - + if (centerprint_countdown_num[j]) n = tokenizebyseparator(strreplace("^COUNT", count_seconds(centerprint_countdown_num[j]), centerprint_messages[j]), "\n"); else @@ -4354,15 +4354,15 @@ void HUD_CenterPrint (void) } } - ++g; // move next position number up - + ++g; // move next position number up + msg_size = pos_y - msg_size; if (autocvar_hud_panel_centerprint_flip) { pos_y = current_msg_pos_y - CENTERPRINT_SPACING * fontsize_y; if (a < 1 && centerprint_msgID[j] == 0) // messages with id can be replaced just after they are faded out, so never move over them the next messages pos_y += (msg_size + CENTERPRINT_SPACING * fontsize_y) * (1 - sqrt(sz)); - + if (pos_y < panel_pos_y) // check if the next message can be shown { drawfontscale = '1 1 0'; @@ -4374,7 +4374,7 @@ void HUD_CenterPrint (void) pos_y += CENTERPRINT_SPACING * fontsize_y; if (a < 1 && centerprint_msgID[j] == 0) // messages with id can be replaced just after they are faded out, so never move over them the next messages pos_y -= (msg_size + CENTERPRINT_SPACING * fontsize_y) * (1 - sqrt(sz)); - + if(pos_y > panel_pos_y + panel_size_y - fontsize_y) // check if the next message can be shown { drawfontscale = '1 1 0'; diff --git a/qcsrc/client/hud_config.qc b/qcsrc/client/hud_config.qc index be53f450f..869e30dda 100644 --- a/qcsrc/client/hud_config.qc +++ b/qcsrc/client/hud_config.qc @@ -131,7 +131,7 @@ void HUD_Panel_ExportCfg(string cfgname) HUD_Write_PanelCvar_q("_maximized_scale"); HUD_Write_PanelCvar_q("_maximized_size"); HUD_Write_PanelCvar_q("_maximized_rotation"); - HUD_Write_PanelCvar_q("_maximized_zoommode"); + HUD_Write_PanelCvar_q("_maximized_zoommode"); break; case HUD_PANEL_SCORE: HUD_Write_PanelCvar_q("_rankings"); @@ -978,7 +978,7 @@ void HUD_Panel_FirstInDrawQ(float id) } // now save the new top id panel_order[0] = id; - + // let's save them into the cvar by some strcat trickery string s = ""; for(i = 0; i < HUD_PANEL_NUM; ++i) @@ -1090,7 +1090,7 @@ void HUD_Panel_Mouse() if (!autocvar_hud_cursormode) { mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed; - + mousepos_x = bound(0, mousepos_x, vid_conwidth); mousepos_y = bound(0, mousepos_y, vid_conheight); } diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index 796db00d8..8caeb01d5 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -56,16 +56,16 @@ void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, strin vector rgb; string label; float text_size; - + isize -= hud_fontsize_y; // respect the text when calculating the image size rgb = MapVote_RGB(id, count); - + img_size_y = isize; img_size_x = isize / 0.75; // 4:3 x can be stretched easily, height is defined in isize pos_y = pos_y + img_size_y; - + label = MapVote_FormatMapItem(id, map, count, tsize, hud_fontsize); text_size = stringwidth(label, false, hud_fontsize); @@ -78,7 +78,7 @@ void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, strin pos_x -= text_size*0.5; drawstring(pos, label, hud_fontsize, rgb, theAlpha, DRAWFLAG_NORMAL); - + pos_x = pos_x + text_size*0.5 - img_size_x*0.5; pos_y = pos_y - img_size_y; @@ -110,15 +110,15 @@ void MapVote_DrawAbstain(vector pos, float isize, float tsize, float count, floa vector rgb; float text_size; string label; - + rgb = MapVote_RGB(id, count); pos_y = pos_y + hud_fontsize_y; - + label = MapVote_FormatMapItem(id, _("Don't care"), count, tsize, hud_fontsize); text_size = stringwidth(label, false, hud_fontsize); - + pos_x -= text_size*0.5; drawstring(pos, label, hud_fontsize, rgb, 1, DRAWFLAG_NORMAL); } @@ -179,7 +179,7 @@ void MapVote_Draw() if (!autocvar_hud_cursormode) { mv_mousepos = mv_mousepos + getmousepos(); - + mv_mousepos_x = bound(0, mv_mousepos_x, vid_conwidth); mv_mousepos_y = bound(0, mv_mousepos_y, vid_conheight); } @@ -273,12 +273,12 @@ void Cmd_MapVote_MapDownload(float argc) print(_("mv_mapdownload: ^3You're not supposed to use this command on your own!\n")); return; } - + id = stof(argv(1)); for(pak = mv_pk3list; pak; pak = pak.chain) if(pak.sv_entnum == id) break; - + if(!pak || pak.sv_entnum != id) { print(_("^1Error:^7 Couldn't find pak index.\n")); return; @@ -301,10 +301,10 @@ void MapVote_CheckPK3(string pic, string pk3, float id) pak.netname = pk3; pak.message = pic; pak.sv_entnum = id; - + pak.chain = mv_pk3list; mv_pk3list = pak; - + if(pk3 != "") { localcmd(strcat("\ncurl --pak ", pk3, "; wait; cl_cmd mv_download ", ftos(id), "\n")); @@ -367,10 +367,10 @@ void MapVote_Init() mv_maps_mask = ReadByte(); else mv_maps_mask = ReadShort(); - + // Assume mv_pk3list is world, there should only be 1 mapvote per round mv_pk3list = world; // I'm still paranoid! - + for(i = 0, power = 1; i < mv_num_maps; ++i, power *= 2) { mv_votes[i] = 0; @@ -380,7 +380,7 @@ void MapVote_Init() map = strzone(ReadString()); pk3 = strzone(ReadString()); j = bound(0, ReadByte(), n_ssdirs - 1); - + mv_maps[i] = map; mv_pk3[i] = pk3; map = strzone(strcat(ssdirs[j], "/", map)); diff --git a/qcsrc/client/miscfunctions.qc b/qcsrc/client/miscfunctions.qc index 7f1b893a7..9cfc5d0ea 100644 --- a/qcsrc/client/miscfunctions.qc +++ b/qcsrc/client/miscfunctions.qc @@ -576,11 +576,11 @@ vector getplayerorigin(float pl) float getplayerisdead(float pl) { entity e; - + e = CSQCModel_server2csqc(pl + 1); if(e) return e.csqcmodel_isdead; - + return FALSE; } diff --git a/qcsrc/client/movetypes.qc b/qcsrc/client/movetypes.qc index 0622aafe3..22bbd142f 100644 --- a/qcsrc/client/movetypes.qc +++ b/qcsrc/client/movetypes.qc @@ -128,7 +128,7 @@ float _Movetype_TestEntityPosition(vector ofs) // SV_TestEntityPosition vector org; float cont; org = self.move_origin + ofs; - + cont = self.dphitcontentsmask; self.dphitcontentsmask = DPCONTENTS_SOLID; tracebox(self.move_origin, self.mins, self.maxs, self.move_origin, MOVE_NOMONSTERS, self); @@ -264,7 +264,7 @@ void _Movetype_Physics_Toss(float dt) // SV_Physics_Toss _Movetype_PushEntity(move, TRUE); if(wasfreed(self)) return; - + if(trace_startsolid) { _Movetype_UnstickEntity(); diff --git a/qcsrc/client/particles.qc b/qcsrc/client/particles.qc index 00343a432..ce8b6dd7f 100644 --- a/qcsrc/client/particles.qc +++ b/qcsrc/client/particles.qc @@ -290,9 +290,9 @@ void Net_ReadNexgunBeamParticle() shotorg_x = ReadCoord(); shotorg_y = ReadCoord(); shotorg_z = ReadCoord(); endpos_x = ReadCoord(); endpos_y = ReadCoord(); endpos_z = ReadCoord(); charge = ReadByte() / 255.0; - + pointparticles(particleeffectnum("nex_muzzleflash"), shotorg, normalize(endpos - shotorg) * 1000, 1); - + //draw either the old v2.3 beam or the new beam charge = sqrt(charge); // divide evenly among trail spacing and alpha particles_alphamin = particles_alphamax = particles_fade = charge; diff --git a/qcsrc/client/projectile.qc b/qcsrc/client/projectile.qc index b86c234bd..e00e25e6e 100644 --- a/qcsrc/client/projectile.qc +++ b/qcsrc/client/projectile.qc @@ -111,7 +111,7 @@ void Projectile_Draw() case PROJECTILE_NADE_PINK: case PROJECTILE_NADE_BURN: case PROJECTILE_NADE: - rot = self.avelocity; + rot = self.avelocity; break; case PROJECTILE_HOOKBOMB: rot = '1000 0 0'; // forward @@ -324,7 +324,7 @@ void Ent_Projectile() case PROJECTILE_BUMBLE_GUN: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break; case PROJECTILE_BUMBLE_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break; - + case PROJECTILE_NADE_RED: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_red"); break; case PROJECTILE_NADE_RED_BURN: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_red_burn"); break; case PROJECTILE_NADE_BLUE: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_blue"); break; @@ -467,7 +467,7 @@ void Ent_Projectile() break; case PROJECTILE_WAKIROCKET: loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTEN_NORM); - break; + break; /* case PROJECTILE_WAKICANNON: break; @@ -523,7 +523,7 @@ void Projectile_Precache() precache_model("models/rocket.md3"); precache_model("models/tagrocket.md3"); precache_model("models/tracer.mdl"); - + precache_model("models/weapons/v_ok_grenade.md3"); precache_sound("weapons/electro_fly.wav"); diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index 7c79d5c43..b037d03d2 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -586,7 +586,7 @@ string HUD_GetField(entity pl, float field) } else str = sprintf("%.1f", num/denom); return str; - + case SP_SUM: f = pl.(scores[SP_KILLS]); f -= pl.(scores[SP_DEATHS]); @@ -1081,7 +1081,7 @@ vector HUD_DrawKeyValue(vector pos, string key, string value) { drawstring(pos, value, hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL); pos_x = px; pos_y+= hud_fontsize_y; - + return pos; } @@ -1104,8 +1104,8 @@ vector HUD_DrawMapStats(vector pos, vector rgb, vector bg_size) { // draw table header drawstring(pos, _("Map stats:"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL); pos_y += 1.25 * hud_fontsize_y + autocvar_scoreboard_border_thickness; - - // draw table + + // draw table vector tmp = '0 0 0'; tmp_x = sbwidth; tmp_y = hud_fontsize_y * rows; @@ -1119,7 +1119,7 @@ vector HUD_DrawMapStats(vector pos, vector rgb, vector bg_size) { // draw secrets val = sprintf("%d/%d", stat_secrets_found, stat_secrets_total); pos = HUD_DrawKeyValue(pos, _("Secrets found:"), val); - + // update position pos_y += 1.25 * hud_fontsize_y; return pos; @@ -1316,7 +1316,7 @@ void HUD_DrawScoreboard() pos = HUD_DrawScoreboardAccuracyStats(pos, rgb, bg_size); } - + if(teamplay) pos = HUD_DrawMapStats(pos, Team_ColorRGB(myteam), bg_size); else @@ -1364,14 +1364,14 @@ void HUD_DrawScoreboard() str = strcat(str, _(" or")); if(teamplay) { - str = strcat(str, sprintf(_(" until ^3%s %s^7"), ScoreString(teamscores_flags[ts_primary], fl), + str = strcat(str, sprintf(_(" until ^3%s %s^7"), ScoreString(teamscores_flags[ts_primary], fl), (teamscores_label[ts_primary] == "score") ? CTX(_("SCO^points")) : (teamscores_label[ts_primary] == "fastest") ? CTX(_("SCO^is beaten")) : TranslateScoresLabel(teamscores_label[ts_primary]))); } else { - str = strcat(str, sprintf(_(" until ^3%s %s^7"), ScoreString(scores_flags[ps_primary], fl), + str = strcat(str, sprintf(_(" until ^3%s %s^7"), ScoreString(scores_flags[ps_primary], fl), (scores_label[ps_primary] == "score") ? CTX(_("SCO^points")) : (scores_label[ps_primary] == "fastest") ? CTX(_("SCO^is beaten")) : TranslateScoresLabel(scores_label[ps_primary]))); @@ -1383,14 +1383,14 @@ void HUD_DrawScoreboard() str = strcat(str, _(" or")); if(teamplay) { - str = strcat(str, sprintf(_(" until a lead of ^3%s %s^7"), ScoreString(teamscores_flags[ts_primary], ll), + str = strcat(str, sprintf(_(" until a lead of ^3%s %s^7"), ScoreString(teamscores_flags[ts_primary], ll), (teamscores_label[ts_primary] == "score") ? CTX(_("SCO^points")) : (teamscores_label[ts_primary] == "fastest") ? CTX(_("SCO^is beaten")) : TranslateScoresLabel(teamscores_label[ts_primary]))); } else { - str = strcat(str, sprintf(_(" until a lead of ^3%s %s^7"), ScoreString(scores_flags[ps_primary], ll), + str = strcat(str, sprintf(_(" until a lead of ^3%s %s^7"), ScoreString(scores_flags[ps_primary], ll), (scores_label[ps_primary] == "score") ? CTX(_("SCO^points")) : (scores_label[ps_primary] == "fastest") ? CTX(_("SCO^is beaten")) : TranslateScoresLabel(scores_label[ps_primary]))); @@ -1410,7 +1410,7 @@ void HUD_DrawScoreboard() // a negative number means we are awaiting respawn, time value is still the same respawn_time *= -1; // remove mark now that we checked it respawn_time = max(time, respawn_time); // don't show a negative value while the server is respawning the player (lag) - + str = sprintf(_("^1Respawning in ^3%s^1..."), (autocvar_scoreboard_respawntime_decimals ? count_seconds_decs(respawn_time - time, autocvar_scoreboard_respawntime_decimals) diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index a7824a9b7..c581fba42 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -13,7 +13,7 @@ void Draw_ShowNames(entity ent) { if(!autocvar_hud_shownames) return; - + #ifdef COMPAT_XON050_ENGINE if((ent.sv_entnum == player_localentnum) || (ent.sv_entnum == spectatee_status)) // ent is me or person i'm spectating #else @@ -27,7 +27,7 @@ void Draw_ShowNames(entity ent) if(ent.sameteam || (!ent.sameteam && autocvar_hud_shownames_enemies)) { ent.origin_z += autocvar_hud_shownames_offset; - + float hit; if(ent.sameteam && !autocvar_hud_shownames_crosshairdistance) { @@ -45,9 +45,9 @@ void Draw_ShowNames(entity ent) // handle tag fading float overlap = FALSE, onscreen, crosshairdistance; vector o, eo; - + o = project_3d_to_2d(ent.origin); - + if(autocvar_hud_shownames_antioverlap) { // fade tag out if another tag that is closer to you overlaps @@ -71,30 +71,30 @@ void Draw_ShowNames(entity ent) onscreen = (o_z >= 0 && o_x >= 0 && o_y >= 0 && o_x <= vid_conwidth && o_y <= vid_conheight); crosshairdistance = sqrt( pow(o_x - vid_conwidth/2, 2) + pow(o_y - vid_conheight/2, 2) ); - + if(autocvar_hud_shownames_crosshairdistance) { if(autocvar_hud_shownames_crosshairdistance > crosshairdistance) ent.pointtime = time; - + if (!(ent.pointtime + autocvar_hud_shownames_crosshairdistance_time > time)) overlap = TRUE; else overlap = (autocvar_hud_shownames_crosshairdistance_antioverlap ? overlap : FALSE); // override what antioverlap says unless allowed by cvar. } - + if(!ent.fadedelay) ent.fadedelay = time + SHOWNAMES_FADEDELAY; if(!ent.sameteam && (!onscreen || !hit)) // out of view, fade out - { - ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * frametime); + { + ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * frametime); ent.fadedelay = 0; // reset fade in delay, enemy has left the view } else if(ent.csqcmodel_isdead) // dead player, fade out slowly - ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * 0.25 * frametime); + ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * 0.25 * frametime); else if(overlap) // tag overlap detected, fade out - ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * frametime); + ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * frametime); else if(ent.sameteam) // fade in for team mates ent.alpha = min(1, ent.alpha + SHOWNAMES_FADESPEED * frametime); else if(time > ent.fadedelay) // fade in for enemies @@ -102,7 +102,7 @@ void Draw_ShowNames(entity ent) if(!ent.alpha) return; - + float dist; dist = vlen(ent.origin - view_origin); @@ -218,7 +218,7 @@ void Draw_ShowNames_All() setorigin(e, getplayerorigin(i)); if(e.origin == GETPLAYERORIGIN_ERROR) continue; - + e.csqcmodel_isdead = getplayerisdead(i); Draw_ShowNames(e); diff --git a/qcsrc/client/tturrets.qc b/qcsrc/client/tturrets.qc index 161bfa385..2088348b1 100644 --- a/qcsrc/client/tturrets.qc +++ b/qcsrc/client/tturrets.qc @@ -14,7 +14,7 @@ void turrets_precache() } void turret_precache(float _tid) -{ +{ if (!turret_is_precache[TID_COMMON]) { precache_sound ("weapons/rocket_impact.wav"); @@ -38,13 +38,13 @@ void turret_precache(float _tid) { case TID_EWHEEL: precache_model ("models/turrets/ewheel-base2.md3"); - precache_model ("models/turrets/ewheel-gun1.md3"); + precache_model ("models/turrets/ewheel-gun1.md3"); break; case TID_FLAC: precache_model ("models/turrets/flac.md3"); break; case TID_FUSION: - precache_model ("models/turrets/reactor.md3"); + precache_model ("models/turrets/reactor.md3"); break; case TID_HELLION: precache_model ("models/turrets/hellion.md3"); @@ -79,7 +79,7 @@ void turret_precache(float _tid) precache_model ("models/turrets/walker_body.md3"); precache_sound ("weapons/uzi_fire.wav"); break; - } + } turret_is_precache[_tid] = TRUE; } @@ -148,19 +148,19 @@ void turret_tid2info(float _tid) tid2info_min = '-70 -70 0'; tid2info_max = '70 70 95'; break; - } + } } void turret_remove() -{ +{ remove(self.tur_head); //remove(self.enemy); - self.tur_head = world; + self.tur_head = world; } .vector glowmod; void turret_changeteam() -{ +{ switch(self.team - 1) { case NUM_TEAM_1: // Red @@ -183,46 +183,46 @@ void turret_changeteam() self.teamradar_color = '1 0 1'; break; } - + if(self.team) self.colormap = 1024 + (self.team - 1) * 17; - + self.tur_head.colormap = self.colormap; self.tur_head.glowmod = self.glowmod; - + } void turret_head_draw() -{ +{ self.drawmask = MASK_NORMAL; } void turret_draw() -{ +{ float dt; dt = time - self.move_time; self.move_time = time; if(dt <= 0) return; - + self.tur_head.angles += dt * self.tur_head.move_avelocity; if (self.health < 127) { dt = random(); - + if(dt < 0.03) - te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16); + te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16); } - + if(self.health < 85) if(dt < 0.01) pointparticles(particleeffectnum("smoke_large"), (self.origin + (randomvec() * 80)), '0 0 0', 1); - + if(self.health < 32) if(dt < 0.015) - pointparticles(particleeffectnum("smoke_small"), (self.origin + (randomvec() * 80)), '0 0 0', 1); + pointparticles(particleeffectnum("smoke_small"), (self.origin + (randomvec() * 80)), '0 0 0', 1); } @@ -230,33 +230,33 @@ void turret_draw2d() { if(self.netname == "") return; - + if(!autocvar_g_waypointsprite_turrets) return; - + if(autocvar_cl_hidewaypoints) - return; + return; float dist = vlen(self.origin - view_origin); - float t = (GetPlayerColor(player_localnum) + 1); + float t = (GetPlayerColor(player_localnum) + 1); vector o; string txt; - + if(autocvar_cl_vehicles_hud_tactical) if(dist < 10240 && t != self.team) { // TODO: Vehicle tactical hud o = project_3d_to_2d(self.origin + '0 0 32'); - if(o_z < 0 - || o_x < (vid_conwidth * waypointsprite_edgeoffset_left) - || o_y < (vid_conheight * waypointsprite_edgeoffset_top) - || o_x > (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) + if(o_z < 0 + || o_x < (vid_conwidth * waypointsprite_edgeoffset_left) + || o_y < (vid_conheight * waypointsprite_edgeoffset_top) + || o_x > (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) || o_y > (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom))) return; // Dont draw wp's for turrets out of view o_z = 0; if(hud != HUD_NORMAL) - { + { switch(hud) { case HUD_SPIDERBOT: @@ -267,14 +267,14 @@ void turret_draw2d() txt = "gfx/vehicles/vth-mover.tga"; else txt = "gfx/vehicles/vth-stationary.tga"; - + vector pz = drawgetimagesize(txt) * 0.25; drawpic(o - pz * 0.5, txt, pz , '1 1 1', 0.75, DRAWFLAG_NORMAL); break; } } } - + if(dist > self.maxdistance) return; @@ -282,7 +282,7 @@ void turret_draw2d() float a = self.alpha * autocvar_hud_panel_fg_alpha; vector rgb = spritelookupcolor(spriteimage, self.teamradar_color); - + if(self.maxdistance > waypointsprite_normdistance) a *= pow(bound(0, (self.maxdistance - dist) / (self.maxdistance - waypointsprite_normdistance), 1), waypointsprite_distancealphaexponent); else if(self.maxdistance > 0) @@ -291,7 +291,7 @@ void turret_draw2d() if(rgb == '0 0 0') { self.teamradar_color = '1 0 1'; - print(sprintf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage)); + print(sprintf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage)); } txt = self.netname; @@ -299,18 +299,18 @@ void turret_draw2d() txt = _("Spam"); else txt = spritelookuptext(spriteimage); - + if(time - floor(time) > 0.5 && t == self.team) { if(self.helpme && time < self.helpme) { a *= SPRITE_HELPME_BLINK; txt = sprintf(_("%s under attack!"), txt); - } + } else a *= spritelookupblinkvalue(spriteimage); } - + if(autocvar_g_waypointsprite_uppercase) txt = strtoupper(txt); @@ -322,23 +322,23 @@ void turret_draw2d() if(a <= 0) return; - + rgb = fixrgbexcess(rgb); o = project_3d_to_2d(self.origin + '0 0 64'); - if(o_z < 0 - || o_x < (vid_conwidth * waypointsprite_edgeoffset_left) - || o_y < (vid_conheight * waypointsprite_edgeoffset_top) - || o_x > (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) + if(o_z < 0 + || o_x < (vid_conwidth * waypointsprite_edgeoffset_left) + || o_y < (vid_conheight * waypointsprite_edgeoffset_top) + || o_x > (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) || o_y > (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom))) return; // Dont draw wp's for turrets out of view o_z = 0; float edgedistance_min, crosshairdistance; - edgedistance_min = min((o_y - (vid_conheight * waypointsprite_edgeoffset_top)), + edgedistance_min = min((o_y - (vid_conheight * waypointsprite_edgeoffset_top)), (o_x - (vid_conwidth * waypointsprite_edgeoffset_left)), - (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o_x, + (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o_x, (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)) - o_y); float vidscale = max(vid_conwidth / vid_width, vid_conheight / vid_height); @@ -361,7 +361,7 @@ void turret_draw2d() t = t * (1 - (1 - waypointsprite_crosshairfadescale) * (1 - bound(0, crosshairdistance/waypointsprite_crosshairfadedistance, 1))); } - o = drawspritearrow(o, M_PI, rgb, a, SPRITE_ARROW_SCALE * t); + o = drawspritearrow(o, M_PI, rgb, a, SPRITE_ARROW_SCALE * t); o = drawspritetext(o, M_PI, (SPRITE_HEALTHBAR_WIDTH + 2 * SPRITE_HEALTHBAR_BORDER) * t, rgb, a, waypointsprite_fontsize * '1 1 0', txt); drawhealthbar( o, @@ -383,50 +383,50 @@ void turret_draw2d() } void turret_walker_draw() -{ +{ float dt; - + dt = time - self.move_time; self.move_time = time; if(dt <= 0) return; - + fixedmakevectors(self.angles); movelib_groundalign4point(300, 100, 0.25, 45); setorigin(self, self.origin + self.velocity * dt); self.tur_head.angles += dt * self.tur_head.move_avelocity; self.angles_y = self.move_angles_y; - + if (self.health < 127) if(random() < 0.15) - te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16); + te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16); } void turret_ewheel_draw() -{ +{ float dt; - + dt = time - self.move_time; self.move_time = time; if(dt <= 0) return; - - fixedmakevectors(self.angles); + + fixedmakevectors(self.angles); setorigin(self, self.origin + self.velocity * dt); self.tur_head.angles += dt * self.tur_head.move_avelocity; self.angles_y = self.move_angles_y; - + if (self.health < 127) if(random() < 0.05) - te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16); + te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16); } void(entity e, entity tagentity, string tagname) setattachment = #443; void turret_construct() -{ +{ if(self.tur_head == world) self.tur_head = spawn(); - + turret_tid2info(self.turret_type); self.netname = tid2info_name; @@ -435,12 +435,12 @@ void turret_construct() setmodel(self.tur_head, tid2info_head); setsize(self, tid2info_min, tid2info_max); setsize(self.tur_head, '0 0 0', '0 0 0'); - + if(self.turret_type == TID_EWHEEL) setattachment(self.tur_head, self, ""); else setattachment(self.tur_head, self, "tag_head"); - + self.tur_head.classname = "turret_head"; self.tur_head.owner = self; self.tur_head.move_movetype = MOVETYPE_NOCLIP; @@ -450,24 +450,24 @@ void turret_construct() self.solid = SOLID_BBOX; self.tur_head.solid = SOLID_NOT; self.movetype = MOVETYPE_NOCLIP; - self.tur_head.movetype = MOVETYPE_NOCLIP; + self.tur_head.movetype = MOVETYPE_NOCLIP; self.draw = turret_draw; self.entremove = turret_remove; self.drawmask = MASK_NORMAL; self.tur_head.drawmask = MASK_NORMAL; - self.anim_start_time = 0; + self.anim_start_time = 0; self.draw2d = turret_draw2d; self.maxdistance = autocvar_g_waypointsprite_turrets_maxdist; self.teamradar_color = '1 0 0'; self.alpha = 1; - + if(self.turret_type == TID_EWHEEL || self.turret_type == TID_WALKER) { self.gravity = 1; self.movetype = MOVETYPE_BOUNCE; self.move_movetype = MOVETYPE_BOUNCE; - self.move_origin = self.origin; - self.move_time = time; + self.move_origin = self.origin; + self.move_time = time; switch(self.turret_type) { case TID_EWHEEL: @@ -476,8 +476,8 @@ void turret_construct() case TID_WALKER: self.draw = turret_walker_draw; break; - - } + + } } } @@ -486,9 +486,9 @@ void turret_gibboom(); void turret_gib_draw() { Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy); - + self.drawmask = MASK_NORMAL; - + if(self.cnt) { if(time >= self.nextthink) @@ -501,14 +501,14 @@ void turret_gib_draw() { self.alpha = bound(0, self.nextthink - time, 1); if(self.alpha < ALPHA_MIN_VISIBLE) - remove(self); + remove(self); } } void turret_gibboom() { float i; - + sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1); @@ -519,43 +519,43 @@ void turret_gibboom() entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, float _explode) { entity gib; - + traceline(_from, _to, MOVE_NOMONSTERS, world); if(trace_startsolid) return world; - + gib = spawn(); setorigin(gib, _from); setmodel(gib, _model); gib.colormod = _cmod; gib.solid = SOLID_CORPSE; - gib.draw = turret_gib_draw; + gib.draw = turret_gib_draw; gib.cnt = _explode; setsize(gib, '-1 -1 -1', '1 1 1'); if(_explode) { gib.nextthink = time + 0.2 * (autocvar_cl_gibs_lifetime * (1 + prandom() * 0.15)); gib.effects = EF_FLAME; - } + } else gib.nextthink = time + autocvar_cl_gibs_lifetime * (1 + prandom() * 0.15); - + gib.gravity = 1; gib.move_movetype = MOVETYPE_BOUNCE; gib.move_origin = _from; setorigin(gib, _from); - gib.move_velocity = _to; + gib.move_velocity = _to; gib.move_avelocity = prandomvec() * 32; gib.move_time = time; gib.damageforcescale = 1; gib.classname = "turret_gib"; - + return gib; } void turret_die() -{ - +{ + sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1); turret_tid2info(self.turret_type); @@ -569,9 +569,9 @@ void turret_die() else if (self.turret_type == TID_TESLA) turret_gibtoss(tid2info_base, self.origin + '0 0 18', '0 0 200', '-1 -1 -1', FALSE); else - { + { if (random() > 0.5) - { + { turret_gibtoss("models/turrets/base-gib2.md3", self.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', FALSE); turret_gibtoss("models/turrets/base-gib3.md3", self.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', FALSE); turret_gibtoss("models/turrets/base-gib4.md3", self.origin + '0 0 8', '0 0 50' + randomvec() * 150, '0 0 0', FALSE); @@ -585,11 +585,11 @@ void turret_die() headgib.angles = headgib.move_angles = self.tur_head.angles; headgib.avelocity = headgib.move_avelocity = self.tur_head.move_avelocity + randomvec() * 45; headgib.avelocity_y = headgib.move_avelocity_y = headgib.move_avelocity_y * 5; - headgib.gravity = 0.5; + headgib.gravity = 0.5; } } } - + setmodel(self, "null"); setmodel(self.tur_head, "null"); } @@ -600,63 +600,63 @@ void ent_turret() sf = ReadByte(); if(sf & TNSF_SETUP) - { + { self.turret_type = ReadByte(); - + self.origin_x = ReadCoord(); self.origin_y = ReadCoord(); self.origin_z = ReadCoord(); setorigin(self, self.origin); - + self.angles_x = ReadAngle(); self.angles_y = ReadAngle(); - + turret_precache(self.turret_type); turret_construct(); self.colormap = 1024; - self.glowmod = '0 1 1'; + self.glowmod = '0 1 1'; self.tur_head.colormap = self.colormap; self.tur_head.glowmod = self.glowmod; } - + if(sf & TNSF_ANG) { if(self.tur_head == world) // aparenly this can happpen before TNSF_SETUP. great. self.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; } - + if(sf & TNSF_AVEL) { if(self.tur_head == world) // aparenly this can happpen before TNSF_SETUP. great. self.tur_head = spawn(); - + self.tur_head.move_avelocity_x = ReadShort(); - self.tur_head.move_avelocity_y = ReadShort(); + self.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); - + self.velocity_x = ReadShort(); self.velocity_y = ReadShort(); self.velocity_z = ReadShort(); - + self.move_angles_y = ReadShort(); - + self.move_time = time; self.move_velocity = self.velocity; self.move_origin = self.origin; } - + if(sf & TNSF_ANIM) { self.frame1time = ReadCoord(); @@ -668,18 +668,18 @@ void ent_turret() float _tmp; _tmp = ReadByte(); if(_tmp != self.team) - { - self.team = _tmp; + { + self.team = _tmp; turret_changeteam(); } - - _tmp = ReadByte(); + + _tmp = ReadByte(); if(_tmp == 0 && self.health != 0) turret_die(); else if(self.health && self.health != _tmp) self.helpme = servertime + 10; self.health = _tmp; - } + } //self.enemy.health = self.health / 255; } diff --git a/qcsrc/client/vehicles/vehicles.qc b/qcsrc/client/vehicles/vehicles.qc index 6efc2f953..d8727e176 100644 --- a/qcsrc/client/vehicles/vehicles.qc +++ b/qcsrc/client/vehicles/vehicles.qc @@ -103,7 +103,7 @@ void Net_AuXair2(float bIsNew) axh.alpha = 1; AuxiliaryXhair[axh_id] = axh; } - + axh.move_origin_x = ReadCoord(); axh.move_origin_y = ReadCoord(); axh.move_origin_z = ReadCoord(); @@ -111,31 +111,31 @@ void Net_AuXair2(float bIsNew) axh.colormod_y = ReadByte() / 255; axh.colormod_z = ReadByte() / 255; axh.cnt = time; - axh.draw2d = AuxiliaryXhair_Draw2D; + axh.draw2d = AuxiliaryXhair_Draw2D; } void Net_VehicleSetup() { float i; - + float hud_id = ReadByte(); - + // Weapon update? if(hud_id > HUD_VEHICLE_LAST) { weapon2mode = hud_id - HUD_VEHICLE_LAST; return; } - + // hud_id == 0 means we exited a vehicle, so stop alarm sound/s if(hud_id == 0) { sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); - sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); + sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); return; } - + hud_id = bound(HUD_VEHICLE_FIRST, hud_id, HUD_VEHICLE_LAST); // Init auxiliary crosshairs @@ -191,15 +191,15 @@ void Net_VehicleSetup() // Raygun-locked AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga"; AuxiliaryXhair[0].axh_scale = 0.5; - + // Gunner1 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-target.tga"; AuxiliaryXhair[1].axh_scale = 0.75; - + // Gunner2 AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-target.tga"; AuxiliaryXhair[2].axh_scale = 0.75; - break; + break; case HUD_BUMBLEBEE_GUN: // Plasma cannons AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga"; @@ -248,12 +248,12 @@ void CSQC_BUMBLE_HUD() pic2size = draw_getimagesize(bumb_ico) * (autocvar_cl_vehicles_hudscale * 0.8); picloc = picsize * 0.5 - pic2size * 0.5; - + if(vh_health < 0.25) drawpic(hudloc + picloc, bumb_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); else drawpic(hudloc + picloc, bumb_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL); - + drawpic(hudloc + picloc, bumb_lgun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); drawpic(hudloc + picloc, bumb_lgun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL); @@ -274,9 +274,9 @@ void CSQC_BUMBLE_HUD() alarm1time = time + 2; sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE); } - + drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - } + } else { drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); @@ -284,7 +284,7 @@ void CSQC_BUMBLE_HUD() { sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); alarm1time = 0; - } + } } // Shield bar @@ -309,15 +309,15 @@ void CSQC_BUMBLE_HUD() { drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); if(alarm2time) - { + { sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); alarm2time = 0; } } - + ammo1 *= 0.01; ammo2 *= 0.01; - + // Gunner1 bar picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; picloc = '450 69 0' * autocvar_cl_vehicles_hudscale; @@ -328,11 +328,11 @@ void CSQC_BUMBLE_HUD() // Right gunner slot occupied? if(!AuxiliaryXhair[1].draw2d) { - shield = (picsize_x * 0.5) - (0.5 * stringwidth(_("No right gunner!"), FALSE, '1 0 0' * picsize_y + '0 1 0' * picsize_y)); + shield = (picsize_x * 0.5) - (0.5 * stringwidth(_("No right gunner!"), FALSE, '1 0 0' * picsize_y + '0 1 0' * picsize_y)); drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL); drawstring(hudloc + picloc + '1 0 0' * shield, _("No right gunner!"), '1 0 0' * picsize_y + '0 1 0' * picsize_y, '1 0 0' + '0 1 1' * sin(time * 10), 1, DRAWFLAG_NORMAL); } - + // .. and icon picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale; picloc = '664 60 0' * autocvar_cl_vehicles_hudscale; @@ -340,7 +340,7 @@ void CSQC_BUMBLE_HUD() drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); else drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - + // Gunner2 bar picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale; picloc = '450 140 0' * autocvar_cl_vehicles_hudscale; @@ -350,7 +350,7 @@ void CSQC_BUMBLE_HUD() // Left gunner slot occupied? if(!AuxiliaryXhair[2].draw2d) { - shield = (picsize_x * 0.5) - (0.5 * stringwidth(_("No left gunner!"), FALSE, '1 0 0' * picsize_y + '0 1 0' * picsize_y)); + shield = (picsize_x * 0.5) - (0.5 * stringwidth(_("No left gunner!"), FALSE, '1 0 0' * picsize_y + '0 1 0' * picsize_y)); drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL); drawstring(hudloc + picloc + '1 0 0' * shield, _("No left gunner!"), '1 0 0' * picsize_y + '0 1 0' * picsize_y, '1 0 0' + '0 1 1' * sin(time * 10), 1, DRAWFLAG_NORMAL); } @@ -372,7 +372,7 @@ void CSQC_BUMBLE_HUD() picsize_y *= 0.5; drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), waki_xhair, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); } - + } void CSQC_BUMBLE_GUN_HUD() @@ -399,12 +399,12 @@ void CSQC_BUMBLE_GUN_HUD() pic2size = draw_getimagesize(bumb_gun_ico) * (autocvar_cl_vehicles_hudscale * 0.8); picloc = picsize * 0.5 - pic2size * 0.5; - + if(vh_health < 0.25) drawpic(hudloc + picloc, bumb_gun_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); else drawpic(hudloc + picloc, bumb_gun_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL); - + drawpic(hudloc + picloc, bumb_gun_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL); @@ -424,9 +424,9 @@ void CSQC_BUMBLE_GUN_HUD() alarm1time = time + 2; sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE); } - + drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - } + } else { drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); @@ -434,7 +434,7 @@ void CSQC_BUMBLE_GUN_HUD() { sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); alarm1time = 0; - } + } } // Shield bar @@ -459,19 +459,19 @@ void CSQC_BUMBLE_GUN_HUD() { drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); if(alarm2time) - { + { sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); alarm2time = 0; } } - + // Gun bar picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; picloc = '450 69 0' * autocvar_cl_vehicles_hudscale; drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight); drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); drawresetcliparea(); - + // .. and icon picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale; picloc = '664 60 0' * autocvar_cl_vehicles_hudscale; @@ -524,7 +524,7 @@ void CSQC_SPIDER_HUD() if(vh_health < 0.25) drawpic(hudloc + picloc, spider_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); else - drawpic(hudloc + picloc, spider_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL); + drawpic(hudloc + picloc, spider_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL); drawpic(hudloc + picloc, spider_rkt, pic2size, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL); drawpic(hudloc + picloc, spider_mgun, pic2size, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL); drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL); @@ -544,9 +544,9 @@ void CSQC_SPIDER_HUD() { alarm1time = time + 2; sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE); - } + } drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - } + } else { drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); @@ -554,7 +554,7 @@ void CSQC_SPIDER_HUD() { sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); alarm1time = 0; - } + } } // Shield bar picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale; @@ -578,7 +578,7 @@ void CSQC_SPIDER_HUD() { drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); if(alarm2time) - { + { sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); alarm2time = 0; } @@ -710,9 +710,9 @@ void CSQC_RAPTOR_HUD() alarm1time = time + 2; sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE); } - + drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - } + } else { drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); @@ -745,12 +745,12 @@ void CSQC_RAPTOR_HUD() { drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); if(alarm2time) - { + { sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); alarm2time = 0; } } - + // Gun bar picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; picloc = '450 69 0' * autocvar_cl_vehicles_hudscale; @@ -778,7 +778,7 @@ void CSQC_RAPTOR_HUD() drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); else drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL); - + if(weapon2mode == RSM_FLARE) { raptor_xhair = "gfx/vehicles/axh-bracket.tga"; @@ -786,7 +786,7 @@ void CSQC_RAPTOR_HUD() else { raptor_xhair = "gfx/vehicles/axh-ring.tga"; - + // Bombing crosshair if(!dropmark) { @@ -835,7 +835,7 @@ void CSQC_RAPTOR_HUD() } } } - + if (scoreboard_showscores) HUD_DrawScoreboard(); else @@ -902,9 +902,9 @@ void CSQC_WAKIZASHI_HUD() alarm1time = time + 2; sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE); } - + drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - } + } else { drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); @@ -912,9 +912,9 @@ void CSQC_WAKIZASHI_HUD() { sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); alarm1time = 0; - } + } } - + // Shield bar picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale; @@ -938,12 +938,12 @@ void CSQC_WAKIZASHI_HUD() { drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); if(alarm2time) - { + { sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); alarm2time = 0; } } - + // Gun bar picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; picloc = '450 69 0' * autocvar_cl_vehicles_hudscale; @@ -992,7 +992,7 @@ void Vehicles_Precache() precache_model("models/vehicles/clusterbomb_fragment.md3"); precache_model("models/vehicles/rocket01.md3"); precache_model("models/vehicles/rocket02.md3"); - + precache_sound ("vehicles/alarm.wav"); precache_sound ("vehicles/alarm_shield.wav"); } @@ -1000,12 +1000,12 @@ void Vehicles_Precache() void RaptorCBShellfragDraw() { if(wasfreed(self)) - return; - + return; + Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy); self.move_avelocity += randomvec() * 15; self.renderflags = 0; - + if(self.cnt < time) self.alpha = bound(0, self.nextthink - time, 1); @@ -1016,7 +1016,7 @@ void RaptorCBShellfragDraw() void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang) { entity sfrag; - + sfrag = spawn(); setmodel(sfrag, "models/vehicles/clusterbomb_fragment.md3"); setorigin(sfrag, _org); diff --git a/qcsrc/client/waypointsprites.qc b/qcsrc/client/waypointsprites.qc index a2ace4f46..a3e856d14 100644 --- a/qcsrc/client/waypointsprites.qc +++ b/qcsrc/client/waypointsprites.qc @@ -96,7 +96,7 @@ void drawhealthbar(vector org, float rot, float h, vector sz, vector hotspot, fl o = hotspot; ri = '1 0 0'; up = '0 1 0'; - + rot = -rot; // rotate by the opposite angle, as our coordinate system is reversed o = rotate(o, rot) + org; ri = rotate(ri, rot); @@ -439,10 +439,10 @@ void Draw_WaypointSprite() return; ++waypointsprite_newcount; - + float dist; dist = vlen(self.origin - view_origin); - + float a; a = self.alpha * autocvar_hud_panel_fg_alpha; @@ -457,7 +457,7 @@ void Draw_WaypointSprite() if(rgb == '0 0 0') { self.teamradar_color = '1 0 1'; - print(sprintf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage)); + print(sprintf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage)); } if(time - floor(time) > 0.5) @@ -483,10 +483,10 @@ void Draw_WaypointSprite() float ang; o = project_3d_to_2d(self.origin); - if(o_z < 0 - || o_x < (vid_conwidth * waypointsprite_edgeoffset_left) - || o_y < (vid_conheight * waypointsprite_edgeoffset_top) - || o_x > (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) + if(o_z < 0 + || o_x < (vid_conwidth * waypointsprite_edgeoffset_left) + || o_y < (vid_conheight * waypointsprite_edgeoffset_top) + || o_x > (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) || o_y > (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom))) { // scale it to be just in view @@ -543,9 +543,9 @@ void Draw_WaypointSprite() o_z = 0; float edgedistance_min, crosshairdistance; - edgedistance_min = min((o_y - (vid_conheight * waypointsprite_edgeoffset_top)), + edgedistance_min = min((o_y - (vid_conheight * waypointsprite_edgeoffset_top)), (o_x - (vid_conwidth * waypointsprite_edgeoffset_left)), - (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o_x, + (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o_x, (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)) - o_y); float vidscale; @@ -585,7 +585,7 @@ void Draw_WaypointSprite() } o = drawspritearrow(o, ang, rgb, a, SPRITE_ARROW_SCALE * t); - + string txt; if(autocvar_g_waypointsprite_spam && waypointsprite_count >= autocvar_g_waypointsprite_spam) txt = _("Spam"); diff --git a/qcsrc/common/campaign_file.qc b/qcsrc/common/campaign_file.qc index 5ab3da67c..d9864f4da 100644 --- a/qcsrc/common/campaign_file.qc +++ b/qcsrc/common/campaign_file.qc @@ -63,7 +63,7 @@ float CampaignFile_Load(float offset, float n) campaign_entries = campaign_entries + 1; - if(campaign_entries >= n) + if(campaign_entries >= n) break; } lineno = lineno + 1; diff --git a/qcsrc/common/command/generic.qc b/qcsrc/common/command/generic.qc index d119bd25b..5e8accbd2 100644 --- a/qcsrc/common/command/generic.qc +++ b/qcsrc/common/command/generic.qc @@ -57,12 +57,12 @@ void GenericCommand_addtolist(float request, float argc) case CMD_REQUEST_COMMAND: { float i; - + if(argc >= 2) { string original_cvar = argv(1); string tmp_string = argv(2); - + if(cvar_string(original_cvar) == "") // cvar was empty { cvar_set(original_cvar, tmp_string); @@ -70,17 +70,17 @@ void GenericCommand_addtolist(float request, float argc) else // add it to the end of the list if the list doesn't already have it { argc = tokenizebyseparator(cvar_string(original_cvar), " "); - + for(i = 0; i < argc; ++i) if(argv(i) == tmp_string) return; // already in list - + cvar_set(original_cvar, strcat(tmp_string, " ", cvar_string(original_cvar))); } return; } } - + default: print("Incorrect parameters for ^2addtolist^7\n"); case CMD_REQUEST_USAGE: @@ -162,7 +162,7 @@ void GenericCommand_qc_curl(float request, float argc) return; } - + default: case CMD_REQUEST_USAGE: { @@ -181,33 +181,33 @@ void GenericCommand_dumpcommands(float request) float fh; string filename = strcat(GetProgramCommandPrefix(), "_dump.txt"); fh = fopen(filename, FILE_WRITE); - + if(fh >= 0) { #ifdef SVQC CMD_Write("dump of server console commands:\n"); GameCommand_macro_write_aliases(fh); - + CMD_Write("\ndump of networked client only commands:\n"); ClientCommand_macro_write_aliases(fh); - + CMD_Write("\ndump of common commands:\n"); CommonCommand_macro_write_aliases(fh); CMD_Write("\ndump of ban commands:\n"); BanCommand_macro_write_aliases(fh); #endif - + #ifdef CSQC CMD_Write("dump of client commands:\n"); LocalCommand_macro_write_aliases(fh); #endif - + CMD_Write("\ndump of generic commands:\n"); GenericCommand_macro_write_aliases(fh); - + print("Completed dump of aliases in ^2data/data/", GetProgramCommandPrefix(), "_dump.txt^7.\n"); - + fclose(fh); } else @@ -216,7 +216,7 @@ void GenericCommand_dumpcommands(float request) } return; } - + default: case CMD_REQUEST_USAGE: { @@ -236,7 +236,7 @@ void GenericCommand_dumpnotifs(float request) #ifndef MENUQC float fh, alsoprint = FALSE; string filename = argv(1); - + if(filename == "") { filename = "notifications.cfg"; @@ -248,7 +248,7 @@ void GenericCommand_dumpnotifs(float request) alsoprint = TRUE; } fh = fopen(filename, FILE_WRITE); - + if(fh >= 0) { Dump_Notifications(fh, alsoprint); @@ -264,7 +264,7 @@ void GenericCommand_dumpnotifs(float request) #endif return; } - + default: case CMD_REQUEST_USAGE: { @@ -285,7 +285,7 @@ void GenericCommand_maplist(float request, float argc) { string tmp_string; float i; - + switch(argv(1)) { case "add": // appends new maps to the maplist @@ -297,63 +297,63 @@ void GenericCommand_maplist(float request, float argc) print("maplist: ERROR: ", argv(2), " does not exist!\n"); break; } - + if(cvar_string("g_maplist") == "") cvar_set("g_maplist", argv(2)); else cvar_set("g_maplist", strcat(argv(2), " ", cvar_string("g_maplist"))); - + return; } break; // go to usage } - + case "cleanup": // scans maplist and only adds back the ones which are really usable { MapInfo_Enumerate(); MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0); argc = tokenizebyseparator(cvar_string("g_maplist"), " "); - + tmp_string = ""; for(i = 0; i < argc; ++i) if(MapInfo_CheckMap(argv(i))) tmp_string = strcat(tmp_string, " ", argv(i)); - + tmp_string = substring(tmp_string, 1, strlen(tmp_string) - 1); cvar_set("g_maplist", tmp_string); - + return; } - + case "remove": // scans maplist and only adds back whatever maps were not provided in argv(2) { if(argc == 3) { argc = tokenizebyseparator(cvar_string("g_maplist"), " "); - + tmp_string = ""; for(i = 0; i < argc; ++i) if(argv(i) != argv(2)) tmp_string = strcat(tmp_string, " ", argv(i)); - + tmp_string = substring(tmp_string, 1, strlen(tmp_string) - 1); cvar_set("g_maplist", tmp_string); - + return; } break; // go to usage } - + case "shuffle": // randomly shuffle the maplist { cvar_set("g_maplist", shufflewords(cvar_string("g_maplist"))); return; } - + default: break; } } - + default: print("Incorrect parameters for ^2maplist^7\n"); case CMD_REQUEST_USAGE: @@ -376,7 +376,7 @@ void GenericCommand_nextframe(float request, float arguments, string command) queue_to_execute_next_frame(substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1))); return; } - + default: case CMD_REQUEST_USAGE: { @@ -399,21 +399,21 @@ void GenericCommand_removefromlist(float request, float argc) string original_cvar = argv(1); string removal = argv(2); string tmp_string; - + argc = tokenizebyseparator(cvar_string(original_cvar), " "); - + tmp_string = ""; for(i = 0; i < argc; ++i) if(argv(i) != removal) tmp_string = strcat(tmp_string, " ", argv(i)); - + tmp_string = substring(tmp_string, 1, strlen(tmp_string) - 1); cvar_set(original_cvar, tmp_string); - + return; } } - + default: print("Incorrect parameters for ^2removefromlist^7\n"); case CMD_REQUEST_USAGE: @@ -450,7 +450,7 @@ void GenericCommand_restartnotifs(float request) NOTIF_CENTER_COUNT, NOTIF_MULTI_COUNT, NOTIF_CHOICE_COUNT - )); + )); Destroy_All_Notifications(); CALL_ACCUMULATED_FUNCTION(RegisterNotifications); #else @@ -458,7 +458,7 @@ void GenericCommand_restartnotifs(float request) #endif return; } - + default: case CMD_REQUEST_USAGE: { @@ -479,7 +479,7 @@ void GenericCommand_settemp(float request, float argc) { float f = cvar_settemp(argv(1), argv(2)); if(f == 1) - dprint("Creating new settemp tracker for ", argv(1), " and setting it to \"", argv(2), "\" temporarily.\n"); + dprint("Creating new settemp tracker for ", argv(1), " and setting it to \"", argv(2), "\" temporarily.\n"); else if(f == -1) dprint("Already had a tracker for ", argv(1), ", updating it to \"", argv(2), "\".\n"); // else cvar_settemp itself errors out @@ -507,15 +507,15 @@ void GenericCommand_settemp_restore(float request, float argc) case CMD_REQUEST_COMMAND: { float i = cvar_settemp_restore(); - + if(i) dprint("Restored ", ftos(i), " temporary cvar settings to their original values.\n"); else dprint("Nothing to restore.\n"); - + return; } - + default: case CMD_REQUEST_USAGE: { @@ -543,7 +543,7 @@ void GenericCommand_runtest(float request, float argc) TEST_RunAll(); return; } - + default: case CMD_REQUEST_USAGE: { @@ -561,10 +561,10 @@ void GenericCommand_(float request) { case CMD_REQUEST_COMMAND: { - + return; } - + default: case CMD_REQUEST_USAGE: { @@ -600,10 +600,10 @@ void GenericCommand_macro_help() { #define GENERIC_COMMAND(name,function,description) \ { print(" ^2", name, "^7: ", description, "\n"); } - + GENERIC_COMMANDS(0, 0, "") #undef GENERIC_COMMAND - + return; } @@ -611,10 +611,10 @@ float GenericCommand_macro_command(float argc, string command) { #define GENERIC_COMMAND(name,function,description) \ { if(name == strtolower(argv(0))) { function; return TRUE; } } - + GENERIC_COMMANDS(CMD_REQUEST_COMMAND, argc, command) #undef GENERIC_COMMAND - + return FALSE; } @@ -622,10 +622,10 @@ float GenericCommand_macro_usage(float argc) { #define GENERIC_COMMAND(name,function,description) \ { if(name == strtolower(argv(1))) { function; return TRUE; } } - + GENERIC_COMMANDS(CMD_REQUEST_USAGE, argc, "") #undef GENERIC_COMMAND - + return FALSE; } @@ -633,18 +633,18 @@ void GenericCommand_macro_write_aliases(float fh) { #define GENERIC_COMMAND(name,function,description) \ { CMD_Write_Alias("qc_cmd_svmenu", name, description); } - + GENERIC_COMMANDS(0, 0, "") #undef GENERIC_COMMAND - + return; } - + // =========================================== // Main Common Function For Generic Commands // =========================================== -// Commands spread out among all programs (menu, client, and server) +// Commands spread out among all programs (menu, client, and server) float GenericCommand(string command) { @@ -655,9 +655,9 @@ float GenericCommand(string command) // Guide for working with argc arguments by example: // argc: 1 - 2 - 3 - 4 - // argv: 0 - 1 - 2 - 3 + // argv: 0 - 1 - 2 - 3 // cmd vote - master - login - password - + if(GenericCommand_macro_command(argc, command)) // continue as usual and scan for normal commands { return TRUE; // handled by one of the above GenericCommand_* functions @@ -713,7 +713,7 @@ float GenericCommand(string command) // test case for terencehill's color codes s = strdecolorize(substring(command, argv_start_index(2), argv_end_index(-1) - argv_start_index(2))); s2 = ""; - + n = strlen(s); j = ((6 * max(1, floor(strlen(s)/32 + random() * 2 - 1))) / n) * (1 - 2 * (random() > 0.5)); f = random() * 6; diff --git a/qcsrc/common/command/generic.qh b/qcsrc/common/command/generic.qh index 7ee3d5064..a61986a8f 100644 --- a/qcsrc/common/command/generic.qh +++ b/qcsrc/common/command/generic.qh @@ -4,12 +4,12 @@ // ========================================================= // Used by other game command systems for common commands, -// and it returns true if handled, false if not. +// and it returns true if handled, false if not. // Note: It tokenizes its input, so be careful! float GenericCommand(string command); // Returns command prefix specific for whatever program it is compiled in -string GetProgramCommandPrefix(void); +string GetProgramCommandPrefix(void); // used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file #define CMD_Write(s) fputs(fh, s) diff --git a/qcsrc/common/command/rpn.qc b/qcsrc/common/command/rpn.qc index 374d07df1..223d3264d 100644 --- a/qcsrc/common/command/rpn.qc +++ b/qcsrc/common/command/rpn.qc @@ -3,7 +3,7 @@ // Last updated: December 28th, 2011 // ======================================== -string rpn_pop() +string rpn_pop() { if(rpn_sp > 0) { --rpn_sp; @@ -14,7 +14,7 @@ string rpn_pop() return ""; } } -void rpn_push(string s) +void rpn_push(string s) { if(rpn_sp < MAX_RPN_STACK) { rpn_stack[rpn_sp] = s; @@ -24,7 +24,7 @@ void rpn_push(string s) rpn_error = TRUE; } } -string rpn_get() +string rpn_get() { if(rpn_sp > 0) { return rpn_stack[rpn_sp - 1]; @@ -34,7 +34,7 @@ string rpn_get() return ""; } } -void rpn_set(string s) +void rpn_set(string s) { if(rpn_sp > 0) { rpn_stack[rpn_sp - 1] = s; @@ -58,14 +58,14 @@ void GenericCommand_rpn(float request, float argc, string command) float i, j, f, f2, f3, rpnpos; //vector rgb; string s, s2, rpncmd; - + if(!rpn_db) { rpn_db = db_create(); db_put(rpn_db, "stack.pointer", "0"); db_put(rpn_db, "stack.pos", "-1"); } - + if(argc >= 2) { rpn_sp = 0; @@ -287,7 +287,7 @@ void GenericCommand_rpn(float request, float argc, string command) print("rpn: database underflow\n"); } } else if(rpncmd == "dbget") { - + i = stof(db_get(rpn_db, "stack.pointer")); if(i) { @@ -321,13 +321,13 @@ void GenericCommand_rpn(float request, float argc, string command) { j = stof(db_get(rpn_db, "stack.pointer")); i = stof(db_get(rpn_db, "stack.pos")); - + if(i < 0) { i = 0; db_put(rpn_db, "stack.pos", "0"); } - + db_put(rpn_db, "stack.pointer", ftos(j+1)); for(--j; j >= i; --j) { @@ -404,7 +404,7 @@ void GenericCommand_rpn(float request, float argc, string command) i = 0; else i = stof(s); - + j = stof(db_get(rpn_db, "stack.pointer")); if(i < 0 || i >= j) { @@ -426,7 +426,7 @@ void GenericCommand_rpn(float request, float argc, string command) // tokens f..f2 represent s2 // UNION: add all tokens to s that are in s2 but not in s s = ""; - for(i = 0; i < f; ++i) + for(i = 0; i < f; ++i) s = strcat(s, " ", argv(i)); for(i = f; i < f2; ++i) { for(j = 0; j < f; ++j) @@ -555,7 +555,7 @@ void GenericCommand_rpn(float request, float argc, string command) return; } - + default: case CMD_REQUEST_USAGE: { diff --git a/qcsrc/common/counting.qh b/qcsrc/common/counting.qh index a74f74e98..2559bf3ac 100644 --- a/qcsrc/common/counting.qh +++ b/qcsrc/common/counting.qh @@ -50,7 +50,7 @@ ZCTX(_("CI_SEC^%d seconds")), /* second */ \ ZCTX(_("CI_THI^%d seconds")), /* third */ \ ZCTX(_("CI_MUL^%d seconds"))) /* multi */ - + string count_ordinal(float interval) { // This function is designed primarily for the English language, it's impossible @@ -72,7 +72,7 @@ string count_ordinal(float interval) } } else { return sprintf(_("%dth"), interval); } - + return ""; } @@ -88,7 +88,7 @@ string count_fill(float interval, string zeroth, string first, string second, st // 1 second // 2 seconds // 3 seconds - // etc... minutes, hours, days, etc. + // etc... minutes, hours, days, etc. switch(floor(interval)) { @@ -111,28 +111,28 @@ string process_time(float outputtype, float seconds) { float tmp_hours = 0, tmp_minutes = 0, tmp_seconds = 0; float tmp_years = 0, tmp_weeks = 0, tmp_days = 0; - + tmp_seconds = floor(seconds); if(tmp_seconds) { tmp_minutes = floor(tmp_seconds / 60); - + if(tmp_minutes) { tmp_seconds -= (tmp_minutes * 60); tmp_hours = floor(tmp_minutes / 60); - + if(tmp_hours) { tmp_minutes -= (tmp_hours * 60); tmp_days = floor(tmp_hours / 24); - + if(tmp_days) { tmp_hours -= (tmp_days * 24); tmp_weeks = floor(tmp_days / 7); - + if(tmp_weeks) { tmp_days -= (tmp_weeks * 7); diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index 78c3b750d..322c7ba51 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -84,7 +84,7 @@ float MapInfo_Cache_Retrieve(string map) // GLOB HANDLING (for all BSP files) float _MapInfo_globopen; -float _MapInfo_globcount; +float _MapInfo_globcount; float _MapInfo_globhandle; string _MapInfo_GlobItem(float i) { @@ -164,7 +164,7 @@ float MapInfo_FilterGametype(float pGametype, float pFeatures, float pFlagsRequi } MapInfo_count = j + 1; MapInfo_ClearTemps(); - + // sometimes the glob isn't sorted nicely, so fix it here... heapsort(MapInfo_count, _MapInfo_FilterList_swap, _MapInfo_FilterList_cmp, world); @@ -442,7 +442,7 @@ void _MapInfo_Map_ApplyGametype(string s, float pWantedType, float pThisType, fl if(load_default) _MapInfo_Map_ApplyGametype(_MapInfo_GetDefault(pThisType), pWantedType, pThisType, FALSE); - + if(pWantedType == MAPINFO_TYPE_ASSAULT || pWantedType == MAPINFO_TYPE_ONSLAUGHT || pWantedType == MAPINFO_TYPE_RACE || pWantedType == MAPINFO_TYPE_CTS) // these modes don't use fraglimit { cvar_set("fraglimit", "0"); @@ -509,7 +509,7 @@ void _MapInfo_Map_ApplyGametype(string s, float pWantedType, float pThisType, fl s = cdr(s); } */ - + // rc = timelimit timelimit_qualification laps laps_teamplay if(pWantedType == MAPINFO_TYPE_RACE) { @@ -694,7 +694,7 @@ float MapInfo_Type_FromString(string t) string MapInfo_Type_ToString(float t) { entity e; - if(t == MAPINFO_TYPE_ALL) + if(t == MAPINFO_TYPE_ALL) return "all"; for(e = MapInfo_Type_first; e; e = e.enemy) if(t == e.items) @@ -735,12 +735,12 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s, o = strstrofs(s, "\"", 0); if(o >= 0) s = substring(s, 0, o); - + // remove // comments o = strstrofs(s, "//", 0); if(o >= 0) s = substring(s, 0, o); - + // remove trailing spaces while(substring(s, -1, 1) == " ") s = substring(s, 0, -2); @@ -1251,7 +1251,7 @@ void MapInfo_LoadMap(string s, float reinit) // print("EMERGENCY: can't play the selected map in the given game mode. Falling back to DM.\n"); // MapInfo_SwitchGameType(MAPINFO_TYPE_DEATHMATCH); //} - + cvar_settemp_restore(); if(reinit) localcmd(strcat("\nmap ", s, "\n")); diff --git a/qcsrc/common/net_notice.qc b/qcsrc/common/net_notice.qc index 625e091dc..caaae8b49 100644 --- a/qcsrc/common/net_notice.qc +++ b/qcsrc/common/net_notice.qc @@ -5,10 +5,10 @@ void sv_notice_join_think() float argc = tokenizebyseparator(autocvar_sv_join_notices, "|"); if(argc > 0) { - float i; - for(i = argc - 1; i >= 0; --i) + float i; + for(i = argc - 1; i >= 0; --i) sv_notice_to(self.owner, argv(i), autocvar_sv_join_notices_time, FALSE); - } + } remove(self); } @@ -21,7 +21,7 @@ void sv_notice_join() entity n = spawn(); n.owner = self; n.think = sv_notice_join_think; - n.nextthink = time + 1; + n.nextthink = time + 1; } void sv_notice_to(entity _to, string _notice, float _howlong, float _modal) @@ -39,7 +39,7 @@ void sv_notice_toall(string _notice, float _howlong, float _modal) entity _head; FOR_EACH_REALCLIENT(_head) sv_notice_to(_head, _notice, _howlong, _modal); - + } #endif // SVQC @@ -65,52 +65,52 @@ float cl_notice_run() entity _notes; string _notice; float m = FALSE; - + _notes = findchain(classname, "sv_notice"); if(!_notes) return FALSE; #define M1 30 #define M2 10 - + vector v1, v2 = '0 0 0', v3; v1 = '1 1 0' * M1; v2_x = vid_conwidth - (2 * M1); v2_y = vid_conheight - (2 * M1); - + drawfill(v1, v2, '0 0 0', 0.5, DRAWFLAG_NORMAL); v1 = '1 1 0' * (M1 + M2); v2_x = vid_conwidth - (2 * (M1 + M2)); v2_y = vid_conheight - (2 * (M1 + M2)); drawfill(v1, v2, '0.5 0.5 0.5', 0.5, DRAWFLAG_NORMAL); v3 = v1 + '10 10 0'; - + #define OUT(s,z) drawcolorcodedstring(v3, s, '1 1 0' * z, 1, DRAWFLAG_NORMAL); v3_y += z + 4 - + OUT(_("^1Server notices:"), 32); - + //drawcolorcodedstring(v1 + '5 5 0', "^1Server notices:", '32 32 0', 1, DRAWFLAG_NORMAL); while(_notes) { - + _notice = sprintf(_("^7%s (^3%d sec left)"), _notes.netname , rint(_notes.alpha - time)); OUT(_notice, 16); - if(_notes.skin) + if(_notes.skin) m = TRUE; - + if(_notes.alpha <= time) { _notes.think = SUB_Remove; _notes.nextthink = time; } - - _notes = _notes.chain; + + _notes = _notes.chain; } - + #undef OUT #undef M1 #undef M2 - + return m; } diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index 8c675fb12..8c297513e 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -88,21 +88,21 @@ string Notification_CheckArgs( { checkargs = sprintf("%sNo client provided!", checkargs); } break; } - + case NOTIF_ALL_EXCEPT: { if(IS_NOT_A_CLIENT(client)) { checkargs = sprintf("%sException can't be a non-client!", checkargs); } break; } - + case NOTIF_ALL: { if(client) { checkargs = sprintf("%sEntity provided when world was required!", checkargs); } break; } - + case NOTIF_TEAM: { if (!teamplay) @@ -110,7 +110,7 @@ string Notification_CheckArgs( //else if (!client.team) { checkargs = sprintf("%sNo team provided!", checkargs); } break; } - + case NOTIF_TEAM_EXCEPT: { if (!teamplay) @@ -119,7 +119,7 @@ string Notification_CheckArgs( { checkargs = sprintf("%sException can't be a non-client!", checkargs); } break; } - + default: { checkargs = sprintf("%sImproper broadcast: %d!", checkargs, broadcast); break; } } return checkargs; @@ -225,7 +225,7 @@ void Destroy_All_Notifications(void) { entity notif; float i; - + #define DESTROY_LOOP(type,count) \ for(i = 1; i <= count; ++i) \ { \ @@ -414,7 +414,7 @@ string Process_Notif_Args( } break; } - case 3: // durcnt + case 3: // durcnt { if(sel_num == NOTIF_MAX_DURCNT) { @@ -483,7 +483,7 @@ void Create_Notification_Entity( float strnum, float flnum, /* MSG_ANNCE */ - float channel, + float channel, string snd, float vol, float position, @@ -561,7 +561,7 @@ void Create_Notification_Entity( notif.nent_type = typeid; notif.nent_id = nameid; notif.nent_name = strzone(namestring); - + string typestring = Get_Notif_TypeName(typeid); // Other pre-notif-setup requisites @@ -609,7 +609,7 @@ void Create_Notification_Entity( break; } - + case MSG_INFO: case MSG_CENTER: { @@ -668,7 +668,7 @@ void Create_Notification_Entity( { notif.nent_hudargs = strzone( Process_Notif_Args(2, hudargs, typestring, namestring)); - + if(icon != "") { notif.nent_icon = strzone(icon); } else { @@ -700,7 +700,7 @@ void Create_Notification_Entity( { notif.nent_durcnt = strzone( Process_Notif_Args(3, durcnt, typestring, namestring)); - + if(cpid != NO_MSG) { notif.nent_cpid = cpid; } else { @@ -714,7 +714,7 @@ void Create_Notification_Entity( )); notif_error = TRUE; } - } + } else if(cpid != NO_MSG) { notif.nent_cpid = cpid; } #endif @@ -740,7 +740,7 @@ void Create_Notification_Entity( else if(normal != "") { SET_NOTIF_STRING(normal, "NORMAL") } } else if(normal != "") { SET_NOTIF_STRING(normal, "NORMAL") } - + #undef SET_NOTIF_STRING // Check to make sure a string was chosen @@ -780,29 +780,29 @@ void Create_Notification_Entity( { // announcements don't actually need any arguments, so lets not even count them. if(anncename != NO_MSG) { notif.nent_msgannce = msg_annce_notifs[anncename - 1]; } - + float infoname_stringcount = 0, infoname_floatcount = 0; float centername_stringcount = 0, centername_floatcount = 0; - + if(infoname != NO_MSG) { notif.nent_msginfo = msg_info_notifs[infoname - 1]; infoname_stringcount = notif.nent_msginfo.nent_stringcount; infoname_floatcount = notif.nent_msginfo.nent_floatcount; } - + if(centername != NO_MSG) { notif.nent_msgcenter = msg_center_notifs[centername - 1]; centername_stringcount = notif.nent_msgcenter.nent_stringcount; centername_floatcount = notif.nent_msgcenter.nent_floatcount; } - + // set the requirements of THIS notification to the totals of its subcalls notif.nent_stringcount = max(infoname_stringcount, centername_stringcount); notif.nent_floatcount = max(infoname_floatcount, centername_floatcount); } - + break; } @@ -848,7 +848,7 @@ void Create_Notification_Entity( notif.nent_optionb = msg_multi_notifs[optionb - 1]; break; } - case MSG_CHOICE: // should we REALLY allow nested options?... + case MSG_CHOICE: // should we REALLY allow nested options?... { notif.nent_optiona = msg_choice_notifs[optiona - 1]; notif.nent_optionb = msg_choice_notifs[optionb - 1]; @@ -873,7 +873,7 @@ void Create_Notification_Entity( notif.nent_challow_var = challow_var; // 0: never allowed, 1: allowed in warmup, 2: always allowed notif.nent_stringcount = max(notif.nent_optiona.nent_stringcount, notif.nent_optionb.nent_stringcount); notif.nent_floatcount = max(notif.nent_optiona.nent_floatcount, notif.nent_optionb.nent_floatcount); - + /*#ifdef NOTIFICATIONS_DEBUG Debug_Notification(sprintf( "Create_Notification_Entity(...): MSG_CHOICE: %s\n%s\n%s\n", @@ -897,7 +897,7 @@ void Create_Notification_Entity( } break; } - + default: { print(sprintf( @@ -913,7 +913,7 @@ void Create_Notification_Entity( } } - // now check to see if any errors happened + // now check to see if any errors happened if(notif_error) { notif.nent_enabled = FALSE; // disable the notification so it can't cause trouble @@ -1005,7 +1005,7 @@ void Dump_Notifications(float fh, float alsoprint) { e = Get_Notif_Ent(MSG_ANNCE, i); if (!e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; } - + NOTIF_WRITE_ENTITY( "Notification control cvar: 0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled)" ); @@ -1016,7 +1016,7 @@ void Dump_Notifications(float fh, float alsoprint) { e = Get_Notif_Ent(MSG_INFO, i); if (!e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; } - + NOTIF_WRITE_ENTITY( "Notification control cvar: 0 = off, 1 = print to console, " "2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" @@ -1028,7 +1028,7 @@ void Dump_Notifications(float fh, float alsoprint) { e = Get_Notif_Ent(MSG_CENTER, i); if (!e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; } - + NOTIF_WRITE_ENTITY( "Notification control cvar: 0 = off, 1 = centerprint" ); @@ -1039,7 +1039,7 @@ void Dump_Notifications(float fh, float alsoprint) { e = Get_Notif_Ent(MSG_MULTI, i); if (!e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; } - + NOTIF_WRITE_ENTITY( "Notification control cvar: 0 = off, 1 = trigger subcalls" ); @@ -1050,7 +1050,7 @@ void Dump_Notifications(float fh, float alsoprint) { e = Get_Notif_Ent(MSG_CHOICE, i); if (!e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; } - + NOTIF_WRITE_ENTITY_CHOICE( "Notification control cvar: 0 = off, 1 = trigger option A subcall, 2 = trigger option B subcall", "Notification control cvar: 0 = off, 1 = allowed in warmup mode, 2 = always allowed" @@ -1059,84 +1059,84 @@ void Dump_Notifications(float fh, float alsoprint) // edit these to match whichever cvars are used for specific notification options NOTIF_WRITE("\n// HARD CODED notification variables:\n"); - + NOTIF_WRITE_HARDCODED( "allow_chatboxprint", "1", "Allow notifications to be printed to chat box by setting notification cvar to 2 " "(You can also set this cvar to 2 to force ALL notifications to be printed to the chatbox)" ); - + NOTIF_WRITE_HARDCODED( "debug", "0", "Print extra debug information on all notification function calls " "(Requires -DNOTIFICATIONS_DEBUG flag to be enabled on QCSRC compilation)... " "0 = disabled, 1 = dprint, 2 = print" ); - + NOTIF_WRITE_HARDCODED( "errors_are_fatal", "1", "If a notification fails upon initialization, cause a Host_Error to stop the program" ); - + NOTIF_WRITE_HARDCODED( "item_centerprinttime", "1.5", "How long to show item information centerprint messages (like 'You got the Electro' or such)" ); - + NOTIF_WRITE_HARDCODED( "lifetime_mapload", "10", "Amount of time that notification entities last immediately at mapload (in seconds) " "to help prevent notifications from being lost on early init (like gamestart countdown)" ); - + NOTIF_WRITE_HARDCODED( "lifetime_runtime", "0.5", "Amount of time that notification entities last on the server during runtime (In seconds)" ); - + NOTIF_WRITE_HARDCODED( "server_allows_location", "1", "Server side cvar for allowing death messages to show location information too" ); - + NOTIF_WRITE_HARDCODED( "show_location", "0", "Append location information to MSG_INFO death/kill messages" ); - + NOTIF_WRITE_HARDCODED( "show_location_string", "", "Replacement string piped into sprintf, " "so you can do different messages like this: ' at the %s' or ' (near %s)'" ); - + NOTIF_WRITE_HARDCODED( "show_sprees", "1", "Print information about sprees in death/kill messages" ); - + NOTIF_WRITE_HARDCODED( "show_sprees_center", "1", "Show spree information in MSG_CENTER messages... " "0 = off, 1 = target (but only for first victim) and attacker" ); - + NOTIF_WRITE_HARDCODED( "show_sprees_center_specialonly", "1", "Don't show spree information in MSG_CENTER messages if it isn't an achievement" ); - + NOTIF_WRITE_HARDCODED( "show_sprees_info", "3", "Show spree information in MSG_INFO messages... " "0 = off, 1 = target only, 2 = attacker only, 3 = target and attacker" ); - + NOTIF_WRITE_HARDCODED( "show_sprees_info_newline", "1", "Show attacker spree information for MSG_INFO messages on a separate line than the death notification itself" ); - + NOTIF_WRITE_HARDCODED( "show_sprees_info_specialonly", "1", "Don't show attacker spree information in MSG_INFO messages if it isn't an achievement" @@ -1160,7 +1160,7 @@ void Dump_Notifications(float fh, float alsoprint) NOTIF_MULTI_COUNT, NOTIF_CHOICE_COUNT )); - + return; #undef NOTIF_WRITE_HARDCODED #undef NOTIF_WRITE_ENTITY @@ -1184,7 +1184,7 @@ void Debug_Notification(string input) #endif string Local_Notification_sprintf( - string input, string args, + string input, string args, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4) { @@ -1197,7 +1197,7 @@ string Local_Notification_sprintf( sprintf("%d, %d, %d, %d", f1, f2, f3, f4) )); #endif - + string selected; float sel_num; for(sel_num = 0; sel_num < NOTIF_MAX_ARGS; ++sel_num) { arg_slot[sel_num] = ""; } @@ -1269,7 +1269,7 @@ void Local_Notification_sound( soundposition )); #endif - + sound( world, soundchannel, @@ -1281,7 +1281,7 @@ void Local_Notification_sound( soundvolume, soundposition ); - + if(prev_soundfile) { strunzone(prev_soundfile); } prev_soundfile = strzone(soundfile); prev_soundtime = time; @@ -1419,7 +1419,7 @@ void Local_Notification(float net_type, float net_name, ...count) #endif return; } - + // check supplied type and name for errors string checkargs = Notification_CheckArgs_TypeName(net_type, net_name); if(checkargs != "") @@ -1481,13 +1481,13 @@ void Local_Notification(float net_type, float net_name, ...count) sprintf("%d, %d, %d, %d", f1, f2, f3, f4) )); #endif - + if((notif.nent_stringcount + notif.nent_floatcount) > count) { backtrace(sprintf( strcat( "Not enough arguments for Local_Notification(%s, %s, ...)! ", - "stringcount(%d) + floatcount(%d) > count(%d)\n", + "stringcount(%d) + floatcount(%d) > count(%d)\n", "Check the definition and function call for accuracy...?\n" ), Get_Notif_TypeName(net_type), @@ -1514,7 +1514,7 @@ void Local_Notification(float net_type, float net_name, ...count) )); return; } - + switch(net_type) { case MSG_ANNCE: @@ -1531,35 +1531,35 @@ void Local_Notification(float net_type, float net_name, ...count) #endif break; } - + case MSG_INFO: { print( Local_Notification_sprintf( notif.nent_string, - notif.nent_args, + notif.nent_args, s1, s2, s3, s4, f1, f2, f3, f4) ); - #ifdef CSQC + #ifdef CSQC if(notif.nent_icon != "") { Local_Notification_HUD_Notify_Push( notif.nent_icon, notif.nent_hudargs, s1, s2, s3, s4); - } - #endif + } + #endif break; } - + #ifdef CSQC case MSG_CENTER: { Local_Notification_centerprint_generic( Local_Notification_sprintf( notif.nent_string, - notif.nent_args, + notif.nent_args, s1, s2, s3, s4, f1, f2, f3, f4), notif.nent_durcnt, @@ -1568,7 +1568,7 @@ void Local_Notification(float net_type, float net_name, ...count) break; } #endif - + case MSG_MULTI: { if(notif.nent_msginfo) @@ -1576,9 +1576,9 @@ void Local_Notification(float net_type, float net_name, ...count) { Local_Notification_WOVA( MSG_INFO, - notif.nent_msginfo.nent_id, - notif.nent_msginfo.nent_stringcount, - notif.nent_msginfo.nent_floatcount, + notif.nent_msginfo.nent_id, + notif.nent_msginfo.nent_stringcount, + notif.nent_msginfo.nent_floatcount, s1, s2, s3, s4, f1, f2, f3, f4); } @@ -1588,8 +1588,8 @@ void Local_Notification(float net_type, float net_name, ...count) { Local_Notification_WOVA( MSG_ANNCE, - notif.nent_msgannce.nent_id, - 0, 0, + notif.nent_msgannce.nent_id, + 0, 0, "", "", "", "", 0, 0, 0, 0); } @@ -1598,11 +1598,11 @@ void Local_Notification(float net_type, float net_name, ...count) { Local_Notification_WOVA( MSG_CENTER, - notif.nent_msgcenter.nent_id, - notif.nent_msgcenter.nent_stringcount, - notif.nent_msgcenter.nent_floatcount, + notif.nent_msgcenter.nent_id, + notif.nent_msgcenter.nent_stringcount, + notif.nent_msgcenter.nent_floatcount, s1, s2, s3, s4, - f1, f2, f3, f4); + f1, f2, f3, f4); } #endif break; @@ -1611,7 +1611,7 @@ void Local_Notification(float net_type, float net_name, ...count) case MSG_CHOICE: { entity found_choice; - + if(notif.nent_challow_var && (warmup_stage || (notif.nent_challow_var == 2))) { switch(cvar_string(sprintf("notification_%s", notif.nent_name))) @@ -1622,19 +1622,19 @@ void Local_Notification(float net_type, float net_name, ...count) } } else { found_choice = notif.nent_optiona; } - + Local_Notification_WOVA( found_choice.nent_type, - found_choice.nent_id, - found_choice.nent_stringcount, - found_choice.nent_floatcount, + found_choice.nent_id, + found_choice.nent_stringcount, + found_choice.nent_floatcount, s1, s2, s3, s4, - f1, f2, f3, f4); + f1, f2, f3, f4); } } } -// WOVA = Without Variable Arguments +// WOVA = Without Variable Arguments void Local_Notification_WOVA( float net_type, float net_name, float stringcount, float floatcount, @@ -1673,7 +1673,7 @@ void Read_Notification(float is_new) net_name )); #endif - + if(is_new) { if(net_name == 0) { reset_centerprint_messages(); } @@ -1689,7 +1689,7 @@ void Read_Notification(float is_new) is_new, time )); - } + } } } else @@ -1715,7 +1715,7 @@ void Read_Notification(float is_new) float f2 = ((1 < notif.nent_floatcount) ? ReadLong() : 0); float f3 = ((2 < notif.nent_floatcount) ? ReadLong() : 0); float f4 = ((3 < notif.nent_floatcount) ? ReadLong() : 0); - + if(is_new) { Local_Notification_WOVA( @@ -1733,7 +1733,7 @@ void Read_Notification(float is_new) void Net_Notification_Remove() { if (!self) { backtrace(sprintf("Net_Notification_Remove() at %f: Missing self!?\n", time)); return; } - + #ifdef NOTIFICATIONS_DEBUG Debug_Notification(sprintf( "Net_Notification_Remove() at %f: %s '%s - %s' notification\n", @@ -1743,7 +1743,7 @@ void Net_Notification_Remove() self.owner.nent_name )); #endif - + float i; for(i = 0; i < 4; ++i) { if(self.nent_strings[i]) { strunzone(self.nent_strings[i]); } } remove(self); @@ -1757,7 +1757,7 @@ float Net_Write_Notification(entity client, float sf) WriteByte(MSG_ENTITY, ENT_CLIENT_NOTIFICATION); WriteByte(MSG_ENTITY, self.nent_net_type); WriteShort(MSG_ENTITY, self.nent_net_name); - for(i = 0; i < self.nent_stringcount; ++i) { WriteString(MSG_ENTITY, self.nent_strings[i]); } + for(i = 0; i < self.nent_stringcount; ++i) { WriteString(MSG_ENTITY, self.nent_strings[i]); } for(i = 0; i < self.nent_floatcount; ++i) { WriteLong(MSG_ENTITY, self.nent_floats[i]); } return TRUE; } @@ -1777,13 +1777,13 @@ void Kill_Notification( net_name )); #endif - + string checkargs = Notification_CheckArgs(broadcast, client, 1, 1); if(checkargs != "") { backtrace(sprintf("Incorrect usage of Kill_Notification: %s\n", checkargs)); return; } entity notif, net_notif; float killed_cpid = NO_CPID; - + switch(net_type) { case 0: @@ -1791,14 +1791,14 @@ void Kill_Notification( killed_cpid = 0; // kill ALL centerprints break; } - + case MSG_CENTER: { if(net_name) { entity notif = Get_Notif_Ent(net_type, net_name); if (!notif) { backtrace("Kill_Notification: Could not find notification entity!\n"); return; } - + if(notif.nent_cpid) killed_cpid = notif.nent_cpid; else @@ -1876,7 +1876,7 @@ void Send_Notification( #endif return; } - + // check supplied broadcast, target, type, and name for errors string checkargs = Notification_CheckArgs(broadcast, client, net_type, net_name); if(checkargs != "") @@ -1940,7 +1940,7 @@ void Send_Notification( backtrace(sprintf( strcat( "Not enough arguments for Send_Notification(%s, ...)! ", - "stringcount(%d) + floatcount(%d) > count(%d)\n", + "stringcount(%d) + floatcount(%d) > count(%d)\n", "Check the definition and function call for accuracy...?\n" ), sprintf( @@ -2019,7 +2019,7 @@ void Send_Notification( // It's slow, but it's better than the alternatives: // 1. Constantly networking all info and letting client decide // 2. Manually handling each separate call on per-usage basis (See old CTF usage of verbose) - entity found_choice; + entity found_choice; #define RECURSE_FROM_CHOICE(ent,action) \ if(notif.nent_challow_var && (warmup_stage || (notif.nent_challow_var == 2))) \ @@ -2071,7 +2071,7 @@ void Send_Notification( net_notif.nent_net_name = net_name; net_notif.nent_stringcount = notif.nent_stringcount; net_notif.nent_floatcount = notif.nent_floatcount; - + float i; for(i = 0; i < net_notif.nent_stringcount; ++i) { net_notif.nent_strings[i] = strzone(...(i, string)); } @@ -2085,13 +2085,13 @@ void Send_Notification( (time + autocvar_notification_lifetime_runtime) : autocvar_notification_lifetime_mapload - ); + ); Net_LinkEntity(net_notif, FALSE, 0, Net_Write_Notification); } } -// WOVA = Without Variable Arguments +// WOVA = Without Variable Arguments void Send_Notification_WOVA( float broadcast, entity client, float net_type, float net_name, @@ -2116,7 +2116,7 @@ void Send_Notification_WOVA( sprintf("%d, %d, %d, %d", f1, f2, f3, f4) )); #endif - + #define VARITEM(stringc,floatc,args) \ if((stringcount == stringc) && (floatcount == floatc)) \ { Send_Notification(broadcast, client, net_type, net_name, args); return; } @@ -2125,7 +2125,7 @@ void Send_Notification_WOVA( Send_Notification(broadcast, client, net_type, net_name); // some notifications don't have any arguments at all } -// WOCOVA = Without Counts Or Variable Arguments +// WOCOVA = Without Counts Or Variable Arguments void Send_Notification_WOCOVA( float broadcast, entity client, float net_type, float net_name, @@ -2133,7 +2133,7 @@ void Send_Notification_WOCOVA( float f1, float f2, float f3, float f4) { entity notif = Get_Notif_Ent(net_type, net_name); - + #ifdef NOTIFICATIONS_DEBUG Debug_Notification(sprintf( "Send_Notification_WOCOVA(%s, %s, %s);\n", @@ -2148,7 +2148,7 @@ void Send_Notification_WOCOVA( sprintf("%d, %d, %d, %d", f1, f2, f3, f4) )); #endif - + #define VARITEM(stringc,floatc,args) \ if((notif.nent_stringcount == stringc) && (notif.nent_floatcount == floatc)) \ { Send_Notification(broadcast, client, net_type, net_name, args); return; } diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index 84864bb45..6c602219b 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -5,7 +5,7 @@ // main types/groups of notifications #define MSG_ANNCE 1 // "Global" AND "personal" announcer messages -#define MSG_INFO 2 // "Global" information messages +#define MSG_INFO 2 // "Global" information messages #define MSG_CENTER 3 // "Personal" centerprint messages #define MSG_CENTER_CPID 4 // Kill centerprint message #define MSG_MULTI 5 // Subcall MSG_INFO and/or MSG_CENTER notifications @@ -51,7 +51,7 @@ void Create_Notification_Entity( float strnum, float flnum, /* MSG_ANNCE */ - float channel, + float channel, string snd, float vol, float position, @@ -188,7 +188,7 @@ void Send_Notification_WOCOVA( Check out the definitions in util.qc/util.qh/teams.qh for string CCR(...) and string TCR(...) to better understand how these code replacements work. - + Additionally, you can find all the definitions and explanations for the argument values and what they return down below in this file. @@ -515,7 +515,7 @@ void Send_Notification_WOCOVA( MSG_INFO_NOTIF(1, INFO_WEAPON_TUBA_MURDER, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weapontuba", _("^BG%s%s^K1 died of ^BG%s^K1's great playing on the @!#%%'n Tuba%s%s"), "") \ MSG_INFO_NOTIF(1, INFO_WEAPON_TUBA_SUICIDE, 2, 1, "s1 s2loc spree_lost", "s1", "weapontuba", _("^BG%s^K1 hurt their own ears with the @!#%%'n Tuba%s%s"), "") \ MSG_INFO_NOTIF(1, INFO_WEAPON_UZI_MURDER_SNIPE, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponuzi", _("^BG%s%s^K1 was sniped by ^BG%s^K1's Machine Gun%s%s"), "") \ - MSG_INFO_NOTIF(1, INFO_WEAPON_UZI_MURDER_SPRAY, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponuzi", _("^BG%s%s^K1 was riddled full of holes by ^BG%s^K1's Machine Gun%s%s"), "") + MSG_INFO_NOTIF(1, INFO_WEAPON_UZI_MURDER_SPRAY, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponuzi", _("^BG%s%s^K1 was riddled full of holes by ^BG%s^K1's Machine Gun%s%s"), "") #define MULTITEAM_CENTER2(default,prefix,strnum,flnum,args,cpid,durcnt,normal,gentle) \ MSG_CENTER_NOTIF(default, prefix##RED, strnum, flnum, args, cpid, durcnt, TCR(normal, COL_TEAM_1, strtoupper(NAME_TEAM_1)), TCR(gentle, COL_TEAM_1, strtoupper(NAME_TEAM_1))) \ @@ -857,7 +857,7 @@ var float autocvar_notification_item_centerprinttime = 1.5; // 0 = no, 1 = yes, 2 = forced on for all MSG_INFO notifs // DISABLED IN CODE, BUT ENABLED IN CONFIG FOR COMPATIBILITY WITH OLD CLIENTS -var float autocvar_notification_allow_chatboxprint = 0; +var float autocvar_notification_allow_chatboxprint = 0; var float autocvar_notification_show_sprees_center = TRUE; var float autocvar_notification_show_sprees_center_specialonly = TRUE; @@ -874,14 +874,14 @@ var float autocvar_notification_show_sprees_center_specialonly = TRUE; allows for more dynamic data to be inferred by the local notification parser, so that the server does not have to network anything too crazy on a per-client/per-situation basis. - + Pay attention to the CSQC/SVQC relations, some of these are redefined in slightly different ways for different programs, this is because the server does a more conservative approach to the notifs than the client. - + All arguments are swapped into strings, so be sure that your sprintf usage matches with proper %s placement. - + Argument descriptions: s1-s4: string arguments to be literally swapped into sprintf s2loc: s2 string of locations of deaths or other events @@ -1025,13 +1025,13 @@ string notif_arg_missing_teams(float f1, float f2, float f3, float f4) string notif_arg_spree_cen(float spree) { // 0 = off, 1 = target (but only for first victim) and attacker - if(autocvar_notification_show_sprees_center) + if(autocvar_notification_show_sprees_center) { if(spree > 1) { #define SPREE_ITEM(counta,countb,center,normal,gentle) \ case counta: { return normal_or_gentle(center, sprintf(_("%d score spree! "), spree)); } - + switch(spree) { KILL_SPREE_LIST @@ -1047,7 +1047,7 @@ string notif_arg_spree_cen(float spree) ), spree); } - else { return ""; } // don't show spree information if it isn't an achievement + else { return ""; } // don't show spree information if it isn't an achievement } } @@ -1074,7 +1074,7 @@ string notif_arg_spree_inf(float type, string input, string player, float spree) { // 0 = off, 1 = target only, 2 = attacker only, 3 = target and attacker // this conditional (& 2) is true for 2 and 3 - if(autocvar_notification_show_sprees_info & 2) + if(autocvar_notification_show_sprees_info & 2) { #ifdef CSQC string spree_newline = @@ -1084,12 +1084,12 @@ string notif_arg_spree_inf(float type, string input, string player, float spree) string spree_newline = (autocvar_notification_show_sprees_info_newline ? "\n" : ""); #endif - + if(spree > 1) { #define SPREE_ITEM(counta,countb,center,normal,gentle) \ case counta: { return sprintf(CCR(normal_or_gentle(normal, gentle)), player, spree_newline); } - + switch(spree) { KILL_SPREE_LIST @@ -1108,7 +1108,7 @@ string notif_arg_spree_inf(float type, string input, string player, float spree) spree_newline ); } - else { return ""; } // don't show spree information if it isn't an achievement + else { return ""; } // don't show spree information if it isn't an achievement } } @@ -1464,9 +1464,9 @@ void RegisterNotifications_First() #else #define dedi "" #endif - + print(sprintf("Beginning notification initialization on %s%s program...\n", dedi, PROGNAME)); - + // maybe do another implementation of this with checksums? for now, we don't need versioning /*if(autocvar_notification_version != NOTIF_VERSION) { diff --git a/qcsrc/common/teams.qh b/qcsrc/common/teams.qh index ade219a24..069904290 100644 --- a/qcsrc/common/teams.qh +++ b/qcsrc/common/teams.qh @@ -50,7 +50,7 @@ string Team_ColorCode(float teamid) case NUM_TEAM_3: return COL_TEAM_3; case NUM_TEAM_4: return COL_TEAM_4; } - + return "^7"; } @@ -76,7 +76,7 @@ string Team_ColorName(float teamid) case NUM_TEAM_3: return NAME_TEAM_3; case NUM_TEAM_4: return NAME_TEAM_4; } - + return NAME_NEUTRAL; } @@ -90,7 +90,7 @@ string Static_Team_ColorName(float teamid) case NUM_TEAM_3: return STATIC_NAME_TEAM_3; case NUM_TEAM_4: return STATIC_NAME_TEAM_4; } - + return NAME_NEUTRAL; } @@ -104,7 +104,7 @@ float Team_ColorToTeam(string team_color) case "pink": return NUM_TEAM_4; case "auto": return 0; } - + return -1; } @@ -117,7 +117,7 @@ float Team_NumberToTeam(float number) case 3: return NUM_TEAM_3; case 4: return NUM_TEAM_4; } - + return -1; } @@ -130,7 +130,7 @@ float Team_TeamToNumber(float teamid) case NUM_TEAM_3: return 3; case NUM_TEAM_4: return 4; } - + return -1; } diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 11dbdaedb..d1503a7b6 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -148,7 +148,7 @@ void wordwrap_cb(string s, float l, void(string) callback) float dist_point_line(vector p, vector l0, vector ldir) { ldir = normalize(ldir); - + // remove the component in line direction p = p - (p * ldir) * ldir; @@ -264,7 +264,7 @@ void db_save(float db, string pFilename) { float fh, i, n; fh = fopen(pFilename, FILE_WRITE); - if(fh < 0) + if(fh < 0) { print(strcat("^1Can't write DB to ", pFilename)); return; @@ -458,7 +458,7 @@ string ScoreString(float pFlags, float pValue) valstr = TIME_ENCODED_TOSTRING(pValue); else valstr = ftos(pValue); - + return valstr; } @@ -664,7 +664,7 @@ string fixPriorityList(string order, float from, float to, float subtract, float neworder = strcat(neworder, ftos(w), " "); } } - + return substring(neworder, 0, strlen(neworder) - 1); } @@ -677,7 +677,7 @@ string mapPriorityList(string order, string(string) mapfunc) neworder = ""; for(i = 0; i < n; ++i) neworder = strcat(neworder, mapfunc(argv(i)), " "); - + return substring(neworder, 0, strlen(neworder) - 1); } @@ -702,7 +702,7 @@ string swapInPriorityList(string order, float i, float j) } return substring(s, 0, strlen(s) - 1); } - + return order; } @@ -1100,7 +1100,7 @@ vector rgb_to_hsv(vector rgb) hsv_y = 0; else hsv_y = 1 - mi/ma; - + return hsv; } @@ -1118,7 +1118,7 @@ vector rgb_to_hsl(vector rgb) ma = max(rgb_x, rgb_y, rgb_z); hsl_x = rgb_mi_ma_to_hue(rgb, mi, ma); - + hsl_z = 0.5 * (mi + ma); if(mi == ma) hsl_y = 0; @@ -1126,7 +1126,7 @@ vector rgb_to_hsl(vector rgb) hsl_y = (ma - mi) / (2*hsl_z); else // if(hsl_z > 0.5) hsl_y = (ma - mi) / (2 - 2*hsl_z); - + return hsl; } @@ -1138,7 +1138,7 @@ vector hsl_to_rgb(vector hsl) maminusmi = hsl_y * 2 * hsl_z; else maminusmi = hsl_y * (2 - 2 * hsl_z); - + // hsl_z = 0.5 * mi + 0.5 * ma // maminusmi = - mi + ma mi = hsl_z - 0.5 * maminusmi; @@ -1199,7 +1199,7 @@ float textLengthUpToWidth(string theText, float maxWidth, vector theSize, textLe // terminate, as the range still halves each time - but nevertheless, it is // guaranteed that it finds ONE valid cutoff place (where "left" is in // range, and "right" is outside). - + // terencehill: the following code detects truncated ^xrgb tags (e.g. ^x or ^x4) // and decrease left on the basis of the chars detected of the truncated tag // Even if the ^xrgb tag is not complete/correct, left is decreased @@ -1227,7 +1227,7 @@ float textLengthUpToWidth(string theText, float maxWidth, vector theSize, textLe } } } - + return left; } @@ -1263,7 +1263,7 @@ float textLengthUpToLength(string theText, float maxWidth, textLengthUpToLength_ // terminate, as the range still halves each time - but nevertheless, it is // guaranteed that it finds ONE valid cutoff place (where "left" is in // range, and "right" is outside). - + // terencehill: the following code detects truncated ^xrgb tags (e.g. ^x or ^x4) // and decrease left on the basis of the chars detected of the truncated tag // Even if the ^xrgb tag is not complete/correct, left is decreased @@ -1291,7 +1291,7 @@ float textLengthUpToLength(string theText, float maxWidth, textLengthUpToLength_ } } } - + return left; } @@ -1338,7 +1338,7 @@ string getWrappedLine(float w, vector theFontSize, textLengthUpToWidth_widthFunc string s; s = getWrappedLine_remaining; - + if(w <= 0) { getWrappedLine_remaining = string_null; @@ -1384,7 +1384,7 @@ string getWrappedLineLen(float w, textLengthUpToLength_lenFunction_t tw) string s; s = getWrappedLine_remaining; - + if(w <= 0) { getWrappedLine_remaining = string_null; @@ -2323,12 +2323,12 @@ float InterpretBoolean(string input) case "true": case "on": return TRUE; - + case "no": case "false": case "off": return FALSE; - + default: return stof(input); } } @@ -2459,7 +2459,7 @@ float cubic_speedfunc_is_sane(float startspeedfactor, float endspeedfactor) /* // if this is the case, the possible zeros of the first derivative are outside // 0..1 - We can calculate this condition as condition + We can calculate this condition as condition if(se <= 3) return TRUE; */ @@ -2511,7 +2511,7 @@ float cubic_speedfunc_is_sane(float startspeedfactor, float endspeedfactor) Therefore: there is an inflection point iff: e outside (3 - s)/2 .. 3 - s*2 - + in other words, if (s,e) in triangle (1,1)(0,3)(0,1.5) or in triangle (1,1)(3,0)(1.5,0) */ } @@ -2587,12 +2587,12 @@ void backtrace(string msg) string CCR(string input) { // See the autocvar declarations in util.qh for default values - + // foreground/normal colors - input = strreplace("^F1", strcat("^", autocvar_hud_colorset_foreground_1), input); - input = strreplace("^F2", strcat("^", autocvar_hud_colorset_foreground_2), input); - input = strreplace("^F3", strcat("^", autocvar_hud_colorset_foreground_3), input); - input = strreplace("^F4", strcat("^", autocvar_hud_colorset_foreground_4), input); + input = strreplace("^F1", strcat("^", autocvar_hud_colorset_foreground_1), input); + input = strreplace("^F2", strcat("^", autocvar_hud_colorset_foreground_2), input); + input = strreplace("^F3", strcat("^", autocvar_hud_colorset_foreground_3), input); + input = strreplace("^F4", strcat("^", autocvar_hud_colorset_foreground_4), input); // "kill" colors input = strreplace("^K1", strcat("^", autocvar_hud_colorset_kill_1), input); @@ -2651,15 +2651,15 @@ float Announcer_PickNumber(float type, float num) switch(num) { case 10: return ANNCE_NUM_GAMESTART_10; - case 9: return ANNCE_NUM_GAMESTART_9; - case 8: return ANNCE_NUM_GAMESTART_8; - case 7: return ANNCE_NUM_GAMESTART_7; - case 6: return ANNCE_NUM_GAMESTART_6; - case 5: return ANNCE_NUM_GAMESTART_5; - case 4: return ANNCE_NUM_GAMESTART_4; - case 3: return ANNCE_NUM_GAMESTART_3; - case 2: return ANNCE_NUM_GAMESTART_2; - case 1: return ANNCE_NUM_GAMESTART_1; + case 9: return ANNCE_NUM_GAMESTART_9; + case 8: return ANNCE_NUM_GAMESTART_8; + case 7: return ANNCE_NUM_GAMESTART_7; + case 6: return ANNCE_NUM_GAMESTART_6; + case 5: return ANNCE_NUM_GAMESTART_5; + case 4: return ANNCE_NUM_GAMESTART_4; + case 3: return ANNCE_NUM_GAMESTART_3; + case 2: return ANNCE_NUM_GAMESTART_2; + case 1: return ANNCE_NUM_GAMESTART_1; } break; } @@ -2668,15 +2668,15 @@ float Announcer_PickNumber(float type, float num) switch(num) { case 10: return ANNCE_NUM_IDLE_10; - case 9: return ANNCE_NUM_IDLE_9; - case 8: return ANNCE_NUM_IDLE_8; - case 7: return ANNCE_NUM_IDLE_7; - case 6: return ANNCE_NUM_IDLE_6; - case 5: return ANNCE_NUM_IDLE_5; - case 4: return ANNCE_NUM_IDLE_4; - case 3: return ANNCE_NUM_IDLE_3; - case 2: return ANNCE_NUM_IDLE_2; - case 1: return ANNCE_NUM_IDLE_1; + case 9: return ANNCE_NUM_IDLE_9; + case 8: return ANNCE_NUM_IDLE_8; + case 7: return ANNCE_NUM_IDLE_7; + case 6: return ANNCE_NUM_IDLE_6; + case 5: return ANNCE_NUM_IDLE_5; + case 4: return ANNCE_NUM_IDLE_4; + case 3: return ANNCE_NUM_IDLE_3; + case 2: return ANNCE_NUM_IDLE_2; + case 1: return ANNCE_NUM_IDLE_1; } break; } @@ -2685,15 +2685,15 @@ float Announcer_PickNumber(float type, float num) switch(num) { case 10: return ANNCE_NUM_KILL_10; - case 9: return ANNCE_NUM_KILL_9; - case 8: return ANNCE_NUM_KILL_8; - case 7: return ANNCE_NUM_KILL_7; - case 6: return ANNCE_NUM_KILL_6; - case 5: return ANNCE_NUM_KILL_5; - case 4: return ANNCE_NUM_KILL_4; - case 3: return ANNCE_NUM_KILL_3; - case 2: return ANNCE_NUM_KILL_2; - case 1: return ANNCE_NUM_KILL_1; + case 9: return ANNCE_NUM_KILL_9; + case 8: return ANNCE_NUM_KILL_8; + case 7: return ANNCE_NUM_KILL_7; + case 6: return ANNCE_NUM_KILL_6; + case 5: return ANNCE_NUM_KILL_5; + case 4: return ANNCE_NUM_KILL_4; + case 3: return ANNCE_NUM_KILL_3; + case 2: return ANNCE_NUM_KILL_2; + case 1: return ANNCE_NUM_KILL_1; } break; } @@ -2702,15 +2702,15 @@ float Announcer_PickNumber(float type, float num) switch(num) { case 10: return ANNCE_NUM_RESPAWN_10; - case 9: return ANNCE_NUM_RESPAWN_9; - case 8: return ANNCE_NUM_RESPAWN_8; - case 7: return ANNCE_NUM_RESPAWN_7; - case 6: return ANNCE_NUM_RESPAWN_6; - case 5: return ANNCE_NUM_RESPAWN_5; - case 4: return ANNCE_NUM_RESPAWN_4; - case 3: return ANNCE_NUM_RESPAWN_3; - case 2: return ANNCE_NUM_RESPAWN_2; - case 1: return ANNCE_NUM_RESPAWN_1; + case 9: return ANNCE_NUM_RESPAWN_9; + case 8: return ANNCE_NUM_RESPAWN_8; + case 7: return ANNCE_NUM_RESPAWN_7; + case 6: return ANNCE_NUM_RESPAWN_6; + case 5: return ANNCE_NUM_RESPAWN_5; + case 4: return ANNCE_NUM_RESPAWN_4; + case 3: return ANNCE_NUM_RESPAWN_3; + case 2: return ANNCE_NUM_RESPAWN_2; + case 1: return ANNCE_NUM_RESPAWN_1; } break; } @@ -2719,15 +2719,15 @@ float Announcer_PickNumber(float type, float num) switch(num) { case 10: return ANNCE_NUM_ROUNDSTART_10; - case 9: return ANNCE_NUM_ROUNDSTART_9; - case 8: return ANNCE_NUM_ROUNDSTART_8; - case 7: return ANNCE_NUM_ROUNDSTART_7; - case 6: return ANNCE_NUM_ROUNDSTART_6; - case 5: return ANNCE_NUM_ROUNDSTART_5; - case 4: return ANNCE_NUM_ROUNDSTART_4; - case 3: return ANNCE_NUM_ROUNDSTART_3; - case 2: return ANNCE_NUM_ROUNDSTART_2; - case 1: return ANNCE_NUM_ROUNDSTART_1; + case 9: return ANNCE_NUM_ROUNDSTART_9; + case 8: return ANNCE_NUM_ROUNDSTART_8; + case 7: return ANNCE_NUM_ROUNDSTART_7; + case 6: return ANNCE_NUM_ROUNDSTART_6; + case 5: return ANNCE_NUM_ROUNDSTART_5; + case 4: return ANNCE_NUM_ROUNDSTART_4; + case 3: return ANNCE_NUM_ROUNDSTART_3; + case 2: return ANNCE_NUM_ROUNDSTART_2; + case 1: return ANNCE_NUM_ROUNDSTART_1; } break; } @@ -2736,15 +2736,15 @@ float Announcer_PickNumber(float type, float num) switch(num) { case 10: return ANNCE_NUM_10; - case 9: return ANNCE_NUM_9; - case 8: return ANNCE_NUM_8; - case 7: return ANNCE_NUM_7; - case 6: return ANNCE_NUM_6; - case 5: return ANNCE_NUM_5; - case 4: return ANNCE_NUM_4; - case 3: return ANNCE_NUM_3; - case 2: return ANNCE_NUM_2; - case 1: return ANNCE_NUM_1; + case 9: return ANNCE_NUM_9; + case 8: return ANNCE_NUM_8; + case 7: return ANNCE_NUM_7; + case 6: return ANNCE_NUM_6; + case 5: return ANNCE_NUM_5; + case 4: return ANNCE_NUM_4; + case 3: return ANNCE_NUM_3; + case 2: return ANNCE_NUM_2; + case 1: return ANNCE_NUM_1; } break; } diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index 166af391e..66b0edb3d 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -101,7 +101,7 @@ void buf_save(float buf, string filename); // modulo function #ifndef MENUQC -float mod(float a, float b) { return a - (floor(a / b) * b); } +float mod(float a, float b) { return a - (floor(a / b) * b); } #endif #define TIME_TO_NTHS(t,n) floor((t) * (n) + 0.4) diff --git a/qcsrc/csqcmodellib/cl_model.qc b/qcsrc/csqcmodellib/cl_model.qc index 2c7bc2d92..1dbb2b68f 100644 --- a/qcsrc/csqcmodellib/cl_model.qc +++ b/qcsrc/csqcmodellib/cl_model.qc @@ -244,7 +244,7 @@ void CSQCModel_Read(float isnew) self.iflags |= IFLAG_TELEPORTED; self.csqcmodel_teleported = 1; } - + CSQCModel_InterpolateAnimation_Note(sf); InterpolateOrigin_Note(); CSQCPlayer_PostUpdate(); diff --git a/qcsrc/dpdefs/csprogsdefs.qc b/qcsrc/dpdefs/csprogsdefs.qc index 324f8082f..8f4ec8b41 100644 --- a/qcsrc/dpdefs/csprogsdefs.qc +++ b/qcsrc/dpdefs/csprogsdefs.qc @@ -194,7 +194,7 @@ const float VF_DRAWCROSSHAIR = 21; //(float) const float VF_CL_VIEWANGLES = 33; //(vector) const float VF_CL_VIEWANGLES_X = 34; //(float) const float VF_CL_VIEWANGLES_Y = 35; //(float) -const float VF_CL_VIEWANGLES_Z = 36; //(float) +const float VF_CL_VIEWANGLES_Z = 36; //(float) const float VF_PERSPECTIVE = 200; @@ -291,7 +291,7 @@ const float TE_EXPLOSION2 = 12; const float TE_EXPLOSIONQUAD = 70; const float TE_SPIKEQUAD = 58; const float TE_SUPERSPIKEQUAD = 59; - + // PFlags for Dynamic Lights const float PFLAGS_NOSHADOW = 1; const float PFLAGS_CORONA = 2; @@ -657,11 +657,11 @@ float PARTICLE_BEAM = 3; float particle_type; // one of PT_ float particle_blendmode; // one of PBLEND_ values float particle_orientation; // one of PARTICLE_ values -vector particle_color1; +vector particle_color1; vector particle_color2; float particle_tex; // number of chunk in particlefont float particle_size; -float particle_sizeincrease; +float particle_sizeincrease; float particle_alpha; float particle_alphafade; float particle_time; @@ -693,10 +693,10 @@ float(vector org, vector vel) spawnparticle = #527; // returns 0 when failed, 1 float(vector org, vector vel, float theme) quickparticle = #527; // not reading globals, just theme, returns 0 when failed, 1 when spawned float(vector org, vector vel, float delay, float collisiondelay) delayedparticle = #528; float(vector org, vector vel, float delay, float collisiondelay, float theme) quickdelayedparticle = #528; -// description: this builtin provides an easy and flexible way to spawn particles, -// it is not created as replace for DP_SV_POINTPARTICLES but as an addition to it. +// description: this builtin provides an easy and flexible way to spawn particles, +// it is not created as replace for DP_SV_POINTPARTICLES but as an addition to it. // With this extension you can create a specific particles like rain particles, or entity particles -// notes: +// notes: // 1) 0 is default particle template, it could be changed // 2) color vectors could have value 0-255 of each component // restrictions: max themes could be between 4 and 2048 @@ -806,7 +806,7 @@ vector(float entitynum, float fldnum) getentityvec = #504; //darkplaces implementation: Blub\0 //console commands: // loadfont fontname fontmaps size1 size2 ... -// A font can simply be gfx/tgafile (freetype fonts doent need extension), +// A font can simply be gfx/tgafile (freetype fonts doent need extension), // or alternatively you can specify multiple fonts and faces // Like this: gfx/vera-sans:2,gfx/fallback:1 // to load face 2 of the font gfx/vera-sans and use face 1 @@ -835,7 +835,7 @@ float FONT_USER6 = 14; // 'user6', userdefined fonts float FONT_USER7 = 15; // 'user7' slot, userdefined fonts //builtin definitions: float findfont(string s) = #356; // find font by fontname and return it's index -float loadfont(string fontname, string fontmaps, string sizes, float slot, float fix_scale, float fix_voffset) = #357; +float loadfont(string fontname, string fontmaps, string sizes, float slot, float fix_scale, float fix_voffset) = #357; // loads font immediately so stringwidth() function can be used just after builtin call // returns a font slotnum (which is used to set drawfont to) // first 3 parms are identical to "loadfont" console command ones @@ -866,7 +866,7 @@ float stringwidth_menu(string text, float allowColorCodes, vector size) = #468; // r_font_postprocess_shadow_y X : font outline shadow y shift amount, applied during outlining // r_font_postprocess_shadow_z X : font outline shadow z shift amount, applied during blurring //description: engine support for truetype/freetype fonts -//so .AFM+.PFB/.OTF/.TTF files could be stuffed as fontmaps in loadfont() +//so .AFM+.PFB/.OTF/.TTF files could be stuffed as fontmaps in loadfont() //(console command version will support them as well) //DP_CSQC_BINDMAPS @@ -897,7 +897,7 @@ float(string url, float id, string content_type, string delim, float buf, float //constant definitions: const float VF_MAINVIEW = 400; //use setproperty(VF_MAINVIEW, 1); before calling R_RenderView for the render -//that shall become the "main" view, which is e.g. used by PRYDON_CLIENTCURSOR +//that shall become the "main" view, which is e.g. used by PRYDON_CLIENTCURSOR //this flag is set for the first scene, and not cleared by R_ClearScene //this flag is automatically cleared by R_RenderView //so when not using this extension, the first view rendered is the main view diff --git a/qcsrc/dpdefs/dpextensions.qc b/qcsrc/dpdefs/dpextensions.qc index 39a2f593a..ef86a02b3 100644 --- a/qcsrc/dpdefs/dpextensions.qc +++ b/qcsrc/dpdefs/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 @@ -1358,14 +1358,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 @@ -1732,11 +1732,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/menudefs.qc b/qcsrc/dpdefs/menudefs.qc index 2c21cd181..21093868e 100644 --- a/qcsrc/dpdefs/menudefs.qc +++ b/qcsrc/dpdefs/menudefs.qc @@ -303,7 +303,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/item/container.c b/qcsrc/menu/item/container.c index b09cb01a9..f14a4ceb7 100644 --- a/qcsrc/menu/item/container.c +++ b/qcsrc/menu/item/container.c @@ -385,7 +385,7 @@ void Container_moveItemAfter(entity me, entity other, entity dest) n.prevSibling = p; else me.lastChild = p; - + // now other got removed. Insert it behind dest now. other.prevSibling = dest; if(dest) diff --git a/qcsrc/menu/item/dialog.c b/qcsrc/menu/item/dialog.c index 4356c26b1..383578781 100644 --- a/qcsrc/menu/item/dialog.c +++ b/qcsrc/menu/item/dialog.c @@ -4,7 +4,7 @@ // - closable is 0 // - rootDialog is 0 // - title is "" -// - marginTop is +// - marginTop is // - intendedHeight ends up to be the tab's actual height, or at least close // - titleFontSize is 0 // - marginTop cancels out as much of titleHeight as needed (that is, it should be actualMarginTop - titleHeight) diff --git a/qcsrc/menu/item/inputbox.c b/qcsrc/menu/item/inputbox.c index 614f6d557..1c1bf5189 100644 --- a/qcsrc/menu/item/inputbox.c +++ b/qcsrc/menu/item/inputbox.c @@ -260,11 +260,11 @@ void InputBox_draw(entity me) vector p; vector theTempColor; float component; - + p = me.realOrigin - eX * me.scrollPos; theColor = '1 1 1'; theAlpha = 1; //theVariableAlpha = 1; // changes when ^ax found - + n = strlen(me.text); for(i = 0; i < n; ++i) { @@ -300,24 +300,24 @@ void InputBox_draw(entity me) else if(ch2 == "x") // ^x found { theColor = '1 1 1'; - + component = HEXDIGIT_TO_DEC(substring(me.text, i+2, 1)); if (component >= 0) // ^xr found { theTempColor_x = component/15; - + component = HEXDIGIT_TO_DEC(substring(me.text, i+3, 1)); if (component >= 0) // ^xrg found { theTempColor_y = component/15; - + component = HEXDIGIT_TO_DEC(substring(me.text, i+4, 1)); if (component >= 0) // ^xrgb found { theTempColor_z = component/15; theColor = theTempColor; w = draw_TextWidth(substring(me.text, i, 5), 0, me.realFontSize); - + draw_Fill(p, eX * w + eY * me.realFontSize_y, '1 1 1', 0.5); draw_Text(p, substring(me.text, i, 5), me.realFontSize, theColor, 1, 0); // theVariableAlpha instead of 1 using alpha tags ^ax i += 3; diff --git a/qcsrc/menu/item/nexposee.c b/qcsrc/menu/item/nexposee.c index afe82e892..ca7ab8fc3 100644 --- a/qcsrc/menu/item/nexposee.c +++ b/qcsrc/menu/item/nexposee.c @@ -92,7 +92,7 @@ void Nexposee_calc(entity me) float scale; entity e, e2; vector emins, emaxs, e2mins, e2maxs; - + for(scale = 0.7;; scale *= 0.99) { Nexposee_Calc_Scale(me, scale); diff --git a/qcsrc/menu/item/tab.c b/qcsrc/menu/item/tab.c index 7f3a2873f..8cd72ba9c 100644 --- a/qcsrc/menu/item/tab.c +++ b/qcsrc/menu/item/tab.c @@ -5,7 +5,7 @@ CLASS(Tab) EXTENDS(Dialog) ATTRIB(Tab, rootDialog, float, 0) ATTRIB(Tab, title, string, string_null) ATTRIB(Tab, titleFontSize, float, 0) // pixels - + // still to be customized ATTRIB(Tab, intendedWidth, float, 0) ATTRIB(Tab, rows, float, 3) diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index fd6327244..d5eff6e49 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -441,7 +441,7 @@ float m_allocatetooltipbox(vector pos) v = pos + avoidplus; if(m_testtooltipbox(v)) return TRUE; - + // bottom center v_x = pos_x - menuTooltipSize_x * 0.5; if(m_testtooltipbox(v)) @@ -461,12 +461,12 @@ float m_allocatetooltipbox(vector pos) v_x = pos_x - menuTooltipSize_x * 0.5; if(m_testtooltipbox(v)) return TRUE; - + // top right v_x = pos_x + avoidplus_x; if(m_testtooltipbox(v)) return TRUE; - + return FALSE; } entity m_findtooltipitem(entity root, vector pos) @@ -990,7 +990,7 @@ void m_goto(string itemname) for(e = NULL; (e = find(e, name, itemname)); ) if(e.classname != "vtbl") break; - + if((e) && (!e.requiresConnection || (gamestatus & (GAME_ISSERVER | GAME_CONNECTED)))) { m_hide(); diff --git a/qcsrc/menu/oo/interface.h b/qcsrc/menu/oo/interface.h index 85bc6c2af..1e122066c 100644 --- a/qcsrc/menu/oo/interface.h +++ b/qcsrc/menu/oo/interface.h @@ -17,7 +17,7 @@ #endif #define CLASS(cname) entity spawn##cname(); entity cname##_vtbl; -#define EXTENDS(base) +#define EXTENDS(base) #define METHOD(cname,name,prototype) prototype cname##_##name; .prototype name; #define ATTRIB(cname,name,type,val) .type name; #define ATTRIBARRAY(cname,name,type,cnt) .type name[cnt]; diff --git a/qcsrc/menu/xonotic/checkbox_slider_invalid.c b/qcsrc/menu/xonotic/checkbox_slider_invalid.c index c5500394b..e3043184a 100644 --- a/qcsrc/menu/xonotic/checkbox_slider_invalid.c +++ b/qcsrc/menu/xonotic/checkbox_slider_invalid.c @@ -38,7 +38,7 @@ void XonoticSliderCheckBox_configureXonoticSliderCheckBox(entity me, float theOf if(theControlledSlider.value == median(theControlledSlider.valueMin, theControlledSlider.value, theControlledSlider.valueMax)) me.savedValue = theControlledSlider.value; else - me.savedValue = theControlledSlider.valueMin; + me.savedValue = theControlledSlider.valueMin; me.controlledSlider = theControlledSlider; me.configureCheckBox(me, theText, me.fontSize, me.image); me.tooltip = theControlledSlider.tooltip; diff --git a/qcsrc/menu/xonotic/colorpicker.c b/qcsrc/menu/xonotic/colorpicker.c index eb9590827..eca6df5f3 100644 --- a/qcsrc/menu/xonotic/colorpicker.c +++ b/qcsrc/menu/xonotic/colorpicker.c @@ -141,7 +141,7 @@ void XonoticColorpicker_draw(entity me) // for this to work, C/(1-B) must be in 0..1 // B must be < 1 // C must be < 1-B - + B = bound(0, B, 1); C = bound(0, C, 1-B); diff --git a/qcsrc/menu/xonotic/crosshairbutton.c b/qcsrc/menu/xonotic/crosshairbutton.c index 2703b233c..7fe3a600f 100644 --- a/qcsrc/menu/xonotic/crosshairbutton.c +++ b/qcsrc/menu/xonotic/crosshairbutton.c @@ -121,7 +121,7 @@ void XonoticCrosshairButton_draw(entity me) { if(cvar("crosshair_dot_color_custom") && (cvar_string("crosshair_dot_color") != "0")) rgb = stov(cvar_string("crosshair_dot_color")); - + draw_Picture('0.5 0.5 0' - 0.5 * sz * cvar("crosshair_dot_size"), me.src4, sz * cvar("crosshair_dot_size"), rgb, a * cvar("crosshair_dot_alpha")); } } diff --git a/qcsrc/menu/xonotic/cvarlist.c b/qcsrc/menu/xonotic/cvarlist.c index 52f1a1f26..722917f55 100644 --- a/qcsrc/menu/xonotic/cvarlist.c +++ b/qcsrc/menu/xonotic/cvarlist.c @@ -65,7 +65,7 @@ void XonoticCvarList_setSelected(entity me, float i) SUPER(XonoticCvarList).setSelected(me, i); if(me.nItems == 0) return; - + if(me.cvarName) strunzone(me.cvarName); if(me.cvarDescription) @@ -137,7 +137,7 @@ void XonoticCvarList_drawListBoxItem(entity me, float i, vector absSize, float i if(isSelected) draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED); - + k = bufstr_get(me.handle, i); v = cvar_string(k); diff --git a/qcsrc/menu/xonotic/demolist.c b/qcsrc/menu/xonotic/demolist.c index 2daed8bcb..ee8cf6a4f 100644 --- a/qcsrc/menu/xonotic/demolist.c +++ b/qcsrc/menu/xonotic/demolist.c @@ -5,13 +5,13 @@ CLASS(XonoticDemoList) EXTENDS(XonoticListBox) METHOD(XonoticDemoList, resizeNotify, void(entity, vector, vector, vector, vector)) METHOD(XonoticDemoList, drawListBoxItem, void(entity, float, vector, float)) METHOD(XonoticDemoList, getDemos, void(entity)) - METHOD(XonoticDemoList, startDemo, void(entity)) + METHOD(XonoticDemoList, startDemo, void(entity)) METHOD(XonoticDemoList, demoName, string(entity, float)) METHOD(XonoticDemoList, clickListBoxItem, void(entity, float, vector)) METHOD(XonoticDemoList, keyDown, float(entity, float, float, float)) METHOD(XonoticDemoList, destroy, void(entity)) METHOD(XonoticDemoList, showNotify, void(entity)) - + ATTRIB(XonoticDemoList, listDemo, float, -1) ATTRIB(XonoticDemoList, realFontSize, vector, '0 0 0') ATTRIB(XonoticDemoList, columnNameOrigin, float, 0) @@ -19,10 +19,10 @@ CLASS(XonoticDemoList) EXTENDS(XonoticListBox) ATTRIB(XonoticDemoList, realUpperMargin, float, 0) ATTRIB(XonoticDemoList, origin, vector, '0 0 0') ATTRIB(XonoticDemoList, itemAbsSize, vector, '0 0 0') - + ATTRIB(XonoticDemoList, lastClickedDemo, float, -1) ATTRIB(XonoticDemoList, lastClickedTime, float, 0) - ATTRIB(XonoticDemoList, filterString, string, string_null) + ATTRIB(XonoticDemoList, filterString, string, string_null) ENDCLASS(XonoticDemoList) entity makeXonoticDemoList(); @@ -44,7 +44,7 @@ entity makeXonoticDemoList() void XonoticDemoList_configureXonoticDemoList(entity me) { me.configureXonoticListBox(me); - me.getDemos(me); + me.getDemos(me); } string XonoticDemoList_demoName(entity me, float i ) @@ -59,23 +59,23 @@ string XonoticDemoList_demoName(entity me, float i ) void XonoticDemoList_getDemos(entity me) { string s; - + if(me.filterString) - //subdirectory in filterString allowed - s=strcat("demos/*", me.filterString, "*.dem"); + //subdirectory in filterString allowed + s=strcat("demos/*", me.filterString, "*.dem"); else s="demos/*.dem"; - - //dprint("Search demos with the pattern ", s, "\n"); + + //dprint("Search demos with the pattern ", s, "\n"); if(me.listDemo >= 0) search_end(me.listDemo); - + me.listDemo = search_begin(s, FALSE, TRUE); if(me.listDemo < 0) me.nItems=0; else - me.nItems=search_getsize(me.listDemo); + me.nItems=search_getsize(me.listDemo); } void XonoticDemoList_destroy(entity me) @@ -101,10 +101,10 @@ void XonoticDemoList_drawListBoxItem(entity me, float i, vector absSize, float i string s; if(isSelected) draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED); - + s = me.demoName(me,i); s = draw_TextShortenToWidth(s, me.columnNameSize, 0, me.realFontSize); - draw_Text(me.realUpperMargin * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, '1 1 1', SKINALPHA_TEXT, 0); + draw_Text(me.realUpperMargin * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, '1 1 1', SKINALPHA_TEXT, 0); } void XonoticDemoList_showNotify(entity me) @@ -113,15 +113,15 @@ void XonoticDemoList_showNotify(entity me) } void DemoList_Filter_Change(entity box, entity me) -{ +{ if(me.filterString) strunzone(me.filterString); - + if(box.text != "") me.filterString = strzone(box.text); else me.filterString = string_null; - + me.getDemos(me); } @@ -129,7 +129,7 @@ void XonoticDemoList_startDemo(entity me) { string s; s = me.demoName(me,me.selectedItem); - localcmd("playdemo \"demos/", s, ".dem\" \nwait \ntogglemenu\n"); + localcmd("playdemo \"demos/", s, ".dem\" \nwait \ntogglemenu\n"); } void StartDemo_Click(entity btn, entity me) @@ -141,7 +141,7 @@ void TimeDemo_Click(entity btn, entity me) { string s; s = me.demoName(me,me.selectedItem); - localcmd("timedemo \"demos/", s, ".dem\" \nwait \ntogglemenu\n"); + localcmd("timedemo \"demos/", s, ".dem\" \nwait \ntogglemenu\n"); } void XonoticDemoList_clickListBoxItem(entity me, float i, vector where) diff --git a/qcsrc/menu/xonotic/dialog_firstrun.c b/qcsrc/menu/xonotic/dialog_firstrun.c index 39a7d2c70..01ce7ba43 100644 --- a/qcsrc/menu/xonotic/dialog_firstrun.c +++ b/qcsrc/menu/xonotic/dialog_firstrun.c @@ -19,13 +19,13 @@ float CheckFirstRunButton(entity me) { if(cvar_string("_cl_name") != "Player") return 1; - + if(cvar_string("_menu_prvm_language") != prvm_language) return 1; // OK will then reopen the dialog in another language - + if(cvar_string("cl_allow_uid2name") != "-1") - return 1; - + return 1; + return 0; } @@ -62,7 +62,7 @@ void XonoticFirstRunDialog_fill(entity me) me.TR(me); me.TR(me); me.TR(me); - + me.gotoRC(me, 3, 4); me.setFirstColumn(me, me.currentColumn); me.TR(me); me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Text language:"))); @@ -75,7 +75,7 @@ void XonoticFirstRunDialog_fill(entity me) me.gotoRC(me, me.rows - 4, 0); me.TD(me, 1, me.columns, e = makeXonoticTextLabel(0.5, _("Allow player statistics to use your nickname at stats.xonotic.org?"))); - + me.gotoRC(me, me.rows - 3, 0); me.TDempty(me, 1.5); me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "1", ZCTX(_("ALWU2N^Yes")))); diff --git a/qcsrc/menu/xonotic/dialog_hudsetup_exit.c b/qcsrc/menu/xonotic/dialog_hudsetup_exit.c index 25eddc8a1..09e6c5339 100644 --- a/qcsrc/menu/xonotic/dialog_hudsetup_exit.c +++ b/qcsrc/menu/xonotic/dialog_hudsetup_exit.c @@ -78,7 +78,7 @@ void XonoticHUDExitDialog_fill(entity me) me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Color:"))); me.TD(me, 2, 2.6, e = makeXonoticColorpickerString("hud_dock_color", "hud_dock_color")); me.TR(me); - me.TR(me); + me.TR(me); me.TDempty(me, 0.2); me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Alpha:"))); me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_dock_alpha")); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_create.c b/qcsrc/menu/xonotic/dialog_multiplayer_create.c index 3fc6f31fe..60f52e1fa 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_create.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_create.c @@ -5,7 +5,7 @@ CLASS(XonoticServerCreateTab) EXTENDS(XonoticTab) ATTRIB(XonoticServerCreateTab, title, string, _("Create")) ATTRIB(XonoticServerCreateTab, intendedWidth, float, 0.9) ATTRIB(XonoticServerCreateTab, rows, float, 22) - ATTRIB(XonoticServerCreateTab, columns, float, 6.2) // added extra .2 for center space + ATTRIB(XonoticServerCreateTab, columns, float, 6.2) // added extra .2 for center space ATTRIB(XonoticServerCreateTab, mapListBox, entity, NULL) ATTRIB(XonoticServerCreateTab, sliderFraglimit, entity, NULL) diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_demo.c b/qcsrc/menu/xonotic/dialog_multiplayer_demo.c index 84115f1ed..da85975de 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_demo.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_demo.c @@ -5,7 +5,7 @@ CLASS(XonoticDemoBrowserTab) EXTENDS(XonoticTab) ATTRIB(XonoticDemoBrowserTab, intendedWidth, float, 0.9) ATTRIB(XonoticDemoBrowserTab, rows, float, 22) ATTRIB(XonoticDemoBrowserTab, columns, float, 4) - ATTRIB(XonoticDemoBrowserTab, name, string, "DemoBrowser") + ATTRIB(XonoticDemoBrowserTab, name, string, "DemoBrowser") ENDCLASS(XonoticDemoBrowserTab) entity makeXonoticDemoBrowserTab(); #endif @@ -32,10 +32,10 @@ void XonoticDemoBrowserTab_fill(entity me) e.onChange = DemoList_Filter_Change; e.onChangeEntity = dlist; dlist.controlledTextbox = e; - + me.TR(me); me.TD(me, me.rows - 4, me.columns, dlist); - + me.gotoRC(me, me.rows - 1, 0); me.TD(me, 1, me.columns / 2, e = makeXonoticButton(_("Timedemo"), '0 0 0')); e.onClick = TimeDemo_Click; diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c b/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c index 0b9bed4df..5ecb77dd7 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c @@ -55,43 +55,43 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i) if(me.currentServerName) strunzone(me.currentServerName); me.currentServerName = string_null; - + if(me.currentServerCName) strunzone(me.currentServerCName); me.currentServerCName = string_null; - + if(me.currentServerType) strunzone(me.currentServerType); me.currentServerType = string_null; - + if(me.currentServerMap) strunzone(me.currentServerMap); me.currentServerMap = string_null; - + if(me.currentServerPlayers) strunzone(me.currentServerPlayers); me.currentServerPlayers = string_null; - + if(me.currentServerNumPlayers) strunzone(me.currentServerNumPlayers); me.currentServerNumPlayers = string_null; - + if(me.currentServerNumBots) strunzone(me.currentServerNumBots); me.currentServerNumBots = string_null; - + if(me.currentServerNumFreeSlots) strunzone(me.currentServerNumFreeSlots); me.currentServerNumFreeSlots = string_null; - + if(me.currentServerMod) strunzone(me.currentServerMod); me.currentServerMod = string_null; - + if(me.currentServerVersion) strunzone(me.currentServerVersion); me.currentServerVersion = string_null; - + // not zoned! //if(me.currentServerEncrypt) // strunzone(me.currentServerEncrypt); @@ -99,11 +99,11 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i) if(me.currentServerPure) strunzone(me.currentServerPure); me.currentServerPure = string_null; - + if(me.currentServerKey) strunzone(me.currentServerKey); me.currentServerKey = string_null; - + if(me.currentServerID) strunzone(me.currentServerID); me.currentServerID = string_null; @@ -158,7 +158,7 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i) j = MapInfo_Type_FromString(typestr); // try and get the real name of the game type if(j) { typestr = MapInfo_Type_ToText(j); } // only set it if we actually found it - + me.currentServerType = strzone(typestr); me.typeLabel.setText(me.typeLabel, me.currentServerType); @@ -177,7 +177,7 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i) s = ftos(numb); me.currentServerNumBots = strzone(s); me.numBotsLabel.setText(me.numBotsLabel, me.currentServerNumBots); - + if(freeslots < 0) { freeslots = maxp - numh - numb; } s = ftos(freeslots); me.currentServerNumFreeSlots = strzone(s); @@ -230,7 +230,7 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i) break; } me.encryptLabel.setText(me.encryptLabel, me.currentServerEncrypt); - + s = crypto_getidfp(me.currentServerCName); if (!s) { s = _("N/A"); } me.currentServerID = strzone(s); @@ -257,7 +257,7 @@ void XonoticServerInfoDialog_fill(entity me) e.colorL = SKINCOLOR_SERVERINFO_IP; e.allowCut = 1; me.cnameLabel = e; - + me.TR(me); me.TR(me); me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Gametype:"))); @@ -284,7 +284,7 @@ void XonoticServerInfoDialog_fill(entity me) me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "")); e.allowCut = 1; me.pureLabel = e; - + me.TR(me); me.TR(me); me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Players:"))); @@ -301,7 +301,7 @@ void XonoticServerInfoDialog_fill(entity me) me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "")); e.allowCut = 1; me.numFreeSlotsLabel = e; - + me.gotoRC(me, me.rows - 5, 0); me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Encryption:"))); me.TD(me, 1, 5.4, e = makeXonoticTextLabel(0, "")); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c index 482a60510..f4bd359ec 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c @@ -5,7 +5,7 @@ CLASS(XonoticPlayerSettingsTab) EXTENDS(XonoticTab) ATTRIB(XonoticPlayerSettingsTab, title, string, _("Player Setup")) ATTRIB(XonoticPlayerSettingsTab, intendedWidth, float, 0.9) ATTRIB(XonoticPlayerSettingsTab, rows, float, 22) - ATTRIB(XonoticPlayerSettingsTab, columns, float, 6.2) // added extra .2 for center space + ATTRIB(XonoticPlayerSettingsTab, columns, float, 6.2) // added extra .2 for center space ATTRIB(XonoticPlayerSettingsTab, playerNameLabel, entity, NULL) ATTRIB(XonoticPlayerSettingsTab, playerNameLabelAlpha, float, 0) ENDCLASS(XonoticPlayerSettingsTab) @@ -166,7 +166,7 @@ void XonoticPlayerSettingsTab_fill(entity me) e.onClickEntity = main.weaponsDialog; // I don't really think this is useful as is, and especially it doesn't look very clean... // In the future, if ALL of these buttons had some information, then it would be justified/clean - //me.TD(me, 1, 1, e0 = makeXonoticTextLabel(0, string_null)); + //me.TD(me, 1, 1, e0 = makeXonoticTextLabel(0, string_null)); // e0.textEntity = main.weaponsDialog; // e0.allowCut = 1; me.TR(me); @@ -174,7 +174,7 @@ void XonoticPlayerSettingsTab_fill(entity me) me.TD(me, 1, 2, e = makeXonoticButton(_("HUD settings"), '0 0 0')); e.onClick = DialogOpenButton_Click; e.onClickEntity = main.hudDialog; - // TODO: show hud config name with text here + // TODO: show hud config name with text here me.gotoRC(me, me.rows - 1, 0); me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "color -1 -1;name \"$_cl_name\";sendcvar cl_weaponpriority;sendcvar cl_autoswitch;sendcvar cl_forceplayermodels;sendcvar cl_forceplayermodelsfromxonotic;playermodel $_cl_playermodel;playerskin $_cl_playerskin", COMMANDBUTTON_APPLY)); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_crosshair.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_crosshair.c index a18fec1c4..c4cdc3e70 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_crosshair.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_crosshair.c @@ -23,7 +23,7 @@ string XonoticCrosshairDialog_toString(entity me) void XonoticCrosshairDialog_fill(entity me) { entity e; - + me.TR(me); me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", _("Enable center crosshair dot"))); setDependent(e, "crosshair_enabled", 1, 2); @@ -84,9 +84,9 @@ void XonoticCrosshairDialog_fill(entity me) me.TDempty(me, 0.2); me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(0.25, 0, "crosshair_pickup", _("Animate when picking up an item"))); setDependent(e, "crosshair_enabled", 1, 2); - + me.TR(me); - + me.gotoRC(me, me.rows - 1, 0); me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0')); e.onClick = Dialog_Close; diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_hud.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_hud.c index a027c0701..8d969fd7a 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_hud.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_hud.c @@ -30,12 +30,12 @@ void XonoticHUDDialog_showNotify(entity me) } string XonoticHUDDialog_toString(entity me) { - return "hi"; // TODO: show hud config name with text here + return "hi"; // TODO: show hud config name with text here } void XonoticHUDDialog_fill(entity me) { entity e; - + me.TR(me); me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Damage:"))); me.TR(me); @@ -55,7 +55,7 @@ void XonoticHUDDialog_fill(entity me) me.TD(me, 1, 2, e = makeXonoticSlider(0.25, 1, 0.05, "hud_damage_fade_rate")); setDependent(e, "hud_damage", 0.001, 100); me.TR(me); - + me.TR(me); me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_hidewaypoints", _("Waypoints"))); me.TR(me); @@ -78,7 +78,7 @@ void XonoticHUDDialog_fill(entity me) makeMulti(e, "g_waypointsprite_edgeoffset_top g_waypointsprite_edgeoffset_left g_waypointsprite_edgeoffset_right"); setDependent(e, "cl_hidewaypoints", 0, 0); me.TR(me); - + me.TR(me); me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_shownames", _("Show names above players"))); me.TR(me); @@ -93,8 +93,8 @@ void XonoticHUDDialog_fill(entity me) me.TD(me, 1, 2, e = makeXonoticButton(_("Enter HUD editor"), '0 0 0')); e.onClick = HUDSetup_Check_Gamestatus; e.onClickEntity = me; - // TODO: show hud config name with text here - + // TODO: show hud config name with text here + me.gotoRC(me, me.rows - 1, 0); me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0')); e.onClick = Dialog_Close; diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_hudconfirm.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_hudconfirm.c index f42cb35bc..7749a148d 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_hudconfirm.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_hudconfirm.c @@ -16,7 +16,7 @@ void HUDSetup_Start(entity me, entity btn) localcmd("map hudsetup/hudsetup", "\n"); else localcmd("togglemenu 0\n"); - + localcmd("_hud_configure 1", "\n"); } diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_model.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_model.c index c55d4d488..d1cdade77 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_model.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_model.c @@ -23,7 +23,7 @@ string XonoticModelDialog_toString(entity me) void XonoticModelDialog_fill(entity me) { entity e; - + me.TR(me); me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Body fading:"))); me.TD(me, 1, 2, e = makeXonoticSlider(0, 2, 0.2, "cl_deathglow")); @@ -42,7 +42,7 @@ void XonoticModelDialog_fill(entity me) me.TR(me); me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_forceplayercolors", _("Force player colors to mine"))); me.TR(me); - + me.gotoRC(me, me.rows - 1, 0); me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0')); e.onClick = Dialog_Close; diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_view.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_view.c index 59a7e6e79..b2b440a1c 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_view.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_view.c @@ -7,7 +7,7 @@ CLASS(XonoticViewDialog) EXTENDS(XonoticDialog) ATTRIB(XonoticViewDialog, color, vector, SKINCOLOR_DIALOG_VIEW) ATTRIB(XonoticViewDialog, intendedWidth, float, 0.9) ATTRIB(XonoticViewDialog, rows, float, 11) - ATTRIB(XonoticViewDialog, columns, float, 6.2) // added extra .2 for center space + ATTRIB(XonoticViewDialog, columns, float, 6.2) // added extra .2 for center space ENDCLASS(XonoticViewDialog) #endif @@ -23,7 +23,7 @@ string XonoticViewDialog_toString(entity me) void XonoticViewDialog_fill(entity me) { entity e; - + me.TR(me); me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Field of view:"))); me.TD(me, 1, 2, e = makeXonoticSlider(60, 130, 5, "fov")); @@ -70,7 +70,7 @@ void XonoticViewDialog_fill(entity me) me.TR(me); me.TR(me); me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_clippedspectating", _("Allow passing through walls while spectating"))); - + me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn); me.TD(me, 1, 3, e = makeXonoticRadioButton(1, "chase_active", "0", _("1st person perspective"))); makeMulti(e, "crosshair_hittest_showimpact"); @@ -108,7 +108,7 @@ void XonoticViewDialog_fill(entity me) me.TD(me, 1, 2, e = makeXonoticSlider(10, 50, 1, "chase_up")); setDependent(e, "chase_active", 1, 1); me.TR(me); - + me.gotoRC(me, me.rows - 1, 0); me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0')); e.onClick = Dialog_Close; diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_weapons.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_weapons.c index fa3549154..cfdaf8fdf 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_weapons.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_weapons.c @@ -36,7 +36,7 @@ void XonoticWeaponsDialog_fill(entity me) me.TD(me, 1, 1, e = makeXonoticButton(_("Down"), '0 0 0')); e.onClick = WeaponsList_MoveDown_Click; e.onClickEntity = me.weaponsList; - + me.gotoRC(me, 0, 2.2); me.setFirstColumn(me, me.currentColumn); me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_weaponpriority_useforcycling", _("Use priority list for weapon cycling"))); me.TR(me); @@ -69,7 +69,7 @@ void XonoticWeaponsDialog_fill(entity me) // setDependent(e, "r_drawviewmodel", 1, 1); // me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 2, 0.1, "cl_viewmodel_scale")); // setDependent(e, "r_drawviewmodel", 1, 1); - + me.gotoRC(me, me.rows - 1, 0); me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0')); e.onClick = Dialog_Close; diff --git a/qcsrc/menu/xonotic/dialog_settings_audio.c b/qcsrc/menu/xonotic/dialog_settings_audio.c index 108b984a1..f3c27915e 100644 --- a/qcsrc/menu/xonotic/dialog_settings_audio.c +++ b/qcsrc/menu/xonotic/dialog_settings_audio.c @@ -4,7 +4,7 @@ CLASS(XonoticAudioSettingsTab) EXTENDS(XonoticTab) ATTRIB(XonoticAudioSettingsTab, title, string, _("Audio")) ATTRIB(XonoticAudioSettingsTab, intendedWidth, float, 0.9) ATTRIB(XonoticAudioSettingsTab, rows, float, 17) - ATTRIB(XonoticAudioSettingsTab, columns, float, 6.2) // added extra .2 for center space + ATTRIB(XonoticAudioSettingsTab, columns, float, 6.2) // added extra .2 for center space ENDCLASS(XonoticAudioSettingsTab) entity makeXonoticAudioSettingsTab(); #endif @@ -97,7 +97,7 @@ void XonoticAudioSettingsTab_fill(entity me) me.TD(me, 1, 3, makeXonoticCheckBox(0, "menu_snd_attenuation_method", _("New style sound attenuation"))); me.TR(me); me.TD(me, 1, 3, makeXonoticCheckBox(0, "snd_mutewhenidle", _("Mute sounds when not active"))); - + me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn); me.TD(me, 1, 1, makeXonoticTextLabel(0, _("Frequency:"))); me.TD(me, 1, 2, e = makeXonoticTextSlider("snd_speed")); diff --git a/qcsrc/menu/xonotic/dialog_settings_effects.c b/qcsrc/menu/xonotic/dialog_settings_effects.c index bea650eba..a963d1e30 100644 --- a/qcsrc/menu/xonotic/dialog_settings_effects.c +++ b/qcsrc/menu/xonotic/dialog_settings_effects.c @@ -4,7 +4,7 @@ CLASS(XonoticEffectsSettingsTab) EXTENDS(XonoticTab) ATTRIB(XonoticEffectsSettingsTab, title, string, _("Effects")) ATTRIB(XonoticEffectsSettingsTab, intendedWidth, float, 0.9) ATTRIB(XonoticEffectsSettingsTab, rows, float, 17) - ATTRIB(XonoticEffectsSettingsTab, columns, float, 6.2) // added extra .2 for center space + ATTRIB(XonoticEffectsSettingsTab, columns, float, 6.2) // added extra .2 for center space ENDCLASS(XonoticEffectsSettingsTab) entity makeXonoticEffectsSettingsTab(); float updateCompression(); @@ -195,7 +195,7 @@ void XonoticEffectsSettingsTab_fill(entity me) setDependent(e, "cl_decals", 1, 1); me.TD(me, 1, 2, e = makeXonoticSlider(1, 20, 1, "cl_decals_time")); setDependent(e, "cl_decals", 1, 1); - + me.gotoRC(me, me.rows - 1, 0); me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_restart", COMMANDBUTTON_APPLY)); } diff --git a/qcsrc/menu/xonotic/dialog_settings_input.c b/qcsrc/menu/xonotic/dialog_settings_input.c index daa8f3ff1..d8554be4f 100644 --- a/qcsrc/menu/xonotic/dialog_settings_input.c +++ b/qcsrc/menu/xonotic/dialog_settings_input.c @@ -4,7 +4,7 @@ CLASS(XonoticInputSettingsTab) EXTENDS(XonoticTab) ATTRIB(XonoticInputSettingsTab, title, string, _("Input")) ATTRIB(XonoticInputSettingsTab, intendedWidth, float, 0.9) ATTRIB(XonoticInputSettingsTab, rows, float, 17) - ATTRIB(XonoticInputSettingsTab, columns, float, 6.2) // added extra .2 for center space + ATTRIB(XonoticInputSettingsTab, columns, float, 6.2) // added extra .2 for center space ENDCLASS(XonoticInputSettingsTab) entity makeXonoticInputSettingsTab(); #endif @@ -84,8 +84,8 @@ void XonoticInputSettingsTab_fill(entity me) me.TR(me); me.TDempty(me, 0.2); me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "m_accelerate", _("Enable built in mouse acceleration"))); - - + + me.gotoRC(me, me.rows - 1, 0); me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "sendcvar cl_movement_track_canjump", COMMANDBUTTON_APPLY)); } diff --git a/qcsrc/menu/xonotic/dialog_settings_misc_cvars.c b/qcsrc/menu/xonotic/dialog_settings_misc_cvars.c index 5db6d35c6..724c868fd 100644 --- a/qcsrc/menu/xonotic/dialog_settings_misc_cvars.c +++ b/qcsrc/menu/xonotic/dialog_settings_misc_cvars.c @@ -15,17 +15,17 @@ void XonoticCvarsDialog_showNotify(entity me) { loadAllCvars(me); } -void XonoticCvarsDialog_fill(entity me) // in this dialog, use SKINCOLOR_CVARLIST_CONTROLS to color ALL controls +void XonoticCvarsDialog_fill(entity me) // in this dialog, use SKINCOLOR_CVARLIST_CONTROLS to color ALL controls { entity e, cvarlist; cvarlist = makeXonoticCvarList(); - cvarlist.color = - cvarlist.colorF = - cvarlist.color2 = - cvarlist.colorC = + cvarlist.color = + cvarlist.colorF = + cvarlist.color2 = + cvarlist.colorC = SKINCOLOR_CVARLIST_CONTROLS; me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_settings_user.c b/qcsrc/menu/xonotic/dialog_settings_user.c index a3b89744b..5d6a32d56 100644 --- a/qcsrc/menu/xonotic/dialog_settings_user.c +++ b/qcsrc/menu/xonotic/dialog_settings_user.c @@ -60,7 +60,7 @@ void XonoticUserSettingsTab_fill(entity me) me.TD(me, 1, 1.5, e = makeXonoticButton(_("Set font"), '0 0 0')); e.onClick = SetLanguage_Click; e.onClickEntity = sk;*/ - + me.gotoRC(me, 0, 2.85); me.setFirstColumn(me, me.currentColumn); me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Text language:"))); me.TR(me); @@ -74,7 +74,7 @@ void XonoticUserSettingsTab_fill(entity me) me.TD(me, 1, 1.5, e = makeXonoticButton(_("Set language"), '0 0 0')); e.onClick = SetLanguage_Click; e.onClickEntity = sk; - + me.gotoRC(me, 9, 2.2); me.setFirstColumn(me, me.currentColumn); me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "cl_gentle", _("Disable gore effects and harsh language"))); me.TR(me); @@ -83,7 +83,7 @@ void XonoticUserSettingsTab_fill(entity me) me.TR(me); me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "cl_allow_uid2name", _("Allow player statistics to use your nickname"))); setDependent(e, "cl_allow_uidtracking", 1, 1); - + me.gotoRC(me, me.rows - 3, 2.6); me.TD(me, 1, 2, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "sendcvar cl_gentle; sendcvar cl_allow_uidtracking; sendcvar cl_allow_uid2name;", COMMANDBUTTON_APPLY)); diff --git a/qcsrc/menu/xonotic/dialog_settings_video.c b/qcsrc/menu/xonotic/dialog_settings_video.c index 076dd2337..db728d601 100644 --- a/qcsrc/menu/xonotic/dialog_settings_video.c +++ b/qcsrc/menu/xonotic/dialog_settings_video.c @@ -4,7 +4,7 @@ CLASS(XonoticVideoSettingsTab) EXTENDS(XonoticTab) ATTRIB(XonoticVideoSettingsTab, title, string, _("Video")) ATTRIB(XonoticVideoSettingsTab, intendedWidth, float, 0.9) ATTRIB(XonoticVideoSettingsTab, rows, float, 17) - ATTRIB(XonoticVideoSettingsTab, columns, float, 6.2) // added extra .2 for center space + ATTRIB(XonoticVideoSettingsTab, columns, float, 6.2) // added extra .2 for center space ATTRIB(XonoticVideoSettingsTab, name, string, "videosettings") ENDCLASS(XonoticVideoSettingsTab) entity makeXonoticVideoSettingsTab(); @@ -47,7 +47,7 @@ void XonoticVideoSettingsTab_fill(entity me) me.TR(me); me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "vid_fullscreen", _("Full screen"))); me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "vid_vsync", _("Vertical Synchronization"))); - + me.TR(me); me.TR(me); me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Anisotropy:"))); @@ -70,7 +70,7 @@ void XonoticVideoSettingsTab_fill(entity me) me.TR(me); me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 0, "r_viewfbo", _("High-quality frame buffer"))); setDependent(e, "vid_samples", 1, 1); - + me.TR(me); me.TR(me); me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Depth first:"))); diff --git a/qcsrc/menu/xonotic/gametypelist.c b/qcsrc/menu/xonotic/gametypelist.c index 531c761f6..56c25314d 100644 --- a/qcsrc/menu/xonotic/gametypelist.c +++ b/qcsrc/menu/xonotic/gametypelist.c @@ -77,7 +77,7 @@ void XonoticGametypeList_saveCvars(entity me) void XonoticGametypeList_drawListBoxItem(entity me, float i, vector absSize, float isSelected) { string s; - + if(isSelected) draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED); @@ -91,7 +91,7 @@ void XonoticGametypeList_resizeNotify(entity me, vector relOrigin, vector relSiz { me.itemAbsSize = '0 0 0'; SUPER(XonoticServerList).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); - + me.realFontSize_y = me.fontSize / (me.itemAbsSize_y = (absSize_y * me.itemHeight)); me.realFontSize_x = me.fontSize / (me.itemAbsSize_x = (absSize_x * (1 - me.controlWidth))); me.realUpperMargin1 = 0.5 * (1 - me.realFontSize_y); diff --git a/qcsrc/menu/xonotic/mainwindow.c b/qcsrc/menu/xonotic/mainwindow.c index f9d86c2dd..0af90bbe2 100644 --- a/qcsrc/menu/xonotic/mainwindow.c +++ b/qcsrc/menu/xonotic/mainwindow.c @@ -50,61 +50,61 @@ void MainWindow_configureMainWindow(entity me) me.firstRunDialog = i = spawnXonoticFirstRunDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - - + + // hud_configure dialogs i = spawnXonoticHUDExitDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + i = spawnXonoticHUDNotificationDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + i = spawnXonoticHUDAmmoDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + i = spawnXonoticHUDHealthArmorDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + i = spawnXonoticHUDChatDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + i = spawnXonoticHUDModIconsDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + i = spawnXonoticHUDPowerupsDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + i = spawnXonoticHUDPressedKeysDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + i = spawnXonoticHUDRaceTimerDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + i = spawnXonoticHUDRadarDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + i = spawnXonoticHUDScoreDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + i = spawnXonoticHUDTimerDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + i = spawnXonoticHUDVoteDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + i = spawnXonoticHUDWeaponsDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); @@ -124,35 +124,35 @@ void MainWindow_configureMainWindow(entity me) i = spawnXonoticHUDCenterprintDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - - + + // dialogs used by settings me.userbindEditDialog = i = spawnXonoticUserbindEditDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + me.cvarsDialog = i = spawnXonoticCvarsDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - - + + // dialog used by singleplayer me.winnerDialog = i = spawnXonoticWinnerDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - - + + // dialog used by multiplayer/join me.serverInfoDialog = i = spawnXonoticServerInfoDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - - + + // dialogs used by multiplayer/create me.mapInfoDialog = i = spawnXonoticMapInfoDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + me.advancedDialog = i = spawnXonoticAdvancedDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); @@ -160,13 +160,13 @@ void MainWindow_configureMainWindow(entity me) me.mutatorsDialog = i = spawnXonoticMutatorsDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + // dialogs used by multiplayer/player setup me.crosshairDialog = i = spawnXonoticCrosshairDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + me.hudDialog = i = spawnXonoticHUDDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); @@ -174,32 +174,32 @@ void MainWindow_configureMainWindow(entity me) me.hudconfirmDialog = i = spawnXonoticHUDConfirmDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + me.modelDialog = i = spawnXonoticModelDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + me.viewDialog = i = spawnXonoticViewDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + me.weaponsDialog = i = spawnXonoticWeaponsDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + // mutator dialogs i = spawnXonoticSandboxToolsDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS); - - + + // miscellaneous dialogs i = spawnXonoticTeamSelectDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - - + + // main dialogs/windows me.mainNexposee = n = spawnXonoticNexposee(); /* @@ -215,7 +215,7 @@ void MainWindow_configureMainWindow(entity me) i.configureDialog(i); n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y); - + i = spawnXonoticMultiplayerDialog(); i.configureDialog(i); n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); @@ -237,7 +237,7 @@ void MainWindow_configureMainWindow(entity me) n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y); n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight)); - + me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z); me.moveItemAfter(me, n, NULL); diff --git a/qcsrc/menu/xonotic/playerlist.c b/qcsrc/menu/xonotic/playerlist.c index 4c1c62af2..a0f64ca39 100644 --- a/qcsrc/menu/xonotic/playerlist.c +++ b/qcsrc/menu/xonotic/playerlist.c @@ -109,7 +109,7 @@ void XonoticPlayerList_drawListBoxItem(entity me, float i, vector absSize, float rgb = colormapPaletteColor(9, 0); else rgb = '1 1 1'; - + s = me.getPlayerList(me, i, PLAYERPARM_NAME); score = me.getPlayerList(me, i, PLAYERPARM_SCORE); @@ -123,7 +123,7 @@ void XonoticPlayerList_drawListBoxItem(entity me, float i, vector absSize, float score = substring(score, 0, t); if((t = strstrofs(score, ",", 0)) >= 0) score = substring(score, 0, t); - + if(stof(score) == -666) score = _("spectator"); } diff --git a/qcsrc/menu/xonotic/serverlist.c b/qcsrc/menu/xonotic/serverlist.c index 3531b68a2..cb6b0fbcd 100644 --- a/qcsrc/menu/xonotic/serverlist.c +++ b/qcsrc/menu/xonotic/serverlist.c @@ -169,7 +169,7 @@ void ToggleFavorite(string srv) f = 1; --i; } - + if(!f) { s1 = ""; diff --git a/qcsrc/menu/xonotic/skinlist.c b/qcsrc/menu/xonotic/skinlist.c index fdb07870a..3e094e7d7 100644 --- a/qcsrc/menu/xonotic/skinlist.c +++ b/qcsrc/menu/xonotic/skinlist.c @@ -155,13 +155,13 @@ void XonoticSkinList_resizeNotify(entity me, vector relOrigin, vector relSize, v void XonoticSkinList_drawListBoxItem(entity me, float i, vector absSize, float isSelected) { string s; - + if(isSelected) draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED); - + s = me.skinParameter(me, i, SKINPARM_PREVIEW); draw_Picture(me.columnPreviewOrigin * eX, s, me.columnPreviewSize * eX + eY, '1 1 1', 1); - + s = me.skinParameter(me, i, SKINPARM_NAME); s = sprintf(_("%s: %s"), s, me.skinParameter(me, i, SKINPARM_TITLE)); s = draw_TextShortenToWidth(s, me.columnNameSize, 0, me.realFontSize); diff --git a/qcsrc/menu/xonotic/util.qc b/qcsrc/menu/xonotic/util.qc index 808c08535..0f8e341e7 100644 --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@ -313,7 +313,7 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data) n = 0; else n = tokenizebyseparator(data, "\n"); - + if(n >= 1) { _Nex_ExtResponseSystem_UpdateTo = argv(0); @@ -449,7 +449,7 @@ float preMenuInit() boxA = '0.05 0.5 0' + 0.25 * sz_y * eY; boxB = '0.95 0.5 0' + 1.25 * sz_y * eY; draw_Fill(boxA, boxB - boxA, '1 1 1', 1); - + boxA += sz * 0.1; boxB -= sz * 0.1; draw_Fill(boxA, boxB - boxA, '0.1 0.1 0.1', 1); @@ -616,13 +616,13 @@ float GameType_GetID(float cnt) { float i; i = 0; - + #define GAMETYPE(id) if(i++ == cnt) return id; GAMETYPES #undef GAMETYPE unused_float = i; - + return 0; } @@ -630,31 +630,31 @@ float GameType_GetCount() { float i; i = 0; - + #define GAMETYPE(id) ++i; GAMETYPES #undef GAMETYPE - + return i; } string GameType_GetName(float cnt) { float i = GameType_GetID(cnt); - + if(i) return MapInfo_Type_ToText(i); - + return ""; } string GameType_GetIcon(float cnt) { float i = GameType_GetID(cnt); - + if(i) return strcat("gametype_", MapInfo_Type_ToString(i)); - + return ""; } @@ -662,7 +662,7 @@ string GameType_GetIcon(float cnt) { float i = GameType_GetID(cnt); string s = _MapInfo_GetDefaultEx(i); - + if(i) { if(strstrofs(s, "teams", 0) >= 0) @@ -670,7 +670,7 @@ string GameType_GetIcon(float cnt) else return _("free for all"); } - + return _("tuba for all"); }*/ diff --git a/qcsrc/menu/xonotic/weaponslist.c b/qcsrc/menu/xonotic/weaponslist.c index 6790befe1..ad4071060 100644 --- a/qcsrc/menu/xonotic/weaponslist.c +++ b/qcsrc/menu/xonotic/weaponslist.c @@ -68,13 +68,13 @@ float XonoticWeaponsList_mouseDrag(entity me, vector pos) float f, i; i = me.selectedItem; f = SUPER(XonoticWeaponsList).mouseDrag(me, pos); - + if(me.pressed != 1) // don't change priority if the person is just scrolling { if(me.selectedItem != i) cvar_set("cl_weaponpriority", swapInPriorityList(cvar_string("cl_weaponpriority"), me.selectedItem, i)); } - + return f; } string XonoticWeaponsList_toString(entity me) diff --git a/qcsrc/server-testcase/framework.qc b/qcsrc/server-testcase/framework.qc index d9f1add2c..6ec1756ed 100644 --- a/qcsrc/server-testcase/framework.qc +++ b/qcsrc/server-testcase/framework.qc @@ -10,9 +10,9 @@ void spawnfunc_worldspawn() dprint("TESTCASE: START\n"); r = test(); if(r == 1) - error("TESTCASE: PASS"); + error("TESTCASE: PASS"); else if(r == 0) - error("TESTCASE: FAIL"); + error("TESTCASE: FAIL"); else - error("TESTCASE: INVALID"); + error("TESTCASE: INVALID"); } diff --git a/qcsrc/server/antilag.qc b/qcsrc/server/antilag.qc index 5e0a91a3e..c53452ab7 100644 --- a/qcsrc/server/antilag.qc +++ b/qcsrc/server/antilag.qc @@ -11,7 +11,7 @@ void antilag_record(entity e, float t) { if (e.vehicle && e.vehicle.vehicle_flags == VHF_PLAYERSLOT) return; - + if(e.vehicle) antilag_record(e.vehicle, t); diff --git a/qcsrc/server/bot/aim.qc b/qcsrc/server/bot/aim.qc index 578306c4e..3467e2b39 100644 --- a/qcsrc/server/bot/aim.qc +++ b/qcsrc/server/bot/aim.qc @@ -137,11 +137,11 @@ float bot_shouldattack(entity e) return FALSE; if(e.flags & FL_NOTARGET) return FALSE; - + checkentity = e; if(MUTATOR_CALLHOOK(BotShouldAttack)) return FALSE; - + return TRUE; } diff --git a/qcsrc/server/bot/navigation.qc b/qcsrc/server/bot/navigation.qc index 93e513cab..691ce3e0a 100644 --- a/qcsrc/server/bot/navigation.qc +++ b/qcsrc/server/bot/navigation.qc @@ -733,7 +733,7 @@ void navigation_routerating(entity e, float f, float rangebias) t = zdistance / autocvar_g_jetpack_maxspeed_up; t += xydistance / autocvar_g_jetpack_maxspeed_side; fuel = t * autocvar_g_jetpack_fuel * 0.8; - + bot_debug(strcat("jetpack ai: required fuel ", ftos(fuel), " self.ammo_fuel ", ftos(self.ammo_fuel), "\n")); // enough fuel ? diff --git a/qcsrc/server/campaign.qc b/qcsrc/server/campaign.qc index 9beb6e1f0..b6a39ee67 100644 --- a/qcsrc/server/campaign.qc +++ b/qcsrc/server/campaign.qc @@ -21,7 +21,7 @@ float CampaignBailout(string s) return 1; } -string cvar_campaignwrapper_list; // string of format ; var value; var value; var value; +string cvar_campaignwrapper_list; // string of format ; var value; var value; var value; string cvar_string_campaignwrapper(string theCvar) { float p, q; diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index 53c1853a7..5bd3b49a3 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -50,7 +50,7 @@ float CheatsAllowed(float i, float argc, float fr) // the cheat gets passed as a return 0; if(gamestart_sv_cheats < 2 && !IS_PLAYER(self)) return 0; - + // sv_clones if(i == CHIMPULSE_CLONE_MOVING || i == CHIMPULSE_CLONE_STANDING) if(self.lip < sv_clones) @@ -59,7 +59,7 @@ float CheatsAllowed(float i, float argc, float fr) // the cheat gets passed as a // haha if(self.maycheat) return 1; - + // sv_cheats if(gamestart_sv_cheats && autocvar_sv_cheats) return 1; @@ -190,7 +190,7 @@ float CheatImpulse(float i) self.oldvelocity = self.velocity = self.personal.velocity; self.angles = self.personal.v_angle; self.fixangle = TRUE; - + MUTATOR_CALLHOOK(AbortSpeedrun); } diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index ab886c896..65443f478 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -167,7 +167,7 @@ void PutObserverInServer (void) MUTATOR_CALLHOOK(MakePlayerObserver); Portal_ClearAll(self); - + if(self.alivetime) { if(!warmup_stage) @@ -176,7 +176,7 @@ void PutObserverInServer (void) } if(self.vehicle) - vehicles_exit(VHEF_RELESE); + vehicles_exit(VHEF_RELESE); WaypointSprite_PlayerDead(); @@ -198,7 +198,7 @@ void PutObserverInServer (void) accuracy_resend(self); self.spectatortime = time; - + self.classname = "observer"; self.iscreature = FALSE; self.teleportable = TELEPORT_SIMPLE; @@ -558,7 +558,7 @@ void PutClientInServer (void) //stuffcmd(self, "chase_active 0"); //stuffcmd(self, "set viewsize $tmpviewsize \n"); - + target_voicescript_clear(self); // reset fields the weapons may use @@ -766,7 +766,7 @@ void ClientKill_Now() if(!self.killindicator_teamchange) { self.vehicle_health = -1; - Damage(self, self, self, 1 , DEATH_KILL, self.origin, '0 0 0'); + Damage(self, self, self, 1 , DEATH_KILL, self.origin, '0 0 0'); } } @@ -934,7 +934,7 @@ void ClientKill (void) if(gameover) return; if(self.player_blocked) return; if(self.freezetag_frozen) return; - + ClientKill_TeamChange(0); } @@ -1277,7 +1277,7 @@ void ClientDisconnect (void) if(autocvar_sv_eventlog) GameLogEcho(strcat(":part:", ftos(self.playerid))); - + Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_QUIT_DISCONNECT, self.netname); MUTATOR_CALLHOOK(ClientDisconnect); @@ -1516,7 +1516,7 @@ void player_powerups (void) self.superweapons_finished = 0; } } - + if(autocvar_g_nodepthtestplayers) self.effects = self.effects | EF_NODEPTHTEST; @@ -1730,7 +1730,7 @@ void SpectateCopy(entity spectatee) { setorigin(self, spectatee.origin); setsize(self, spectatee.mins, spectatee.maxs); SetZoomState(spectatee.zoomstate); - + anticheat_spectatecopy(spectatee); self.hud = spectatee.hud; if(spectatee.vehicle) @@ -1746,22 +1746,22 @@ void SpectateCopy(entity spectatee) { self.vehicle_reload2 = spectatee.vehicle_reload2; msg_entity = self; - + WriteByte (MSG_ONE, SVC_SETVIEWANGLES); WriteAngle(MSG_ONE, spectatee.v_angle_x); WriteAngle(MSG_ONE, spectatee.v_angle_y); WriteAngle(MSG_ONE, spectatee.v_angle_z); //WriteByte (MSG_ONE, SVC_SETVIEW); - // WriteEntity(MSG_ONE, self); + // WriteEntity(MSG_ONE, self); //makevectors(spectatee.v_angle); - //setorigin(self, spectatee.origin - v_forward * 400 + v_up * 300);*/ + //setorigin(self, spectatee.origin - v_forward * 400 + v_up * 300);*/ } } float SpectateUpdate() { if(!self.enemy) - return 0; + return 0; if (self == self.enemy) return 0; @@ -1820,13 +1820,13 @@ entity CA_SpectateNext(entity start) { if (start.team == self.team) { return start; } - + other = start; // continue from current player while(other && other.team != self.team) { other = find(other, classname, "player"); } - + if (!other) { // restart from begining other = find(other, classname, "player"); @@ -1834,7 +1834,7 @@ entity CA_SpectateNext(entity start) { other = find(other, classname, "player"); } } - + return other; } @@ -2143,7 +2143,7 @@ void PlayerUseKey() vehicles_exit(VHEF_NORMAL); return; } - + // a use key was pressed; call handlers MUTATOR_CALLHOOK(PlayerUseKey); } @@ -2305,7 +2305,7 @@ void PlayerPreThink (void) if(frametime) player_anim(); button_pressed = (self.BUTTON_ATCK || self.BUTTON_JUMP || self.BUTTON_ATCK2 || self.BUTTON_HOOK || self.BUTTON_USE); - + if (self.deadflag == DEAD_DYING) { if(self.respawn_flags & RESPAWN_FORCE) @@ -2410,10 +2410,10 @@ void PlayerPreThink (void) if(frametime) player_anim(); - + // secret status secrets_setstatus(); - + self.dmg_team = max(0, self.dmg_team - autocvar_g_teamdamage_resetspeed * frametime); //self.angles_y=self.v_angle_y + 90; // temp @@ -2573,7 +2573,7 @@ void PlayerPostThink (void) return; // intermission or finale GetPressedKeys(); } - + #ifdef TETRIS } #endif diff --git a/qcsrc/server/cl_impulse.qc b/qcsrc/server/cl_impulse.qc index dc8dabee6..a4376bd41 100644 --- a/qcsrc/server/cl_impulse.qc +++ b/qcsrc/server/cl_impulse.qc @@ -52,13 +52,13 @@ void ImpulseCommands (void) if (timeout_status == TIMEOUT_ACTIVE) //don't allow any impulses while the game is paused return; - + if(self.vehicle) if(self.vehicle.deadflag == DEAD_NO) if(self.vehicle.vehicles_impusle) if(self.vehicle.vehicles_impusle(imp)) return; - + if(CheatImpulse(imp)) { } diff --git a/qcsrc/server/cl_physics.qc b/qcsrc/server/cl_physics.qc index 9531010ec..edad6d63f 100644 --- a/qcsrc/server/cl_physics.qc +++ b/qcsrc/server/cl_physics.qc @@ -24,11 +24,11 @@ void PlayerJump (void) player_multijump = doublejump; if(MUTATOR_CALLHOOK(PlayerJump)) return; - + doublejump = player_multijump; float mjumpheight; - + if (autocvar_sv_doublejump) { tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self); @@ -110,7 +110,7 @@ void PlayerJump (void) self.flags &= ~FL_JUMPRELEASED; animdecide_setaction(self, ANIMACTION_JUMP, TRUE); - + if(autocvar_g_jump_grunt) PlayerSound(playersound_jump, CH_PLAYER, VOICETYPE_PLAYERSOUND); @@ -517,9 +517,9 @@ void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float acce } else vel_perpend = vel_perpend * max(0, 1 - frametime * wishspeed * sidefric); - + vel_xy = vel_straight * wishdir + vel_perpend; - + if(speedclamp >= 0) { float vel_xy_preclamp; @@ -633,7 +633,7 @@ void SV_PlayerPhysics() string c; WarpZone_PlayerPhysics_FixVAngle(); - + maxspd_mod = 1; if(self.ballcarried) if(g_nexball) @@ -747,7 +747,7 @@ void SV_PlayerPhysics() return; bot_think(); } - + self.items &= ~IT_USING_JETPACK; if(IS_PLAYER(self)) diff --git a/qcsrc/server/cl_weapons.qc b/qcsrc/server/cl_weapons.qc index 8eaf8addc..88397a880 100644 --- a/qcsrc/server/cl_weapons.qc +++ b/qcsrc/server/cl_weapons.qc @@ -307,7 +307,7 @@ float W_IsWeaponThrowable(float w) return 0; if(w == 0) return 0; - + wa = W_AmmoItemCode(w); if(start_weapons & WepSet_FromWeapon(w)) { @@ -345,7 +345,7 @@ void W_ThrowWeapon(vector velo, vector delta, float doreduce) W_SwitchWeapon_Force(self, w_getbestweapon(self)); a = W_ThrowNewWeapon(self, w, doreduce, self.origin + delta, velo); - + if (!a) return; Send_Notification(NOTIF_ONE, self, MSG_MULTI, ITEM_WEAPON_DROP, a, w); } @@ -435,7 +435,7 @@ void W_WeaponFrame() self.switchingweapon = self.switchweapon; entity oldwep = get_weaponinfo(self.weapon); - + #ifndef INDEPENDENT_ATTACK_FINISHED if(ATTACK_FINISHED(self) <= time + self.weapon_frametime * 0.5) { diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index 0c442d2af..8d72a798b 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -541,7 +541,7 @@ void CL_Weaponentity_Think() } self.angles = '0 0 0'; - + float f = (self.owner.weapon_nextthink - time); if (self.state == WS_RAISE && !intermission_running) { @@ -667,7 +667,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) complain = 0; if(complain) self.hasweapon_complain_spam = time + 0.2; - + if(wpn == WEP_HOOK && !g_grappling_hook && autocvar_g_nades && !((cl.weapons | weaponsInMap) & WepSet_FromWeapon(wpn))) complain = 0; @@ -851,7 +851,7 @@ float weapon_prepareattack_checkammo(float secondary) { W_SwitchToOtherWeapon(self); } - + return FALSE; } return TRUE; @@ -1129,7 +1129,7 @@ vector W_CalculateProjectileSpread(vector forward, float spread) if(spread <= 0) return forward; sstyle = autocvar_g_projectiles_spread_style; - + if(sstyle == 0) { // this is the baseline for the spread value! diff --git a/qcsrc/server/command/banning.qc b/qcsrc/server/command/banning.qc index 1694bb661..794854ded 100644 --- a/qcsrc/server/command/banning.qc +++ b/qcsrc/server/command/banning.qc @@ -14,9 +14,9 @@ void BanCommand_ban(float request, float argc, string command) string ip = argv(1); float reason_arg, bantime; string reason; - - reason_arg = 2; - + + reason_arg = 2; + GET_BAN_ARG(bantime, autocvar_g_ban_default_bantime); GET_BAN_REASON(reason, "No reason provided"); @@ -24,7 +24,7 @@ void BanCommand_ban(float request, float argc, string command) return; } } - + default: print("Incorrect parameters for ^2ban^7\n"); case CMD_REQUEST_USAGE: @@ -48,7 +48,7 @@ void BanCommand_banlist(float request) Ban_View(); return; } - + default: case CMD_REQUEST_USAGE: { @@ -72,26 +72,26 @@ void BanCommand_kickban(float request, float argc, string command) float accepted = VerifyClientEntity(client, TRUE, FALSE); float reason_arg, bantime, masksize; string reason; - - if(accepted > 0) + + if(accepted > 0) { - reason_arg = next_token; + reason_arg = next_token; GET_BAN_ARG(bantime, autocvar_g_ban_default_bantime); GET_BAN_ARG(masksize, autocvar_g_ban_default_masksize); GET_BAN_REASON(reason, "No reason provided"); Ban_KickBanClient(client, bantime, masksize, reason); - + return; } else { - print("kickban: ", GetClientErrorString(accepted, argv(1)), ".\n"); + print("kickban: ", GetClientErrorString(accepted, argv(1)), ".\n"); } } } - + default: print("Incorrect parameters for ^2kickban^7\n"); case CMD_REQUEST_USAGE: @@ -117,19 +117,19 @@ void BanCommand_mute(float request, float argc, string command) // TODO: Add a s { entity client = GetFilteredEntity(argv(1)); float accepted = VerifyClientEntity(client, TRUE, FALSE); - - if(accepted > 0) + + if(accepted > 0) { client.muted = TRUE; return; } else { - print("mute: ", GetClientErrorString(accepted, argv(1)), ".\n"); + print("mute: ", GetClientErrorString(accepted, argv(1)), ".\n"); } } } - + default: print("Incorrect parameters for ^2mute^7\n"); case CMD_REQUEST_USAGE: @@ -147,16 +147,16 @@ void BanCommand_unban(float request, float argc) switch(request) { case CMD_REQUEST_COMMAND: - { + { if(argv(1)) { float tmp_number = -1; string tmp_string; - + if(substring(argv(1), 0, 1) == "#") { tmp_string = substring(argv(1), 1, -1); - + if(tmp_string != "") // is it all one token? like #1 { tmp_number = stof(tmp_string); @@ -171,7 +171,7 @@ void BanCommand_unban(float request, float argc) else // maybe it's ONLY a number? { tmp_number = stof(argv(1)); - + if((tmp_number == 0) && (argv(1) != "0")) { tmp_number = -1; } } @@ -183,7 +183,7 @@ void BanCommand_unban(float request, float argc) } } } - + default: case CMD_REQUEST_USAGE: { @@ -205,19 +205,19 @@ void BanCommand_unmute(float request, float argc) { entity client = GetFilteredEntity(argv(1)); float accepted = VerifyClientEntity(client, TRUE, FALSE); - - if(accepted > 0) + + if(accepted > 0) { client.muted = FALSE; return; } else { - print("unmute: ", GetClientErrorString(accepted, argv(1)), ".\n"); + print("unmute: ", GetClientErrorString(accepted, argv(1)), ".\n"); } } } - + default: print("Incorrect parameters for ^2mute^7\n"); case CMD_REQUEST_USAGE: @@ -238,10 +238,10 @@ void BanCommand_(float request) { case CMD_REQUEST_COMMAND: { - + return; } - + default: case CMD_REQUEST_USAGE: { @@ -272,10 +272,10 @@ void BanCommand_macro_help() { #define BAN_COMMAND(name,function,description) \ { if(strtolower(description) != "") { print(" ^2", name, "^7: ", description, "\n"); } } - + BAN_COMMANDS(0, 0, "") #undef BAN_COMMAND - + return; } @@ -283,10 +283,10 @@ float BanCommand_macro_command(float argc, string command) { #define BAN_COMMAND(name,function,description) \ { if(name == strtolower(argv(0))) { function; return TRUE; } } - + BAN_COMMANDS(CMD_REQUEST_COMMAND, argc, command) #undef BAN_COMMAND - + return FALSE; } @@ -294,10 +294,10 @@ float BanCommand_macro_usage(float argc) { #define BAN_COMMAND(name,function,description) \ { if(name == strtolower(argv(1))) { function; return TRUE; } } - + BAN_COMMANDS(CMD_REQUEST_USAGE, argc, "") #undef BAN_COMMAND - + return FALSE; } @@ -305,26 +305,26 @@ void BanCommand_macro_write_aliases(float fh) { #define BAN_COMMAND(name,function,description) \ { if(strtolower(description) != "") { CMD_Write_Alias("qc_cmd_sv", name, description); } } - + BAN_COMMANDS(0, 0, "") #undef BAN_COMMAND - + return; } float BanCommand(string command) { float argc = tokenize_console(command); - + // Guide for working with argc arguments by example: // argc: 1 - 2 - 3 - 4 - // argv: 0 - 1 - 2 - 3 + // argv: 0 - 1 - 2 - 3 // cmd vote - master - login - password if(BanCommand_macro_command(argc, command)) // continue as usual and scan for normal commands { return TRUE; // handled by one of the above GenericCommand_* functions } - + return FALSE; } diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index 44cc46a02..08bf940db 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -39,13 +39,13 @@ void ClientCommand_autoswitch(float request, float argc) return; } } - + default: sprint(self, "Incorrect parameters for ^2autoswitch^7\n"); case CMD_REQUEST_USAGE: { sprint(self, "\nUsage:^3 cmd autoswitch selection\n"); - sprint(self, " Where 'selection' controls if autoswitch is on or off.\n"); + sprint(self, " Where 'selection' controls if autoswitch is on or off.\n"); return; } } @@ -61,7 +61,7 @@ void ClientCommand_checkfail(float request, string command) // internal command, self.checkfail = 1; return; // never fall through to usage } - + default: sprint(self, "Incorrect parameters for ^2checkfail^7\n"); case CMD_REQUEST_USAGE: @@ -84,27 +84,27 @@ void ClientCommand_clientversion(float request, float argc) // internal command, if(IS_CLIENT(self)) { self.version = ((argv(1) == "$gameversion") ? 1 : stof(argv(1))); - + if(self.version < autocvar_gameversion_min || self.version > autocvar_gameversion_max) { self.version_mismatch = 1; ClientKill_TeamChange(-2); // observe - } - else if(autocvar_g_campaign || autocvar_g_balance_teams) + } + else if(autocvar_g_campaign || autocvar_g_balance_teams) { //JoinBestTeam(self, FALSE, TRUE); - } - else if(teamplay && !autocvar_sv_spectate && !(self.team_forced > 0)) + } + else if(teamplay && !autocvar_sv_spectate && !(self.team_forced > 0)) { self.classname = "observer"; // really? stuffcmd(self, "menu_showteamselect\n"); } } - + return; } } - + default: sprint(self, "Incorrect parameters for ^2clientversion^7\n"); case CMD_REQUEST_USAGE: @@ -124,13 +124,13 @@ void ClientCommand_mv_getpicture(float request, float argc) // internal command, { if(argv(1) != "") { - if(intermission_running) + if(intermission_running) MapVote_SendPicture(stof(argv(1))); return; } } - + default: sprint(self, "Incorrect parameters for ^2mv_getpicture^7\n"); case CMD_REQUEST_USAGE: @@ -142,7 +142,7 @@ void ClientCommand_mv_getpicture(float request, float argc) // internal command, } } -void ClientCommand_join(float request) +void ClientCommand_join(float request) { switch(request) { @@ -152,7 +152,7 @@ void ClientCommand_join(float request) { if(!IS_PLAYER(self) && !lockteams && !g_arena) { - if(nJoinAllowed(self)) + if(nJoinAllowed(self)) { if(autocvar_g_campaign) { campaign_bots_may_start = 1; } @@ -162,7 +162,7 @@ void ClientCommand_join(float request) Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_JOIN_PLAY, self.netname); PutClientInServer(); } - else + else { //player may not join because of g_maxplayers is set Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_JOIN_PREVENT); @@ -171,7 +171,7 @@ void ClientCommand_join(float request) } return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -217,7 +217,7 @@ void ClientCommand_ready(float request) // todo: anti-spam for toggling readynes } return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -237,7 +237,7 @@ void ClientCommand_say(float request, float argc, string command) if(argc >= 2) { Say(self, FALSE, world, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1); } return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -257,7 +257,7 @@ void ClientCommand_say_team(float request, float argc, string command) if(argc >= 2) { Say(self, TRUE, world, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1); } return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -280,10 +280,10 @@ void ClientCommand_selectteam(float request, float argc) { if(teamplay) if(self.team_forced <= 0) - if (!lockteams) + if (!lockteams) { float selection; - + switch(argv(1)) { case "red": selection = NUM_TEAM_1; break; @@ -291,10 +291,10 @@ void ClientCommand_selectteam(float request, float argc) case "yellow": selection = NUM_TEAM_3; break; case "pink": selection = NUM_TEAM_4; break; case "auto": selection = (-1); break; - + default: selection = 0; break; } - + if(selection) { if(self.team == selection && self.deadflag == DEAD_NO) @@ -312,7 +312,7 @@ void ClientCommand_selectteam(float request, float argc) else sprint(self, "^7selectteam can only be used in teamgames\n"); } - return; + return; } } @@ -340,7 +340,7 @@ void ClientCommand_selfstuff(float request, string command) return; } } - + default: sprint(self, "Incorrect parameters for ^2selectteam^7\n"); case CMD_REQUEST_USAGE: @@ -362,19 +362,19 @@ void ClientCommand_sentcvar(float request, float argc, string command) { //float tokens; string s; - + if(argc == 2) // undefined cvar: use the default value on the server then { s = strcat(substring(command, argv_start_index(0), argv_end_index(1) - argv_start_index(0)), " \"", cvar_defstring(argv(1)), "\""); tokenize_console(s); } - + GetCvars(1); - + return; } } - + default: sprint(self, "Incorrect parameters for ^2sentcvar^7\n"); case CMD_REQUEST_USAGE: @@ -386,7 +386,7 @@ void ClientCommand_sentcvar(float request, float argc, string command) } } -void ClientCommand_spectate(float request) +void ClientCommand_spectate(float request) { switch(request) { @@ -394,7 +394,7 @@ void ClientCommand_spectate(float request) { if(IS_CLIENT(self)) { - if(g_arena) { return; } + if(g_arena) { return; } if(g_lms) { if(self.lms_spectate_warning) @@ -411,8 +411,8 @@ void ClientCommand_spectate(float request) return; } } - - if(IS_PLAYER(self) && autocvar_sv_spectate == 1) + + if(IS_PLAYER(self) && autocvar_sv_spectate == 1) ClientKill_TeamChange(-2); // observe // in CA, allow a dead player to move to spectators (without that, caplayer!=0 will be moved back to the player list) @@ -425,7 +425,7 @@ void ClientCommand_spectate(float request) } return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -448,7 +448,7 @@ void ClientCommand_suggestmap(float request, float argc) return; } } - + default: sprint(self, "Incorrect parameters for ^2suggestmap^7\n"); case CMD_REQUEST_USAGE: @@ -470,7 +470,7 @@ void ClientCommand_tell(float request, float argc, string command) { entity tell_to = GetIndexedEntity(argc, 1); float tell_accepted = VerifyClientEntity(tell_to, TRUE, FALSE); - + if(tell_accepted > 0) // the target is a real client { if(tell_to != self) // and we're allowed to send to them :D @@ -480,15 +480,15 @@ void ClientCommand_tell(float request, float argc, string command) } else { print_to(self, "You can't ^2tell^7 a message to yourself."); return; } } - else if(argv(1) == "#0") - { + else if(argv(1) == "#0") + { trigger_magicear_processmessage_forallears(self, -1, world, substring(command, argv_start_index(next_token), argv_end_index(-1) - argv_start_index(next_token))); return; } else { print_to(self, strcat("tell: ", GetClientErrorString(tell_accepted, argv(1)), ".")); return; } } } - + default: sprint(self, "Incorrect parameters for ^2tell^7\n"); case CMD_REQUEST_USAGE: @@ -500,7 +500,7 @@ void ClientCommand_tell(float request, float argc, string command) } } -void ClientCommand_voice(float request, float argc, string command) +void ClientCommand_voice(float request, float argc, string command) { switch(request) { @@ -512,11 +512,11 @@ void ClientCommand_voice(float request, float argc, string command) VoiceMessage(argv(1), substring(command, argv_start_index(2), argv_end_index(-1) - argv_start_index(2))); else VoiceMessage(argv(1), ""); - + return; } } - + default: sprint(self, "Incorrect parameters for ^2voice^7\n"); case CMD_REQUEST_USAGE: @@ -537,10 +537,10 @@ void ClientCommand_(float request) { case CMD_REQUEST_COMMAND: { - + return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -575,15 +575,15 @@ void ClientCommand_(float request) CLIENT_COMMAND("tell", ClientCommand_tell(request, arguments, command), "Send a message directly to a player") \ CLIENT_COMMAND("voice", ClientCommand_voice(request, arguments, command), "Send voice message via sound") \ /* nothing */ - + void ClientCommand_macro_help() { #define CLIENT_COMMAND(name,function,description) \ { sprint(self, " ^2", name, "^7: ", description, "\n"); } - + CLIENT_COMMANDS(0, 0, "") #undef CLIENT_COMMAND - + return; } @@ -591,10 +591,10 @@ float ClientCommand_macro_command(float argc, string command) { #define CLIENT_COMMAND(name,function,description) \ { if(name == strtolower(argv(0))) { function; return TRUE; } } - + CLIENT_COMMANDS(CMD_REQUEST_COMMAND, argc, command) #undef CLIENT_COMMAND - + return FALSE; } @@ -602,21 +602,21 @@ float ClientCommand_macro_usage(float argc) { #define CLIENT_COMMAND(name,function,description) \ { if(name == strtolower(argv(1))) { function; return TRUE; } } - + CLIENT_COMMANDS(CMD_REQUEST_USAGE, argc, "") #undef CLIENT_COMMAND - + return FALSE; } void ClientCommand_macro_write_aliases(float fh) { #define CLIENT_COMMAND(name,function,description) \ - { CMD_Write_Alias("qc_cmd_cmd", name, description); } - + { CMD_Write_Alias("qc_cmd_cmd", name, description); } + CLIENT_COMMANDS(0, 0, "") #undef CLIENT_COMMAND - + return; } @@ -632,17 +632,17 @@ void SV_ParseClientCommand(string command) return; float argc = tokenize_console(command); - + // for the mutator hook system cmd_name = strtolower(argv(0)); cmd_argc = argc; cmd_string = command; - + // Guide for working with argc arguments by example: // argc: 1 - 2 - 3 - 4 - // argv: 0 - 1 - 2 - 3 + // argv: 0 - 1 - 2 - 3 // cmd vote - master - login - password - + // for floodcheck switch(strtolower(argv(0))) { @@ -654,29 +654,29 @@ void SV_ParseClientCommand(string command) case "prespawn": break; // handled by engine in host_cmd.c case "sentcvar": break; // handled by server in this file case "spawn": break; // handled by engine in host_cmd.c - - default: + + default: if(SV_ParseClientCommand_floodcheck()) break; // "TRUE": continue, as we're not flooding yet else return; // "FALSE": not allowed to continue, halt // print("^1ERROR: ^7ANTISPAM CAUGHT: ", command, ".\n"); } - + /* NOTE: should this be disabled? It can be spammy perhaps, but hopefully it's okay for now */ - if(argv(0) == "help") + if(argv(0) == "help") { - if(argc == 1) + if(argc == 1) { sprint(self, "\nClient networked commands:\n"); ClientCommand_macro_help(); - + sprint(self, "\nCommon networked commands:\n"); CommonCommand_macro_help(self); - + sprint(self, "\nUsage:^3 cmd COMMAND...^7, where possible commands are listed above.\n"); sprint(self, "For help about a specific command, type cmd help COMMAND\n"); return; - } + } else if(CommonCommand_macro_usage(argc, self)) // Instead of trying to call a command, we're going to see detailed information about it { return; @@ -685,12 +685,12 @@ void SV_ParseClientCommand(string command) { return; } - } + } else if(MUTATOR_CALLHOOK(SV_ParseClientCommand)) { return; // handled by a mutator } - else if(CheatCommand(argc)) + else if(CheatCommand(argc)) { return; // handled by server/cheats.qc } diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index 14754f501..c5ae7c7be 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -30,7 +30,7 @@ float VerifyClientEntity(entity client, float must_be_real, float must_be_bots) return CLIENT_NOT_REAL; else if(must_be_bots && !IS_BOT_CLIENT(client)) return CLIENT_NOT_BOT; - + return CLIENT_ACCEPTABLE; } @@ -60,18 +60,18 @@ entity GetIndexedEntity(float argc, float start_index) entity tmp_player, selection; float tmp_number, index; string tmp_string; - + next_token = -1; index = start_index; selection = world; - + if(argc > start_index) { if(substring(argv(index), 0, 1) == "#") { tmp_string = substring(argv(index), 1, -1); ++index; - + if(tmp_string != "") // is it all one token? like #1 { tmp_number = stof(tmp_string); @@ -89,7 +89,7 @@ entity GetIndexedEntity(float argc, float start_index) tmp_number = stof(argv(index)); ++index; } - + if(VerifyClientNumber(tmp_number)) { selection = edict_num(tmp_number); // yes, it was a number @@ -99,11 +99,11 @@ entity GetIndexedEntity(float argc, float start_index) FOR_EACH_CLIENT(tmp_player) if (strdecolorize(tmp_player.netname) == strdecolorize(argv(start_index))) selection = tmp_player; - + index = (start_index + 1); } } - + next_token = index; //print(strcat("start_index: ", ftos(start_index), ", next_token: ", ftos(next_token), ", edict: ", ftos(num_for_edict(selection)), ".\n")); return selection; @@ -114,12 +114,12 @@ entity GetFilteredEntity(string input) { entity tmp_player, selection; float tmp_number; - + if(substring(input, 0, 1) == "#") tmp_number = stof(substring(input, 1, -1)); else tmp_number = stof(input); - + if(VerifyClientNumber(tmp_number)) { selection = edict_num(tmp_number); @@ -131,7 +131,7 @@ entity GetFilteredEntity(string input) if (strdecolorize(tmp_player.netname) == strdecolorize(input)) selection = tmp_player; } - + return selection; } @@ -140,7 +140,7 @@ float GetFilteredNumber(string input) { entity selection = GetFilteredEntity(input); float output; - + output = num_for_edict(selection); return output; @@ -165,14 +165,14 @@ void timeout_handler_reset() timeout_caller = world; timeout_time = 0; timeout_leadtime = 0; - + remove(self); } -void timeout_handler_think() +void timeout_handler_think() { entity tmp_player; - + switch(timeout_status) { case TIMEOUT_ACTIVE: @@ -190,53 +190,53 @@ void timeout_handler_think() else // time to end the timeout { timeout_status = TIMEOUT_INACTIVE; - + // reset the slowmo value back to normal cvar_set("slowmo", ftos(orig_slowmo)); - + // unlock the view for players so they can move around again - FOR_EACH_REALPLAYER(tmp_player) + FOR_EACH_REALPLAYER(tmp_player) tmp_player.fixangle = FALSE; - + timeout_handler_reset(); } - + return; } - + case TIMEOUT_LEADTIME: { if(timeout_leadtime > 0) // countdown is still going { Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_TIMEOUT_BEGINNING, timeout_leadtime); - + self.nextthink = time + 1; // think again in one second timeout_leadtime -= 1; // decrease the time counter } else // time to begin the timeout { timeout_status = TIMEOUT_ACTIVE; - + // set the slowmo value to the timeout default slowmo value cvar_set("slowmo", ftos(TIMEOUT_SLOWMO_VALUE)); - + // reset all the flood variables FOR_EACH_CLIENT(tmp_player) tmp_player.nickspamcount = tmp_player.nickspamtime = tmp_player.floodcontrol_chat = - tmp_player.floodcontrol_chatteam = tmp_player.floodcontrol_chattell = + tmp_player.floodcontrol_chatteam = tmp_player.floodcontrol_chattell = tmp_player.floodcontrol_voice = tmp_player.floodcontrol_voiceteam = 0; - + // copy .v_angle to .lastV_angle for every player in order to fix their view during pause (see PlayerPreThink) - FOR_EACH_REALPLAYER(tmp_player) + FOR_EACH_REALPLAYER(tmp_player) tmp_player.lastV_angle = tmp_player.v_angle; - + self.nextthink = time; // think again next frame to handle it under TIMEOUT_ACTIVE code } - + return; } - - + + case TIMEOUT_INACTIVE: default: { @@ -261,7 +261,7 @@ void CommonCommand_cvar_changes(float request, entity caller) print_to(caller, cvar_changes); return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -282,7 +282,7 @@ void CommonCommand_cvar_purechanges(float request, entity caller) print_to(caller, cvar_purechanges); return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -294,22 +294,22 @@ void CommonCommand_cvar_purechanges(float request, entity caller) } } -void CommonCommand_info(float request, entity caller, float argc) -{ +void CommonCommand_info(float request, entity caller, float argc) +{ switch(request) { case CMD_REQUEST_COMMAND: { - string command = builtin_cvar_string(strcat("sv_info_", argv(1))); - + string command = builtin_cvar_string(strcat("sv_info_", argv(1))); + if(command) - wordwrap_sprint(command, 1000); + wordwrap_sprint(command, 1000); else print_to(caller, "ERROR: unsupported info command"); - + return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -329,7 +329,7 @@ void CommonCommand_ladder(float request, entity caller) print_to(caller, ladder_reply); return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -349,7 +349,7 @@ void CommonCommand_lsmaps(float request, entity caller) print_to(caller, lsmaps_reply); return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -369,7 +369,7 @@ void CommonCommand_printmaplist(float request, entity caller) print_to(caller, maplist_reply); return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -389,7 +389,7 @@ void CommonCommand_rankings(float request, entity caller) print_to(caller, rankings_reply); return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -401,20 +401,20 @@ void CommonCommand_rankings(float request, entity caller) } void CommonCommand_records(float request, entity caller) -{ +{ switch(request) { case CMD_REQUEST_COMMAND: { float i; - + for(i = 0; i < 10; ++i) if(records_reply[i] != "") print_to(caller, records_reply[i]); - + return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -434,7 +434,7 @@ void CommonCommand_teamstatus(float request, entity caller) Score_NicePrint(caller); return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -460,7 +460,7 @@ void CommonCommand_time(float request, entity caller) print_to(caller, strcat("gmtime = ", strftime(FALSE, "%a %b %e %H:%M:%S %Z %Y"))); return; } - + default: case CMD_REQUEST_USAGE: { @@ -481,7 +481,7 @@ void CommonCommand_timein(float request, entity caller) { if (!timeout_status) { print_to(caller, "^7Error: There is no active timeout called."); } else if(caller && (caller != timeout_caller)) { print_to(caller, "^7Error: You are not allowed to stop the active timeout."); } - + else // everything should be okay, continue aborting timeout { switch(timeout_status) @@ -494,7 +494,7 @@ void CommonCommand_timein(float request, entity caller) bprint(strcat("^7The timeout was aborted by ", GetCallerName(caller), " !\n")); return; } - + case TIMEOUT_ACTIVE: { timeout_time = autocvar_sv_timeout_resumetime; @@ -502,16 +502,16 @@ void CommonCommand_timein(float request, entity caller) bprint(strcat("^1Attention: ^7", GetCallerName(caller), " resumed the game! Prepare for battle!\n")); return; } - + default: dprint("timeout status was inactive, but this code was executed anyway?"); return; } } } else { print_to(caller, "^1Timeins are not allowed to be called, enable them with sv_timeout 1.\n"); } - + return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -531,7 +531,7 @@ void CommonCommand_timeout(float request, entity caller) // DEAR GOD THIS COMMAN if(!caller || autocvar_sv_timeout) { float last_possible_timeout = ((autocvar_timelimit * 60) - autocvar_sv_timeout_leadtime - 1); - + if(timeout_status) { print_to(caller, "^7Error: A timeout is already active."); } else if(vote_called) { print_to(caller, "^7Error: You can not call a timeout while a vote is active."); } else if(warmup_stage && !g_warmup_allow_timeout) { print_to(caller, "^7Error: You can not call a timeout in warmup-stage."); } @@ -539,18 +539,18 @@ void CommonCommand_timeout(float request, entity caller) // DEAR GOD THIS COMMAN else if(caller && (caller.allowed_timeouts < 1)) { print_to(caller, "^7Error: You already used all your timeout calls for this map."); } else if(caller && !IS_PLAYER(caller)) { print_to(caller, "^7Error: You must be a player to call a timeout."); } else if((autocvar_timelimit) && (last_possible_timeout < time - game_starttime)) { print_to(caller, "^7Error: It is too late to call a timeout now!"); } - + else // everything should be okay, proceed with starting the timeout - { + { if(caller) { caller.allowed_timeouts -= 1; } - + bprint(GetCallerName(caller), " ^7called a timeout", (caller ? strcat(" (", ftos(caller.allowed_timeouts), " timeout(s) left)") : ""), "!\n"); // write a bprint who started the timeout (and how many they have left) - + timeout_status = TIMEOUT_LEADTIME; timeout_caller = caller; timeout_time = autocvar_sv_timeout_length; timeout_leadtime = autocvar_sv_timeout_leadtime; - + timeout_handler = spawn(); timeout_handler.think = timeout_handler_think; timeout_handler.nextthink = time; // always let the entity think asap @@ -559,10 +559,10 @@ void CommonCommand_timeout(float request, entity caller) // DEAR GOD THIS COMMAN } } else { print_to(caller, "^1Timeouts are not allowed to be called, enable them with sv_timeout 1.\n"); } - + return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -581,20 +581,20 @@ void CommonCommand_who(float request, entity caller, float argc) { float total_listed_players, is_bot; entity tmp_player; - + float privacy = (caller && autocvar_sv_status_privacy); string separator = strreplace("%", " ", strcat((argv(1) ? argv(1) : " "), "^7")); string tmp_netaddress, tmp_crypto_idfp; - + print_to(caller, strcat("List of client information", (privacy ? " (some data is hidden for privacy)" : ""), ":")); - print_to(caller, sprintf(strreplace(" ", separator, " %-4s %-20s %-5s %-3s %-9s %-16s %s "), + print_to(caller, sprintf(strreplace(" ", separator, " %-4s %-20s %-5s %-3s %-9s %-16s %s "), "ent", "nickname", "ping", "pl", "time", "ip", "crypto_id")); - + total_listed_players = 0; FOR_EACH_CLIENT(tmp_player) { is_bot = (IS_BOT_CLIENT(tmp_player)); - + if(is_bot) { tmp_netaddress = "null/botclient"; @@ -611,23 +611,23 @@ void CommonCommand_who(float request, entity caller, float argc) tmp_crypto_idfp = tmp_player.crypto_idfp; } - print_to(caller, sprintf(strreplace(" ", separator, " #%-3d %-20.20s %-5d %-3d %-9s %-16s %s "), - num_for_edict(tmp_player), + print_to(caller, sprintf(strreplace(" ", separator, " #%-3d %-20.20s %-5d %-3d %-9s %-16s %s "), + num_for_edict(tmp_player), tmp_player.netname, - tmp_player.ping, - tmp_player.ping_packetloss, + tmp_player.ping, + tmp_player.ping_packetloss, process_time(1, time - tmp_player.jointime), tmp_netaddress, tmp_crypto_idfp)); - + ++total_listed_players; } - + print_to(caller, strcat("Finished listing ", ftos(total_listed_players), " client(s) out of ", ftos(maxclients), " slots.")); - + return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -646,10 +646,10 @@ void CommonCommand_(float request, entity caller) { case CMD_REQUEST_COMMAND: { - + return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -688,10 +688,10 @@ void CommonCommand_macro_help(entity caller) { #define COMMON_COMMAND(name,function,description) \ { print_to(caller, strcat(" ^2", name, "^7: ", description)); } - + COMMON_COMMANDS(0, caller, 0, "") #undef COMMON_COMMAND - + return; } @@ -699,10 +699,10 @@ float CommonCommand_macro_command(float argc, entity caller, string command) { #define COMMON_COMMAND(name,function,description) \ { if(name == strtolower(argv(0))) { function; return TRUE; } } - + COMMON_COMMANDS(CMD_REQUEST_COMMAND, caller, argc, command) #undef COMMON_COMMAND - + return FALSE; } @@ -710,10 +710,10 @@ float CommonCommand_macro_usage(float argc, entity caller) { #define COMMON_COMMAND(name,function,description) \ { if(name == strtolower(argv(1))) { function; return TRUE; } } - + COMMON_COMMANDS(CMD_REQUEST_USAGE, caller, argc, "") #undef COMMON_COMMAND - + return FALSE; } @@ -721,9 +721,9 @@ void CommonCommand_macro_write_aliases(float fh) { #define COMMON_COMMAND(name,function,description) \ { CMD_Write_Alias("qc_cmd_svcmd", name, description); } - + COMMON_COMMANDS(0, world, 0, "") #undef COMMON_COMMAND - + return; } diff --git a/qcsrc/server/command/getreplies.qc b/qcsrc/server/command/getreplies.qc index 191c0d9d6..a55e0e0cd 100644 --- a/qcsrc/server/command/getreplies.qc +++ b/qcsrc/server/command/getreplies.qc @@ -9,12 +9,12 @@ // without using any extra processing time. // See common.qc for their proper commands - + string getrecords(float page) // 50 records per page -{ +{ float rec = 0, r, i; string h, s; - + s = ""; if (g_ctf) @@ -24,10 +24,10 @@ string getrecords(float page) // 50 records per page if (MapInfo_Get_ByID(i)) { r = stof(db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, "/captimerecord/time"))); - + if (!r) continue; - + // TODO: uid2name h = db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, "/captimerecord/netname")); s = strcat(s, strpad(32, MapInfo_Map_bspname), " ", strpad(-6, ftos_decimals(r, 2)), " ", h, "\n"); @@ -43,10 +43,10 @@ string getrecords(float page) // 50 records per page if (MapInfo_Get_ByID(i)) { r = race_readTime(MapInfo_Map_bspname, 1); - + if (!r) continue; - + h = race_readName(MapInfo_Map_bspname, 1); s = strcat(s, strpad(32, MapInfo_Map_bspname), " ", strpad(-8, TIME_ENCODED_TOSTRING(r)), " ", h, "\n"); ++rec; @@ -61,10 +61,10 @@ string getrecords(float page) // 50 records per page if (MapInfo_Get_ByID(i)) { r = race_readTime(MapInfo_Map_bspname, 1); - + if (!r) continue; - + h = race_readName(MapInfo_Map_bspname, 1); s = strcat(s, strpad(32, MapInfo_Map_bspname), " ", strpad(-8, TIME_ENCODED_TOSTRING(r)), " ", h, "\n"); ++rec; @@ -91,10 +91,10 @@ string getrankings() for (i = 1; i <= RANKINGS_CNT; ++i) { t = race_readTime(map, i); - + if (t == 0) continue; - + n = race_readName(map, i); p = count_ordinal(i); s = strcat(s, strpad(8, p), " ", strpad(-8, TIME_ENCODED_TOSTRING(t)), " ", n, "\n"); @@ -112,7 +112,7 @@ string getladder() { float i, j, k, uidcnt = 0, thiscnt; string s, temp_s, rr, myuid, thisuid; - + if(g_cts) rr = CTS_RECORD; else @@ -147,12 +147,12 @@ string getladder() // LADDER_CNT+1 = total points temp_s = db_get(TemporaryDB, strcat("ladder", myuid)); - + if(temp_s == "") { db_put(TemporaryDB, strcat("uid", ftos(uidcnt)), myuid); ++uidcnt; - + for(j = 0; j <= LADDER_CNT + 1; ++j) { if(j != LADDER_CNT + 1) @@ -225,7 +225,7 @@ string getladder() top_uids[k] = top_uids[k-1]; top_scores[k] = top_scores[k-1]; } - + top_uids[j] = thisuid; top_scores[j] = thiscnt; break; @@ -233,21 +233,21 @@ string getladder() } } } - + s = "^3-----------------------\n\n"; - + s = strcat(s, "Pos ^3|"); s = strcat(s, " ^7Total ^3|"); - + for(i = 1; i <= LADDER_CNT; ++i) { s = strcat(s, " ^7", count_ordinal(i), " ^3|"); } - + s = strcat(s, " ^7Speed awards ^3| ^7Name"); s = strcat(s, "\n^3----+--------"); - + for(i = 1; i <= min(9, LADDER_CNT); ++i) { s = strcat(s, "+-----"); } - + #if LADDER_CNT > 9 for(i = 1; i <= LADDER_CNT - 9; ++i) { s = strcat(s, "+------"); } @@ -259,16 +259,16 @@ string getladder() { temp_s = db_get(TemporaryDB, strcat("ladder", top_uids[i])); tokenize_console(temp_s); - + if(argv(LADDER_CNT+1) == "") // total is 0, skip continue; - + s = strcat(s, strpad(4, count_ordinal(i+1)), "^3| ^7"); // pos s = strcat(s, strpad(7, argv(LADDER_CNT+1)), "^3| ^7"); // total - + for(j = 1; j <= min(9, LADDER_CNT); ++j) { s = strcat(s, strpad(4, argv(j)), "^3| ^7"); } // 1st, 2nd, 3rd etc cnt - + #if LADDER_CNT > 9 for(j = 10; j <= LADDER_CNT; ++j) { s = strcat(s, strpad(4, argv(j)), " ^3| ^7"); } // 1st, 2nd, 3rd etc cnt @@ -290,7 +290,7 @@ string getmaplist() { string maplist = "", col; float i, argc; - + argc = tokenize_console(autocvar_g_maplist); for(i = 0; i < argc; ++i) { @@ -306,12 +306,12 @@ string getmaplist() return sprintf("^7Maps in list: %s\n", maplist); } - + string getlsmaps() { string lsmaps = "", col; float i, newmaps = 0; - + for(i = 0; i < MapInfo_count; ++i) { if((MapInfo_Get_ByID(i)) && !(MapInfo_Map_flags & MapInfo_ForbiddenFlags())) diff --git a/qcsrc/server/command/radarmap.qc b/qcsrc/server/command/radarmap.qc index 7fd707813..331f5f95f 100644 --- a/qcsrc/server/command/radarmap.qc +++ b/qcsrc/server/command/radarmap.qc @@ -226,7 +226,7 @@ void RadarMap_Think() // size: pixel width/height // maxs: cell width/height // frame: counter - + float i, x, l; string si; @@ -380,7 +380,7 @@ void RadarMap_Think() float RadarMap_Make(float argc) { float i; - + if(!radarmapper) { radarmapper = spawn(); @@ -407,21 +407,21 @@ float RadarMap_Make(float argc) case "--resolution": { ++i; radarmapper.size_x = stof(argv(i)); ++i; radarmapper.size_y = stof(argv(i)); break; } case "--qual": // minor alias case "--quality": { ++i; radarmapper.size_z = stof(argv(i)); break; } - - default: - i = argc; + + default: + i = argc; remove(radarmapper); radarmapper = world; break; } } - - if(radarmapper) // after doing the arguments, see if we successfully went forward. + + if(radarmapper) // after doing the arguments, see if we successfully went forward. { print("Radarmap entity spawned.\n"); return TRUE; // if so, don't print usage. } } - + return FALSE; } diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index 7dbafa7ab..ff07f2458 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -74,31 +74,31 @@ void GameCommand_adminmsg(float request, float argc) { entity client; float accepted; - + string targets = strreplace(",", " ", argv(1)); string original_targets = strreplace(" ", ", ", targets); string admin_message = argv(2); float infobartime = stof(argv(3)); - + string successful, t; successful = string_null; - + if((targets) && (admin_message)) { for(;targets;) { t = car(targets); targets = cdr(targets); - + // Check to see if the player is a valid target client = GetFilteredEntity(t); accepted = VerifyClientEntity(client, TRUE, FALSE); - - if(accepted <= 0) + + if(accepted <= 0) { - print("adminmsg: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n")); + print("adminmsg: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n")); continue; } - + // send the centerprint/console print or infomessage if(infobartime) { @@ -109,21 +109,21 @@ void GameCommand_adminmsg(float request, float argc) centerprint(client, strcat("^3", admin_name(), ":\n^7", admin_message)); sprint(client, strcat("\{1}\{13}^3", admin_name(), "^7: ", admin_message, "\n")); } - + successful = strcat(successful, (successful ? ", " : ""), client.netname); dprint("Message sent to ", client.netname, "\n"); continue; } - + if(successful) bprint("Successfully sent message '", admin_message, "' to ", successful, ".\n"); else print("No players given (", original_targets, ") could receive the message.\n"); - + return; } } - + default: print("Incorrect parameters for ^2adminmsg^7\n"); case CMD_REQUEST_USAGE: @@ -148,7 +148,7 @@ void GameCommand_allready(float request) ReadyRestart(); return; } - + default: case CMD_REQUEST_USAGE: { @@ -160,7 +160,7 @@ void GameCommand_allready(float request) } void GameCommand_allspec(float request, float argc) -{ +{ switch(request) { case CMD_REQUEST_COMMAND: @@ -168,7 +168,7 @@ void GameCommand_allspec(float request, float argc) entity client; string reason = argv(1); float i = 0; - + FOR_EACH_REALPLAYER(client) { self = client; @@ -179,7 +179,7 @@ void GameCommand_allspec(float request, float argc) else { print("No players found to spectate.\n"); } return; } - + default: case CMD_REQUEST_USAGE: { @@ -191,7 +191,7 @@ void GameCommand_allspec(float request, float argc) } } -void GameCommand_anticheat(float request, float argc) +void GameCommand_anticheat(float request, float argc) { switch(request) { @@ -199,8 +199,8 @@ void GameCommand_anticheat(float request, float argc) { entity client = GetIndexedEntity(argc, 1); float accepted = VerifyClientEntity(client, FALSE, FALSE); - - if(accepted > 0) + + if(accepted > 0) { self = client; anticheat_report(); @@ -208,10 +208,10 @@ void GameCommand_anticheat(float request, float argc) } else { - print("anticheat: ", GetClientErrorString(accepted, argv(1)), ".\n"); + print("anticheat: ", GetClientErrorString(accepted, argv(1)), ".\n"); } } - + default: print("Incorrect parameters for ^2anticheat^7\n"); case CMD_REQUEST_USAGE: @@ -223,7 +223,7 @@ void GameCommand_anticheat(float request, float argc) } } -void GameCommand_bbox(float request) +void GameCommand_bbox(float request) { switch(request) { @@ -300,11 +300,11 @@ void GameCommand_bbox(float request) print(" ", ftos(world.absmax_z)); else print(" ", ftos(trace_endpos_z)); - + print("\n"); return; } - + default: case CMD_REQUEST_USAGE: { @@ -323,7 +323,7 @@ void GameCommand_bot_cmd(float request, float argc, string command) case CMD_REQUEST_COMMAND: { entity bot; - + if(argv(1) == "reset") { bot_resetqueues(); @@ -414,7 +414,7 @@ void GameCommand_bot_cmd(float request, float argc, string command) print(strcat("Error: Can't find bot with the name or id '", argv(1),"' - Did you mistype the command?\n")); // don't return so that usage is shown } } - + default: print("Incorrect parameters for ^2bot_cmd^7\n"); case CMD_REQUEST_USAGE: @@ -439,13 +439,13 @@ void GameCommand_cointoss(float request, float argc) string result1 = (argv(2) ? strcat("^7", argv(1), "^3!\n") : "^1HEADS^3!\n"); string result2 = (argv(2) ? strcat("^7", argv(2), "^3!\n") : "^4TAILS^3!\n"); string choice = ((random() > 0.5) ? result1 : result2); - + FOR_EACH_CLIENT(client) centerprint(client, strcat("^3Throwing coin... Result: ", choice)); bprint(strcat("^3Throwing coin... Result: ", choice)); return; } - + default: case CMD_REQUEST_USAGE: { @@ -456,7 +456,7 @@ void GameCommand_cointoss(float request, float argc) } } -void GameCommand_database(float request, float argc) +void GameCommand_database(float request, float argc) { switch(request) { @@ -485,7 +485,7 @@ void GameCommand_database(float request, float argc) } } } - + default: print("Incorrect parameters for ^2database^7\n"); case CMD_REQUEST_USAGE: @@ -500,30 +500,30 @@ void GameCommand_database(float request, float argc) } void GameCommand_defer_clear(float request, float argc) -{ +{ switch(request) { case CMD_REQUEST_COMMAND: { entity client; float accepted; - + if(argc >= 2) { client = GetIndexedEntity(argc, 1); accepted = VerifyClientEntity(client, TRUE, FALSE); - + if(accepted > 0) { stuffcmd(client, "defer clear\n"); print("defer clear stuffed to ", client.netname, "\n"); } else { print("defer_clear: ", GetClientErrorString(accepted, argv(1)), ".\n"); } - + return; } } - + default: print("Incorrect parameters for ^2defer_clear^7\n"); case CMD_REQUEST_USAGE: @@ -537,7 +537,7 @@ void GameCommand_defer_clear(float request, float argc) } void GameCommand_defer_clear_all(float request) -{ +{ switch(request) { case CMD_REQUEST_COMMAND: @@ -545,17 +545,17 @@ void GameCommand_defer_clear_all(float request) entity client; float i = 0; float argc; - + FOR_EACH_CLIENT(client) { argc = tokenize_console(strcat("defer_clear ", ftos(num_for_edict(client)))); - GameCommand_defer_clear(CMD_REQUEST_COMMAND, argc); + GameCommand_defer_clear(CMD_REQUEST_COMMAND, argc); ++i; } - if(i) { print(strcat("Successfully stuffed defer clear to all clients (", ftos(i), ")\n")); } // should a message be added if no players were found? + if(i) { print(strcat("Successfully stuffed defer clear to all clients (", ftos(i), ")\n")); } // should a message be added if no players were found? return; } - + default: case CMD_REQUEST_USAGE: { @@ -581,8 +581,8 @@ void GameCommand_delrec(float request, float argc) // perhaps merge later with race_deleteTime(GetMapname(), stof(argv(1))); return; } - } - + } + default: print("Incorrect parameters for ^2delrec^7\n"); case CMD_REQUEST_USAGE: @@ -596,7 +596,7 @@ void GameCommand_delrec(float request, float argc) // perhaps merge later with } } -void GameCommand_effectindexdump(float request) +void GameCommand_effectindexdump(float request) { switch(request) { @@ -604,7 +604,7 @@ void GameCommand_effectindexdump(float request) { float fh, d; string s; - + d = db_create(); print("begin of effects list\n"); db_put(d, "TE_GUNSHOT", "1"); print("effect TE_GUNSHOT is ", ftos(particleeffectnum("TE_GUNSHOT")), "\n"); @@ -663,7 +663,7 @@ void GameCommand_effectindexdump(float request) db_close(d); return; } - + default: case CMD_REQUEST_USAGE: { @@ -674,7 +674,7 @@ void GameCommand_effectindexdump(float request) } } -void GameCommand_extendmatchtime(float request) +void GameCommand_extendmatchtime(float request) { switch(request) { @@ -683,7 +683,7 @@ void GameCommand_extendmatchtime(float request) changematchtime(autocvar_timelimit_increment * 60, autocvar_timelimit_min * 60, autocvar_timelimit_max * 60); return; } - + default: case CMD_REQUEST_USAGE: { @@ -696,19 +696,19 @@ void GameCommand_extendmatchtime(float request) } void GameCommand_find(float request, float argc) // is this even needed? We have prvm_edicts command and such ANYWAY -{ +{ switch(request) { case CMD_REQUEST_COMMAND: { entity client; - + for(client = world; (client = find(client, classname, argv(1))); ) print(etos(client), "\n"); - + return; } - + default: print("Incorrect parameters for ^2find^7\n"); case CMD_REQUEST_USAGE: @@ -720,8 +720,8 @@ void GameCommand_find(float request, float argc) // is this even needed? We hav } } -void GameCommand_gametype(float request, float argc) -{ +void GameCommand_gametype(float request, float argc) +{ switch(request) { case CMD_REQUEST_COMMAND: @@ -730,7 +730,7 @@ void GameCommand_gametype(float request, float argc) { string s = argv(1); float t = MapInfo_Type_FromString(s), tsave = MapInfo_CurrentGametype(); - + if(t) { MapInfo_SwitchGameType(t); @@ -751,11 +751,11 @@ void GameCommand_gametype(float request, float argc) } else bprint("Game type switch to ", s, " failed: this type does not exist!\n"); - + return; } } - + default: print("Incorrect parameters for ^2gametype^7\n"); case CMD_REQUEST_USAGE: @@ -768,8 +768,8 @@ void GameCommand_gametype(float request, float argc) } } -void GameCommand_gettaginfo(float request, float argc) -{ +void GameCommand_gettaginfo(float request, float argc) +{ switch(request) { case CMD_REQUEST_COMMAND: @@ -777,7 +777,7 @@ void GameCommand_gettaginfo(float request, float argc) entity tmp_entity; float i; vector v; - + if(argc >= 4) { tmp_entity = spawn(); @@ -811,12 +811,12 @@ void GameCommand_gettaginfo(float request, float argc) } else print("bone not found\n"); - + remove(tmp_entity); return; } } - + default: print("Incorrect parameters for ^2gettaginfo^7\n"); case CMD_REQUEST_USAGE: @@ -828,7 +828,7 @@ void GameCommand_gettaginfo(float request, float argc) } } -void GameCommand_animbench(float request, float argc) +void GameCommand_animbench(float request, float argc) { switch(request) { @@ -896,7 +896,7 @@ void GameCommand_gotomap(float request, float argc) return; } } - + default: print("Incorrect parameters for ^2gotomap^7\n"); case CMD_REQUEST_USAGE: @@ -926,7 +926,7 @@ void GameCommand_lockteams(float request) } return; } - + default: case CMD_REQUEST_USAGE: { @@ -938,14 +938,14 @@ void GameCommand_lockteams(float request) } } -void GameCommand_make_mapinfo(float request) +void GameCommand_make_mapinfo(float request) { switch(request) { case CMD_REQUEST_COMMAND: - { + { entity tmp_entity; - + tmp_entity = spawn(); tmp_entity.classname = "make_mapinfo"; tmp_entity.think = make_mapinfo_Think; @@ -953,7 +953,7 @@ void GameCommand_make_mapinfo(float request) MapInfo_Enumerate(); return; } - + default: case CMD_REQUEST_USAGE: { @@ -973,17 +973,17 @@ void GameCommand_moveplayer(float request, float argc) { float accepted; entity client; - + string targets = strreplace(",", " ", argv(1)); string original_targets = strreplace(" ", ", ", targets); string destination = argv(2); - + string successful, t; successful = string_null; - + // lets see if the target(s) even actually exist. if((targets) && (destination)) - { + { for(;targets;) { t = car(targets); targets = cdr(targets); @@ -991,21 +991,21 @@ void GameCommand_moveplayer(float request, float argc) // Check to see if the player is a valid target client = GetFilteredEntity(t); accepted = VerifyClientEntity(client, FALSE, FALSE); - - if(accepted <= 0) + + if(accepted <= 0) { - print("moveplayer: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n")); + print("moveplayer: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n")); continue; } - + // Where are we putting this player? - if(destination == "spec" || destination == "spectator") + if(destination == "spec" || destination == "spectator") { if(!IS_SPEC(client) && !IS_OBSERVER(client)) { self = client; PutObserverInServer(); - + successful = strcat(successful, (successful ? ", " : ""), client.netname); } else @@ -1032,7 +1032,7 @@ void GameCommand_moveplayer(float request, float argc) // keep the forcing undone print("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") is already on the ", Team_ColoredFullName(client.team), (targets ? "^7, skipping to next player.\n" : "^7.\n")); continue; - } + } else if(team_id == 0) // auto team { team_id = Team_NumberToTeam(FindSmallestTeam(client, FALSE)); @@ -1042,18 +1042,18 @@ void GameCommand_moveplayer(float request, float argc) CheckAllowedTeams(client); } client.team_forced = save; - + // Check to see if the destination team is even available - switch(team_id) + switch(team_id) { case NUM_TEAM_1: if(c1 == -1) { print("Sorry, can't move player to red team if it doesn't exist.\n"); return; } break; case NUM_TEAM_2: if(c2 == -1) { print("Sorry, can't move player to blue team if it doesn't exist.\n"); return; } break; case NUM_TEAM_3: if(c3 == -1) { print("Sorry, can't move player to yellow team if it doesn't exist.\n"); return; } break; case NUM_TEAM_4: if(c4 == -1) { print("Sorry, can't move player to pink team if it doesn't exist.\n"); return; } break; - + default: print("Sorry, can't move player here if team ", destination, " doesn't exist.\n"); return; } - + // If so, lets continue and finally move the player client.team_forced = 0; MoveToTeam(client, team_id, 6); @@ -1069,21 +1069,21 @@ void GameCommand_moveplayer(float request, float argc) } else { - print("Can't change teams if the player isn't in the game.\n"); // well technically we could, but should we allow that? :P + print("Can't change teams if the player isn't in the game.\n"); // well technically we could, but should we allow that? :P return; } } } - + if(successful) bprint("Successfully moved players ", successful, " to destination ", destination, ".\n"); else print("No players given (", original_targets, ") are able to move.\n"); - + return; // still correct parameters so return to avoid usage print } } - + default: print("Incorrect parameters for ^2moveplayer^7\n"); case CMD_REQUEST_USAGE: @@ -1100,7 +1100,7 @@ void GameCommand_moveplayer(float request, float argc) } } -void GameCommand_nospectators(float request) +void GameCommand_nospectators(float request) { switch(request) { @@ -1119,7 +1119,7 @@ void GameCommand_nospectators(float request) bprint(strcat("^7All spectators will be automatically kicked when not joining the game after ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds!\n")); return; } - + default: case CMD_REQUEST_USAGE: { @@ -1131,7 +1131,7 @@ void GameCommand_nospectators(float request) } void GameCommand_playerdemo(float request, float argc) -{ +{ switch(request) { case CMD_REQUEST_COMMAND: @@ -1140,58 +1140,58 @@ void GameCommand_playerdemo(float request, float argc) { entity client; float i, n, accepted; - + switch(argv(1)) { case "read": { client = GetIndexedEntity(argc, 2); accepted = VerifyClientEntity(client, FALSE, TRUE); - - if(accepted <= 0) + + if(accepted <= 0) { - print("playerdemo: read: ", GetClientErrorString(accepted, argv(2)), ".\n"); + print("playerdemo: read: ", GetClientErrorString(accepted, argv(2)), ".\n"); return; } - + self = client; playerdemo_open_read(argv(next_token)); return; } - + case "write": { client = GetIndexedEntity(argc, 2); accepted = VerifyClientEntity(client, FALSE, FALSE); - - if(accepted <= 0) + + if(accepted <= 0) { - print("playerdemo: write: ", GetClientErrorString(accepted, argv(2)), ".\n"); + print("playerdemo: write: ", GetClientErrorString(accepted, argv(2)), ".\n"); return; } - + self = client; playerdemo_open_write(argv(next_token)); return; } - + case "auto_read_and_write": { n = GetFilteredNumber(argv(3)); cvar_set("bot_number", ftos(n)); - + localcmd("wait; wait; wait\n"); for(i = 0; i < n; ++i) { localcmd("sv_cmd playerdemo read ", ftos(i+2), " ", argv(2), ftos(i+1), "\n"); } - + localcmd("sv_cmd playerdemo write 1 ", ftos(n+1), "\n"); return; } - + case "auto_read": { n = GetFilteredNumber(argv(3)); cvar_set("bot_number", ftos(n)); - + localcmd("wait; wait; wait\n"); for(i = 0; i < n; ++i) { localcmd("sv_cmd playerdemo read ", ftos(i+2), " ", argv(2), ftos(i+1), "\n"); } return; @@ -1199,7 +1199,7 @@ void GameCommand_playerdemo(float request, float argc) } } } - + default: print("Incorrect parameters for ^2playerdemo^7\n"); case CMD_REQUEST_USAGE: @@ -1211,7 +1211,7 @@ void GameCommand_playerdemo(float request, float argc) } } -void GameCommand_printstats(float request) +void GameCommand_printstats(float request) { switch(request) { @@ -1221,7 +1221,7 @@ void GameCommand_printstats(float request) print("stats dumped.\n"); return; } - + default: case CMD_REQUEST_USAGE: { @@ -1241,7 +1241,7 @@ void GameCommand_radarmap(float request, float argc) if(RadarMap_Make(argc)) return; } - + default: print("Incorrect parameters for ^2radarmap^7\n"); case CMD_REQUEST_USAGE: @@ -1255,7 +1255,7 @@ void GameCommand_radarmap(float request, float argc) } } -void GameCommand_reducematchtime(float request) +void GameCommand_reducematchtime(float request) { switch(request) { @@ -1264,7 +1264,7 @@ void GameCommand_reducematchtime(float request) changematchtime(autocvar_timelimit_decrement *-60, autocvar_timelimit_min * 60, autocvar_timelimit_max * 60); return; } - + default: case CMD_REQUEST_USAGE: { @@ -1290,7 +1290,7 @@ void GameCommand_setbots(float request, float argc) return; } } - + default: print("Incorrect parameters for ^2setbots^7\n"); case CMD_REQUEST_USAGE: @@ -1320,22 +1320,22 @@ void GameCommand_shuffleteams(float request) FOR_EACH_PLAYER(tmp_player) { CheckAllowedTeams(tmp_player); - + if(c1 >= 0) t_teams = max(1, t_teams); if(c2 >= 0) t_teams = max(2, t_teams); if(c3 >= 0) t_teams = max(3, t_teams); if(c4 >= 0) t_teams = max(4, t_teams); - + ++t_players; } - + // build a list of the players in a random order FOR_EACH_PLAYER(tmp_player) { for(;;) { i = bound(1, floor(random() * maxclients) + 1, maxclients); - + if(shuffleteams_players[i]) { continue; // a player is already assigned to this slot @@ -1348,27 +1348,27 @@ void GameCommand_shuffleteams(float request) } } - // finally, from the list made earlier, re-join the players in different order. + // finally, from the list made earlier, re-join the players in different order. for(i = 1; i <= t_teams; ++i) { // find out how many players to assign to this team x = (t_players / t_teams); x = ((i == 1) ? ceil(x) : floor(x)); - + team_color = Team_NumberToTeam(i); - - // sort through the random list of players made earlier + + // sort through the random list of players made earlier for(z = 1; z <= maxclients; ++z) - { + { if (!(shuffleteams_teams[i] >= x)) { if (!(shuffleteams_players[z])) continue; // not a player, move on to next random slot - + if(VerifyClientNumber(shuffleteams_players[z])) self = edict_num(shuffleteams_players[z]); - if(self.team != team_color) + if(self.team != team_color) MoveToTeam(self, team_color, 6); shuffleteams_players[z] = 0; @@ -1380,13 +1380,13 @@ void GameCommand_shuffleteams(float request) } } } - + bprint("Successfully shuffled the players around randomly.\n"); - + // clear the buffers now for (i=0; i 0) { stuffcmd(client, strcat("\n", argv(next_token), "\n")); print(strcat("Command: \"", argv(next_token), "\" sent to ", GetCallerName(client), " (", argv(1) ,").\n")); } else - print("stuffto: ", GetClientErrorString(accepted, argv(1)), ".\n"); - + print("stuffto: ", GetClientErrorString(accepted, argv(1)), ".\n"); + return; } } - + default: print("Incorrect parameters for ^2stuffto^7\n"); case CMD_REQUEST_USAGE: @@ -1466,7 +1466,7 @@ void GameCommand_trace(float request, float argc) entity e; vector org, delta, start, end, p, q, q0, pos, vv, dv; float i, f, safe, unsafe, dq, dqf; - + switch(argv(1)) { case "debug": @@ -1559,7 +1559,7 @@ void GameCommand_trace(float request, float argc) } return; } - + case "debug2": { e = nextent(world); @@ -1590,7 +1590,7 @@ void GameCommand_trace(float request, float argc) print("highest possible dist: ", ftos(f), "\n"); return; } - + case "walk": { if(argc == 4) @@ -1603,7 +1603,7 @@ void GameCommand_trace(float request, float argc) return; } } - + case "showline": { if(argc == 4) @@ -1616,11 +1616,11 @@ void GameCommand_trace(float request, float argc) return; } } - + // no default case, just go straight to invalid } } - + default: print("Incorrect parameters for ^2trace^7\n"); case CMD_REQUEST_USAGE: @@ -1650,7 +1650,7 @@ void GameCommand_unlockteams(float request) } return; } - + default: case CMD_REQUEST_USAGE: { @@ -1674,7 +1674,7 @@ void GameCommand_warp(float request, float argc) { CampaignLevelWarp(stof(argv(1))); print("Successfully warped to campaign level ", stof(argv(1)), ".\n"); - } + } else { CampaignLevelWarp(-1); @@ -1685,7 +1685,7 @@ void GameCommand_warp(float request, float argc) print("Not in campaign, can't level warp\n"); return; } - + default: case CMD_REQUEST_USAGE: { @@ -1705,10 +1705,10 @@ void GameCommand_(float request) { case CMD_REQUEST_COMMAND: { - + return; } - + default: case CMD_REQUEST_USAGE: { @@ -1765,10 +1765,10 @@ void GameCommand_macro_help() { #define SERVER_COMMAND(name,function,description) \ { print(" ^2", name, "^7: ", description, "\n"); } - + SERVER_COMMANDS(0, 0, "") #undef SERVER_COMMAND - + return; } @@ -1776,10 +1776,10 @@ float GameCommand_macro_command(float argc, string command) { #define SERVER_COMMAND(name,function,description) \ { if(name == strtolower(argv(0))) { function; return TRUE; } } - + SERVER_COMMANDS(CMD_REQUEST_COMMAND, argc, command) #undef SERVER_COMMAND - + return FALSE; } @@ -1787,10 +1787,10 @@ float GameCommand_macro_usage(float argc) { #define SERVER_COMMAND(name,function,description) \ { if(name == strtolower(argv(1))) { function; return TRUE; } } - + SERVER_COMMANDS(CMD_REQUEST_USAGE, argc, "") #undef SERVER_COMMAND - + return FALSE; } @@ -1798,13 +1798,13 @@ void GameCommand_macro_write_aliases(float fh) { #define SERVER_COMMAND(name,function,description) \ { CMD_Write_Alias("qc_cmd_sv", name, description); } - + SERVER_COMMANDS(0, 0, "") #undef SERVER_COMMAND - + return; } - + // ========================================= // Main Function Called By Engine (sv_cmd) @@ -1814,33 +1814,33 @@ void GameCommand_macro_write_aliases(float fh) void GameCommand(string command) { float argc = tokenize_console(command); - + // Guide for working with argc arguments by example: // argc: 1 - 2 - 3 - 4 - // argv: 0 - 1 - 2 - 3 + // argv: 0 - 1 - 2 - 3 // cmd vote - master - login - password - if(strtolower(argv(0)) == "help") + if(strtolower(argv(0)) == "help") { - if(argc == 1) + if(argc == 1) { print("\nServer console commands:\n"); GameCommand_macro_help(); - + print("\nBanning commands:\n"); BanCommand_macro_help(); - + print("\nCommon networked commands:\n"); CommonCommand_macro_help(world); - + print("\nGeneric commands shared by all programs:\n"); GenericCommand_macro_help(); - + print("\nUsage:^3 sv_cmd COMMAND...^7, where possible commands are listed above.\n"); print("For help about a specific command, type sv_cmd help COMMAND\n"); - + return; - } + } else if(BanCommand_macro_usage(argc)) // Instead of trying to call a command, we're going to see detailed information about it { return; @@ -1857,8 +1857,8 @@ void GameCommand(string command) { return; } - } - else if(BanCommand(command)) + } + else if(BanCommand(command)) { return; // handled by server/command/ipban.qc } @@ -1866,7 +1866,7 @@ void GameCommand(string command) { return; // handled by server/command/common.qc } - else if(GenericCommand(command)) + else if(GenericCommand(command)) { return; // handled by common/command/generic.qc } @@ -1874,9 +1874,9 @@ void GameCommand(string command) { return; // handled by one of the above GameCommand_* functions } - + // nothing above caught the command, must be invalid print(((command != "") ? strcat("Unknown server command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try sv_cmd help.\n"); - + return; } diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index c444a9615..01ecd7897 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -100,7 +100,7 @@ void Nagger_ReadyCounted() // Game logic for voting // ======================= -void VoteReset() +void VoteReset() { entity tmp_player; @@ -115,50 +115,50 @@ void VoteReset() vote_called = VOTE_NULL; vote_caller = world; vote_endtime = 0; - + vote_called_command = string_null; vote_called_display = string_null; - + vote_parsed_command = string_null; vote_parsed_display = string_null; Nagger_VoteChanged(); } -void VoteStop(entity stopper) +void VoteStop(entity stopper) { bprint("\{1}^2* ^3", GetCallerName(stopper), "^2 stopped ^3", GetCallerName(vote_caller), "^2's vote\n"); if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vstop:", ftos(stopper.playerid))); } - + // Don't force them to wait for next vote, this way they can e.g. correct their vote. if((vote_caller) && (stopper == vote_caller)) { vote_caller.vote_waittime = time + autocvar_sv_vote_stop; } VoteReset(); } -void VoteAccept() +void VoteAccept() { bprint("\{1}^2* ^3", GetCallerName(vote_caller), "^2's vote for ^1", vote_called_display, "^2 was accepted\n"); - + if((vote_called == VOTE_MASTER) && vote_caller) vote_caller.vote_master = 1; else localcmd(strcat(vote_called_command, "\n")); - + if(vote_caller) { vote_caller.vote_waittime = 0; } // people like your votes, you don't need to wait to vote again VoteReset(); Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_VOTE_ACCEPT); } -void VoteReject() +void VoteReject() { bprint("\{1}^2* ^3", GetCallerName(vote_caller), "^2's vote for ", vote_called_display, "^2 was rejected\n"); VoteReset(); Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_VOTE_FAIL); } -void VoteTimeout() +void VoteTimeout() { bprint("\{1}^2* ^3", GetCallerName(vote_caller), "^2's vote for ", vote_called_display, "^2 timed out\n"); VoteReset(); @@ -173,7 +173,7 @@ void VoteSpam(float notvoters, float mincount, string result) ((mincount >= 0) ? strcat("^2 (^1", ftos(mincount), "^2 needed)") : "^2"), strcat(", ^1", ftos(vote_abstain_count), "^2 didn't care"), strcat(", ^1", ftos(notvoters), strcat("^2 didn't ", ((mincount >= 0) ? "" : "have to "), "vote\n")))); - + if(autocvar_sv_eventlog) { GameLogEcho(strcat( @@ -185,31 +185,31 @@ void VoteSpam(float notvoters, float mincount, string result) } } -void VoteCount(float first_count) +void VoteCount(float first_count) { // declarations vote_accept_count = vote_reject_count = vote_abstain_count = 0; - - float spectators_allowed = ((autocvar_sv_vote_nospectators != 2) + + float spectators_allowed = ((autocvar_sv_vote_nospectators != 2) || ((autocvar_sv_vote_nospectators == 1) && (warmup_stage || gameover)) || (autocvar_sv_vote_nospectators == 0)); - + float vote_player_count = 0, notvoters = 0; float vote_real_player_count = 0, vote_real_accept_count = 0; float vote_real_reject_count = 0, vote_real_abstain_count = 0; float vote_needed_of_voted, final_needed_votes; float vote_factor_overall, vote_factor_of_voted; - + entity tmp_player; Nagger_VoteCountChanged(); - + // add up all the votes from each connected client FOR_EACH_REALCLIENT(tmp_player) { ++vote_player_count; if(IS_PLAYER(tmp_player)) { ++vote_real_player_count; } - + switch(tmp_player.vote_selection) { case VOTE_SELECT_REJECT: { ++vote_reject_count; { if(IS_PLAYER(tmp_player)) ++vote_real_reject_count; } break; } @@ -218,17 +218,17 @@ void VoteCount(float first_count) default: break; } } - + // Check to see if there are enough players on the server to allow master voting... otherwise, vote master could be used for evil. - if((vote_called == VOTE_MASTER) && autocvar_sv_vote_master_playerlimit > vote_player_count) + if((vote_called == VOTE_MASTER) && autocvar_sv_vote_master_playerlimit > vote_player_count) { if(vote_caller) { vote_caller.vote_waittime = 0; } print_to(vote_caller, "^1There are not enough players on this server to allow you to become vote master."); VoteReset(); return; } - - // if spectators aren't allowed to vote and there are players in a match, then only count the players in the vote and ignore spectators. + + // if spectators aren't allowed to vote and there are players in a match, then only count the players in the vote and ignore spectators. if(!spectators_allowed && (vote_real_player_count > 0)) { vote_accept_count = vote_real_accept_count; @@ -236,46 +236,46 @@ void VoteCount(float first_count) vote_abstain_count = vote_real_abstain_count; vote_player_count = vote_real_player_count; } - + // people who have no opinion in any way :D notvoters = (vote_player_count - vote_accept_count - vote_reject_count - vote_abstain_count); // determine the goal for the vote to be passed or rejected normally vote_factor_overall = bound(0.5, autocvar_sv_vote_majority_factor, 0.999); vote_needed_overall = floor((vote_player_count - vote_abstain_count) * vote_factor_overall) + 1; - + // if the vote times out, determine the amount of votes needed of the people who actually already voted vote_factor_of_voted = bound(0.5, autocvar_sv_vote_majority_factor_of_voted, 0.999); vote_needed_of_voted = floor((vote_accept_count + vote_reject_count) * vote_factor_of_voted) + 1; - + // are there any players at all on the server? it could be an admin vote if(vote_player_count == 0 && first_count) { - VoteSpam(0, -1, "yes"); // no players at all, just accept it + VoteSpam(0, -1, "yes"); // no players at all, just accept it VoteAccept(); return; } - - // since there ARE players, finally calculate the result of the vote + + // since there ARE players, finally calculate the result of the vote if(vote_accept_count >= vote_needed_overall) { VoteSpam(notvoters, -1, "yes"); // there is enough acceptions to pass the vote VoteAccept(); return; } - + if(vote_reject_count > vote_player_count - vote_abstain_count - vote_needed_overall) { VoteSpam(notvoters, -1, "no"); // there is enough rejections to deny the vote VoteReject(); return; } - + // there is not enough votes in either direction, now lets just calculate what the voters have said if(time > vote_endtime) { final_needed_votes = vote_needed_overall; - + if(autocvar_sv_vote_majority_factor_of_voted) { if(vote_accept_count >= vote_needed_of_voted) @@ -284,31 +284,31 @@ void VoteCount(float first_count) VoteAccept(); return; } - + if(vote_accept_count + vote_reject_count > 0) { VoteSpam(notvoters, min(vote_needed_overall, vote_needed_of_voted), "no"); VoteReject(); return; } - + final_needed_votes = min(vote_needed_overall, vote_needed_of_voted); } - // it didn't pass or fail, so not enough votes to even make a decision. + // it didn't pass or fail, so not enough votes to even make a decision. VoteSpam(notvoters, final_needed_votes, "timeout"); VoteTimeout(); } } -void VoteThink() +void VoteThink() { if(vote_endtime > 0) // a vote was called if(time > vote_endtime) // time is up { VoteCount(FALSE); } - + return; } @@ -391,13 +391,13 @@ void reset_map(float dorespawn) } // Restarts the map after the countdown is over (and cvar sv_ready_restart_after_countdown is set) -void ReadyRestart_think() +void ReadyRestart_think() { restart_mapalreadyrestarted = 1; reset_map(TRUE); Score_ClearAll(); remove(self); - + return; } @@ -473,7 +473,7 @@ void ReadyRestart() if (!autocvar_sv_ready_restart_after_countdown) { Score_ClearAll(); } ReadyRestart_force(); - + return; } @@ -499,12 +499,12 @@ void ReadyCount() ready_needed_factor = bound(0.5, cvar("g_warmup_majority_factor"), 0.999); ready_needed_count = floor(t_players * ready_needed_factor) + 1; - + if(readycount >= ready_needed_count) { ReadyRestart(); } - + return; } @@ -516,9 +516,9 @@ void ReadyCount() float Votecommand_check_assignment(entity caller, float assignment) { float from_server = (!caller); - - if((assignment == VC_ASGNMNT_BOTH) - || ((!from_server && assignment == VC_ASGNMNT_CLIENTONLY) + + if((assignment == VC_ASGNMNT_BOTH) + || ((!from_server && assignment == VC_ASGNMNT_CLIENTONLY) || (from_server && assignment == VC_ASGNMNT_SERVERONLY))) { return TRUE; @@ -527,15 +527,15 @@ float Votecommand_check_assignment(entity caller, float assignment) return FALSE; } -string VoteCommand_extractcommand(string input, float startpos, float argc) +string VoteCommand_extractcommand(string input, float startpos, float argc) { string output; - + if((argc - 1) < startpos) output = ""; else output = substring(input, argv_start_index(startpos), argv_end_index(-1) - argv_start_index(startpos)); - + return output; } @@ -546,30 +546,30 @@ float VoteCommand_checknasty(string vote_command) || (strstrofs(vote_command, "\r", 0) >= 0) || (strstrofs(vote_command, "$", 0) >= 0)) return FALSE; - + return TRUE; } float VoteCommand_checkinlist(string vote_command, string list) { string l = strcat(" ", list, " "); - + if(strstrofs(l, strcat(" ", vote_command, " "), 0) >= 0) return TRUE; - + return FALSE; } string ValidateMap(string validated_map, entity caller) { validated_map = MapInfo_FixName(validated_map); - + if (!validated_map) { print_to(caller, "This map is not available on this server."); return string_null; } - + if(!autocvar_sv_vote_override_mostrecent && caller) { if(Map_IsRecent(validated_map)) @@ -578,7 +578,7 @@ string ValidateMap(string validated_map, entity caller) return string_null; } } - + if(!MapInfo_CheckMap(validated_map)) { print_to(caller, strcat("^1Invalid mapname, \"^3", validated_map, "^1\" does not support the current game mode.")); @@ -665,7 +665,7 @@ float VoteCommand_checkargs(float startpos, float argc) float VoteCommand_parse(entity caller, string vote_command, string vote_list, float startpos, float argc) { string first_command; - + first_command = argv(startpos); /*dprint(sprintf("VoteCommand_parse(): Command: '%s', Length: %f.\n", @@ -693,25 +693,25 @@ float VoteCommand_parse(entity caller, string vote_command, string vote_list, fl { entity victim = GetIndexedEntity(argc, (startpos + 1)); float accepted = VerifyClientEntity(victim, TRUE, FALSE); - + if(accepted > 0) { string reason = ((argc > next_token) ? substring(vote_command, argv_start_index(next_token), strlen(vote_command) - argv_start_index(next_token)) : "No reason provided"); string command_arguments; - + if(first_command == "kickban") command_arguments = strcat(ftos(autocvar_g_ban_default_bantime), " ", ftos(autocvar_g_ban_default_masksize), " ~"); else command_arguments = reason; - + vote_parsed_command = strcat(first_command, " # ", ftos(num_for_edict(victim)), " ", command_arguments); vote_parsed_display = strcat("^1", vote_command, " (^7", victim.netname, "^1): ", reason); } else { print_to(caller, strcat("vcall: ", GetClientErrorString(accepted, argv(startpos + 1)), ".\n")); return FALSE; } - + break; } - + case "map": case "chmap": case "gotomap": // re-direct all map selection commands to gotomap @@ -720,16 +720,16 @@ float VoteCommand_parse(entity caller, string vote_command, string vote_list, fl if (!vote_command) { return FALSE; } vote_parsed_command = strcat("gotomap ", vote_command); vote_parsed_display = strzone(strcat("^1", vote_parsed_command)); - + break; } - - default: - { + + default: + { vote_parsed_command = vote_command; vote_parsed_display = strzone(strcat("^1", vote_command)); - - break; + + break; } } @@ -749,7 +749,7 @@ void VoteCommand_abstain(float request, entity caller) // CLIENT ONLY { if (!vote_called) { print_to(caller, "^1No vote called."); } else if(caller.vote_selection != VOTE_SELECT_NULL && !autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); } - + else // everything went okay, continue changing vote { print_to(caller, "^1You abstained from your vote."); @@ -757,10 +757,10 @@ void VoteCommand_abstain(float request, entity caller) // CLIENT ONLY msg_entity = caller; if(!autocvar_sv_vote_singlecount) { VoteCount(FALSE); } } - + return; } - + default: case CMD_REQUEST_USAGE: { @@ -777,15 +777,15 @@ void VoteCommand_call(float request, entity caller, float argc, string vote_comm { case CMD_REQUEST_COMMAND: { - float spectators_allowed = ((autocvar_sv_vote_nospectators != 2) - || ((autocvar_sv_vote_nospectators == 1) && warmup_stage) + float spectators_allowed = ((autocvar_sv_vote_nospectators != 2) + || ((autocvar_sv_vote_nospectators == 1) && warmup_stage) || (autocvar_sv_vote_nospectators == 0)); - + float tmp_playercount = 0; entity tmp_player; - + vote_command = VoteCommand_extractcommand(vote_command, 2, argc); - + if(!autocvar_sv_vote_call && caller) { print_to(caller, "^1Vote calling is not allowed."); } else if(!autocvar_sv_vote_gamestart && time < game_starttime) { print_to(caller, "^1Vote calling is not allowed before the match has started."); } else if(vote_called) { print_to(caller, "^1There is already a vote called."); } @@ -802,26 +802,26 @@ void VoteCommand_call(float request, entity caller, float argc, string vote_comm vote_called_command = strzone(vote_parsed_command); vote_called_display = strzone(vote_parsed_display); vote_endtime = time + autocvar_sv_vote_timeout; - + if(caller) { caller.vote_selection = VOTE_SELECT_ACCEPT; caller.vote_waittime = time + autocvar_sv_vote_wait; msg_entity = caller; } - + FOR_EACH_REALCLIENT(tmp_player) { ++tmp_playercount; } if(tmp_playercount > 1) { Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_VOTE_CALL); } // don't announce a "vote now" sound if player is alone - + bprint("\{1}^2* ^3", GetCallerName(vote_caller), "^2 calls a vote for ", vote_called_display, "\n"); if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vcall:", ftos(vote_caller.playerid), ":", vote_called_display)); } Nagger_VoteChanged(); VoteCount(TRUE); // needed if you are the only one } - + return; } - + default: case CMD_REQUEST_USAGE: { @@ -847,11 +847,11 @@ void VoteCommand_master(float request, entity caller, float argc, string vote_co case "do": { vote_command = VoteCommand_extractcommand(vote_command, 3, argc); - + if (!caller.vote_master) { print_to(caller, "^1You do not have vote master privelages."); } else if (!VoteCommand_checknasty(vote_command)) { print_to(caller, "^1Syntax error in command, see 'vhelp' for more info."); } else if (!VoteCommand_parse(caller, vote_command, strcat(autocvar_sv_vote_commands, " ", autocvar_sv_vote_master_commands), 3, argc)) { print_to(caller, "^1This command is not acceptable, see 'vhelp' for more info."); } - + else // everything went okay, proceed with command { localcmd(strcat(vote_parsed_command, "\n")); @@ -859,10 +859,10 @@ void VoteCommand_master(float request, entity caller, float argc, string vote_co bprint("\{1}^2* ^3", GetCallerName(caller), "^2 used their ^3master^2 status to do \"^2", vote_parsed_display, "^2\".\n"); if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vdo:", ftos(caller.playerid), ":", vote_parsed_display)); } } - + return; } - + case "login": { if(autocvar_sv_vote_master_password == "") { print_to(caller, "^1Login to vote master is not allowed."); } @@ -876,21 +876,21 @@ void VoteCommand_master(float request, entity caller, float argc, string vote_co bprint("\{1}^2* ^3", GetCallerName(caller), "^2 logged in as ^3master^2\n"); if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vlogin:", ftos(caller.playerid))); } } - + return; } - + default: // calling a vote for master { - float spectators_allowed = ((autocvar_sv_vote_nospectators != 2) - || ((autocvar_sv_vote_nospectators == 1) && warmup_stage) + float spectators_allowed = ((autocvar_sv_vote_nospectators != 2) + || ((autocvar_sv_vote_nospectators == 1) && warmup_stage) || (autocvar_sv_vote_nospectators == 0)); - + if (!autocvar_sv_vote_master_callable) { print_to(caller, "^1Vote to become vote master is not allowed."); } else if(vote_called) { print_to(caller, "^1There is already a vote called."); } else if(!spectators_allowed && (caller && !IS_PLAYER(caller))) { print_to(caller, "^1Only players can call a vote."); } else if(timeout_status) { print_to(caller, "^1You can not call a vote while a timeout is active."); } - + else // everything went okay, continue with creating vote { vote_caller = caller; @@ -898,25 +898,25 @@ void VoteCommand_master(float request, entity caller, float argc, string vote_co vote_called_command = strzone("XXX"); vote_called_display = strzone("^3master"); vote_endtime = time + autocvar_sv_vote_timeout; - + caller.vote_selection = VOTE_SELECT_ACCEPT; caller.vote_waittime = time + autocvar_sv_vote_wait; - + bprint("\{1}^2* ^3", GetCallerName(vote_caller), "^2 calls a vote to become ^3master^2.\n"); if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vcall:", ftos(vote_caller.playerid), ":", vote_called_display)); } Nagger_VoteChanged(); VoteCount(TRUE); // needed if you are the only one } - + return; } } } else { print_to(caller, "^1Master control of voting is not allowed."); } - + return; } - + default: case CMD_REQUEST_USAGE: { @@ -937,7 +937,7 @@ void VoteCommand_no(float request, entity caller) // CLIENT ONLY if (!vote_called) { print_to(caller, "^1No vote called."); } else if(caller.vote_selection != VOTE_SELECT_NULL && !autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); } else if(((caller == vote_caller) || caller.vote_master) && autocvar_sv_vote_no_stops_vote) { VoteStop(caller); } - + else // everything went okay, continue changing vote { print_to(caller, "^1You rejected the vote."); @@ -945,10 +945,10 @@ void VoteCommand_no(float request, entity caller) // CLIENT ONLY msg_entity = caller; if(!autocvar_sv_vote_singlecount) { VoteCount(FALSE); } } - + return; } - + default: case CMD_REQUEST_USAGE: { @@ -969,10 +969,10 @@ void VoteCommand_status(float request, entity caller) // BOTH print_to(caller, strcat("^7Vote for ", vote_called_display, "^7 called by ^7", GetCallerName(vote_caller), "^7.")); else print_to(caller, "^1No vote called."); - + return; } - + default: case CMD_REQUEST_USAGE: { @@ -992,10 +992,10 @@ void VoteCommand_stop(float request, entity caller) // BOTH if (!vote_called) { print_to(caller, "^1No vote called."); } else if((caller == vote_caller) || !caller || caller.vote_master) { VoteStop(caller); } else { print_to(caller, "^1You are not allowed to stop that vote."); } - + return; } - + default: case CMD_REQUEST_USAGE: { @@ -1014,7 +1014,7 @@ void VoteCommand_yes(float request, entity caller) // CLIENT ONLY { if (!vote_called) { print_to(caller, "^1No vote called."); } else if(caller.vote_selection != VOTE_SELECT_NULL && autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); } - + else // everything went okay, continue changing vote { print_to(caller, "^1You accepted the vote."); @@ -1022,10 +1022,10 @@ void VoteCommand_yes(float request, entity caller) // CLIENT ONLY msg_entity = caller; if(!autocvar_sv_vote_singlecount) { VoteCount(FALSE); } } - + return; } - + default: case CMD_REQUEST_USAGE: { @@ -1044,10 +1044,10 @@ void VoteCommand_(float request) { case CMD_REQUEST_COMMAND: { - + return; } - + default: case CMD_REQUEST_USAGE: { @@ -1085,10 +1085,10 @@ void VoteCommand_macro_help(entity caller, float argc) print_to(caller, "\nVoting commands:\n"); #define VOTE_COMMAND(name,function,description,assignment) \ { if(Votecommand_check_assignment(caller, assignment)) { print_to(caller, strcat(" ^2", name, "^7: ", description)); } } - + VOTE_COMMANDS(0, caller, 0, "") #undef VOTE_COMMAND - + print_to(caller, strcat("\nUsage:^3 ", command_origin, " vote COMMAND...^7, where possible commands are listed above.\n")); print_to(caller, strcat("For help about a specific command, type ", command_origin, " vote help COMMAND")); print_to(caller, strcat("\n^7You can call a vote for or execute these commands: ^3", autocvar_sv_vote_commands, "^7 and maybe further ^3arguments^7")); @@ -1097,11 +1097,11 @@ void VoteCommand_macro_help(entity caller, float argc) { #define VOTE_COMMAND(name,function,description,assignment) \ { if(Votecommand_check_assignment(caller, assignment)) { if(name == strtolower(argv(2))) { function; return; } } } - + VOTE_COMMANDS(CMD_REQUEST_USAGE, caller, argc, "") #undef VOTE_COMMAND } - + return; } @@ -1109,10 +1109,10 @@ float VoteCommand_macro_command(entity caller, float argc, string vote_command) { #define VOTE_COMMAND(name,function,description,assignment) \ { if(Votecommand_check_assignment(caller, assignment)) { if(name == strtolower(argv(1))) { function; return TRUE; } } } - + VOTE_COMMANDS(CMD_REQUEST_COMMAND, caller, argc, vote_command) #undef VOTE_COMMAND - + return FALSE; } @@ -1121,13 +1121,13 @@ float VoteCommand_macro_command(entity caller, float argc, string vote_command) // Main function handling vote commands // ====================================== -void VoteCommand(float request, entity caller, float argc, string vote_command) +void VoteCommand(float request, entity caller, float argc, string vote_command) { // Guide for working with argc arguments by example: // argc: 1 - 2 - 3 - 4 - // argv: 0 - 1 - 2 - 3 + // argv: 0 - 1 - 2 - 3 // cmd vote - master - login - password - + switch(request) { case CMD_REQUEST_COMMAND: @@ -1135,7 +1135,7 @@ void VoteCommand(float request, entity caller, float argc, string vote_command) if(VoteCommand_macro_command(caller, argc, vote_command)) return; } - + default: print_to(caller, strcat(((argv(1) != "") ? strcat("Unknown vote command \"", argv(1), "\"") : "No command provided"), ". For a list of supported commands, try ", GetCommandPrefix(caller), " vote help.\n")); case CMD_REQUEST_USAGE: diff --git a/qcsrc/server/command/vote.qh b/qcsrc/server/command/vote.qh index 1225b6be5..0386e1d5a 100644 --- a/qcsrc/server/command/vote.qh +++ b/qcsrc/server/command/vote.qh @@ -27,7 +27,7 @@ float vote_accept_count; // total amount of players who accept the vote (counted float vote_reject_count; // same as above, but rejected float vote_abstain_count; // same as above, but abstained float vote_needed_overall; // total amount of players NEEDED for a vote to pass (based on sv_vote_majority_factor) -.float vote_master; // flag for if the player has vote master privelages +.float vote_master; // flag for if the player has vote master privelages .float vote_waittime; // flag for how long the player must wait before they can vote again .float vote_selection; // flag for which vote selection the player has made (See VOTE_SELECT_*) string vote_called_command; // command sent by client diff --git a/qcsrc/server/csqcprojectile.qc b/qcsrc/server/csqcprojectile.qc index ac58a90c3..4d208ebda 100644 --- a/qcsrc/server/csqcprojectile.qc +++ b/qcsrc/server/csqcprojectile.qc @@ -52,7 +52,7 @@ float CSQCProjectile_SendEntity(entity to, float sf) if(sf & 2) WriteByte(MSG_ENTITY, self.csqcprojectile_type); // TODO maybe put this into sf? - + return 1; } @@ -69,9 +69,9 @@ void CSQCProjectile_Check(entity e) void CSQCProjectile(entity e, float clientanimate, float type, float docull) { Net_LinkEntity(e, docull, 0, CSQCProjectile_SendEntity); - + e.csqcprojectile_clientanimate = clientanimate; - + if(e.movetype == MOVETYPE_TOSS || e.movetype == MOVETYPE_BOUNCE) { if(e.gravity == 0) diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index fe41a23fa..cb5825011 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -55,7 +55,7 @@ float team1_score, team2_score, team3_score, team4_score; float maxclients; // flag set on worldspawn so that the code knows if it is dedicated or not -float server_is_dedicated; +float server_is_dedicated; // Fields @@ -475,7 +475,7 @@ void target_voicescript_clear(entity pl); .float target_random; .float trigger_reverse; -// Nexball +// Nexball .entity ballcarried; // Also used for keepaway .float metertime; float g_nexball_meter_period; @@ -516,8 +516,8 @@ string matchid; .float last_pickup; -.float hit_time; -.float typehit_time; +.float hit_time; +.float typehit_time; .float stat_leadlimit; diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index b1394db07..195829b40 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -349,7 +349,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype) ) ); #endif - + // ======= // SUICIDE // ======= @@ -370,7 +370,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype) Obituary_SpecialDeath(targ, FALSE, deathtype, targ.netname, deathlocation, "", targ.killcount, 0, 0); break; } - + default: { Obituary_SpecialDeath(targ, FALSE, deathtype, targ.netname, deathlocation, "", targ.killcount, 0, 0); @@ -399,7 +399,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype) GiveFrags(attacker, targ, -1, deathtype); attacker.killcount = 0; - + Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_TEAMKILL_FRAG, targ.netname); Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_TEAMKILL_FRAGGED, attacker.netname); Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM_4(targ.team, INFO_DEATH_TEAMKILL_), targ.netname, attacker.netname, deathlocation, targ.killcount); @@ -527,7 +527,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype) 0); break; } - + default: { Obituary_SpecialDeath(targ, FALSE, deathtype, targ.netname, deathlocation, "", targ.killcount, 0, 0); @@ -558,7 +558,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float { float mirrordamage; float mirrorforce; - float complainteamdamage = 0; + float complainteamdamage = 0; entity attacker_save; mirrordamage = 0; mirrorforce = 0; @@ -596,7 +596,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float // exit the vehicle before killing (fixes a crash) if(IS_PLAYER(targ) && targ.vehicle) vehicles_exit(VHEF_RELESE); - + // These are ALWAYS lethal // No damage modification here // Instead, prepare the victim for his death... @@ -677,7 +677,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float force = force * g_weaponforcefactor; mirrorforce *= g_weaponforcefactor; } - + // should this be changed at all? If so, in what way? frag_attacker = attacker; frag_target = targ; @@ -689,7 +689,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float damage = frag_damage; mirrordamage = frag_mirrordamage; force = frag_force; - + if (!g_minstagib) { // apply strength multiplier @@ -1098,7 +1098,7 @@ float Fire_AddDamage(entity e, entity o, float d, float t, float dt) if(maxtime > mintime || maxdps > mindps) { // Constraints: - + // damage we have right now mindamage = mindps * mintime; diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index 76f7b5b99..0df6ba0ae 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -274,12 +274,12 @@ void GrapplingHook_Damage (entity inflictor, entity attacker, float damage, floa { if(self.health <= 0) return; - + if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions return; // g_balance_projectiledamage says to halt - + self.health = self.health - damage; - + if (self.health <= 0) { if(attacker != self.realowner) diff --git a/qcsrc/server/g_models.qc b/qcsrc/server/g_models.qc index 20a78b7c9..8a2fe9ef3 100644 --- a/qcsrc/server/g_models.qc +++ b/qcsrc/server/g_models.qc @@ -59,7 +59,7 @@ float g_clientmodel_genericsendentity (entity to, float sf) sf |= 0x40; if(self.lodmodelindex1) sf |= 0x80; - + WriteByte(MSG_ENTITY, ENT_CLIENT_WALL); WriteByte(MSG_ENTITY, sf); diff --git a/qcsrc/server/g_subs.qc b/qcsrc/server/g_subs.qc index d32ab2caf..834bb4711 100644 --- a/qcsrc/server/g_subs.qc +++ b/qcsrc/server/g_subs.qc @@ -14,8 +14,8 @@ void spawnfunc_info_null (void) void setanim(entity e, vector anim, float looping, float override, float restart) { if (!anim) - return; // no animation was given to us! We can't use this. - + return; // no animation was given to us! We can't use this. + if (anim_x == e.animstate_startframe) if (anim_y == e.animstate_numframes) if (anim_z == e.animstate_framerate) @@ -294,7 +294,7 @@ void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeedtype, float // the thinking is now done by the controller self.think = SUB_NullThink; // for PushMove self.nextthink = self.ltime + traveltime; - + // invoke controller self = controller; self.think(); diff --git a/qcsrc/server/g_triggers.qc b/qcsrc/server/g_triggers.qc index 884c3e5b2..c0e81fa89 100644 --- a/qcsrc/server/g_triggers.qc +++ b/qcsrc/server/g_triggers.qc @@ -441,7 +441,7 @@ void trigger_hurt_use() .float triggerhurttime; void trigger_hurt_touch() { - if (self.active != ACTIVE_ACTIVE) + if (self.active != ACTIVE_ACTIVE) return; if(self.team) @@ -532,9 +532,9 @@ float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end) .float triggerhealtime; void trigger_heal_touch() { - if (self.active != ACTIVE_ACTIVE) + if (self.active != ACTIVE_ACTIVE) return; - + // only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu) if (other.iscreature) { @@ -544,7 +544,7 @@ void trigger_heal_touch() { EXACTTRIGGER_TOUCH; other.triggerhealtime = time + 1; - + if (other.health < self.max_health) { other.health = min(other.health + self.health, self.max_health); @@ -558,7 +558,7 @@ void trigger_heal_touch() void spawnfunc_trigger_heal() { self.active = ACTIVE_ACTIVE; - + EXACTTRIGGER_INIT; self.touch = trigger_heal_touch; if (!self.health) @@ -942,7 +942,7 @@ void spawnfunc_func_pointparticles() setmodel(self, self.model); if(self.noise != "") precache_sound (self.noise); - + if(!self.bgmscriptsustain) self.bgmscriptsustain = 1; else if(self.bgmscriptsustain < 0) @@ -1369,7 +1369,7 @@ void trigger_impulse_touch1() float pushdeltatime; float str; - if (self.active != ACTIVE_ACTIVE) + if (self.active != ACTIVE_ACTIVE) return; if (!isPushable(other)) @@ -1409,7 +1409,7 @@ void trigger_impulse_touch2() { float pushdeltatime; - if (self.active != ACTIVE_ACTIVE) + if (self.active != ACTIVE_ACTIVE) return; if (!isPushable(other)) @@ -1433,7 +1433,7 @@ void trigger_impulse_touch3() float pushdeltatime; float str; - if (self.active != ACTIVE_ACTIVE) + if (self.active != ACTIVE_ACTIVE) return; if (!isPushable(other)) @@ -1819,7 +1819,7 @@ void spawnfunc_target_voicescript() // added after this message // wait: average time between messages // delay: initial delay before the first message - + float i, n; self.use = target_voicescript_use; @@ -1970,7 +1970,7 @@ string trigger_magicear_processmessage(entity ear, entity source, float teamsay, if(ear.spawnflags & 8) return msgin; } - + matchstart = -1; l = strlen(ear.message); @@ -2110,9 +2110,9 @@ void spawnfunc_trigger_magicear() void relay_activators_use() { entity trg, os; - + os = self; - + for(trg = world; (trg = find(trg, targetname, os.target)); ) { self = trg; @@ -2124,11 +2124,11 @@ void relay_activators_use() if(os.cnt == ACTIVE_TOGGLE) if(trg.active == ACTIVE_ACTIVE) trg.active = ACTIVE_NOT; - else + else trg.active = ACTIVE_ACTIVE; else trg.active = os.cnt; - } + } } self = os; } @@ -2142,13 +2142,13 @@ void spawnfunc_relay_activate() void spawnfunc_relay_deactivate() { self.cnt = ACTIVE_NOT; - self.use = relay_activators_use; + self.use = relay_activators_use; } void spawnfunc_relay_activatetoggle() { self.cnt = ACTIVE_TOGGLE; - self.use = relay_activators_use; + self.use = relay_activators_use; } .string chmap, gametype; diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index e91f52070..b93d4f53d 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -428,7 +428,7 @@ void cvar_changes_init() BADCVAR("g_nix"); BADCVAR("g_grappling_hook"); BADCVAR("g_jetpack"); - + #undef BADPREFIX #undef BADCVAR @@ -1514,7 +1514,7 @@ void NextLevel() PlayerStats_AddGlobalInfo(e); PlayerStats_Shutdown(); WeaponStats_Shutdown(); - + Kill_Notification(NOTIF_ALL, world, MSG_CENTER, 0); // kill all centerprints now if(autocvar_sv_eventlog) diff --git a/qcsrc/server/ipban.qc b/qcsrc/server/ipban.qc index d3ab13459..a180547c0 100644 --- a/qcsrc/server/ipban.qc +++ b/qcsrc/server/ipban.qc @@ -8,7 +8,7 @@ * GET g_ban_sync_uri?action=unban&hostname=...&ip=xxx.xxx.xxx * - Querying the ban list * GET g_ban_sync_uri?action=list&hostname=...&servers=xxx.xxx.xxx.xxx;xxx.xxx.xxx.xxx;... - * + * * shows the bans from the listed servers, and possibly others. * Format of a ban is ASCII plain text, four lines per ban, delimited by * newline ONLY (no carriage return): @@ -114,7 +114,7 @@ void OnlineBanList_URI_Get_Callback(float id, float status, string data) } if(syncinterval > 0) syncinterval *= 60; - + if(status != 0) { print("error: status is ", ftos(status), "\n"); @@ -193,7 +193,7 @@ void OnlineBanList_Think() float argc; string uri; float i, n; - + if(autocvar_g_ban_sync_uri == "") goto killme; if(autocvar_g_ban_sync_interval == 0) // < 0 is okay, it means "sync on level start only" @@ -208,7 +208,7 @@ void OnlineBanList_Think() for(i = 1; i < argc; ++i) OnlineBanList_Servers = strcat(OnlineBanList_Servers, ";", argv(i)); OnlineBanList_Servers = strzone(OnlineBanList_Servers); - + uri = strcat( "action=list&hostname=", uri_escape(autocvar_hostname)); uri = strcat(uri, "&servers=", uri_escape(OnlineBanList_Servers)); @@ -227,7 +227,7 @@ void OnlineBanList_Think() else uri_get(strcat(argv(i), "?", uri), URI_GET_IPBAN + i); // 1000 = "banlist" callback target } - + if(autocvar_g_ban_sync_interval > 0) self.nextthink = time + max(60, autocvar_g_ban_sync_interval * 60); else @@ -321,24 +321,24 @@ void Ban_View() { float i, n; string msg; - + print("^2Listing all existing active bans:\n"); - + n = 0; for(i = 0; i < ban_count; ++i) { if(time > ban_expire[i]) continue; - + ++n; // total number of existing bans - + msg = strcat("#", ftos(i), ": "); msg = strcat(msg, ban_ip[i], " is still banned for "); msg = strcat(msg, ftos(ban_expire[i] - time), " seconds"); - + print(" ", msg, "\n"); } - + print("^2Done listing all active (", ftos(n), ") bans.\n"); } @@ -367,7 +367,7 @@ float Ban_GetClientIP(entity client) i4 = strstrofs(s, ".", i3 + 1); if(i4 >= 0) s = substring(s, 0, i4); - + ban_ip1 = substring(s, 0, i1); // 8 ban_ip2 = substring(s, 0, i2); // 16 ban_ip3 = substring(s, 0, i3); // 24 diff --git a/qcsrc/server/item_key.qc b/qcsrc/server/item_key.qc index f6c8abce3..f181f3764 100644 --- a/qcsrc/server/item_key.qc +++ b/qcsrc/server/item_key.qc @@ -9,7 +9,7 @@ TODO: float item_keys_usekey(entity l, entity p) { float valid = l.itemkeys & p.itemkeys; - + if (!valid) { // other has none of the needed keys return FALSE; @@ -27,15 +27,15 @@ float item_keys_usekey(entity l, entity p) { string item_keys_keylist(float keylist) { float base, l; string n; - + // no keys if (!keylist) return ""; - + // one key if ((keylist & (keylist-1)) != 0) return strcat("the ", item_keys_names[lowestbit(keylist)]); - + n = ""; base = 0; while (keylist) { @@ -44,11 +44,11 @@ string item_keys_keylist(float keylist) { n = strcat(n, ", the ", item_keys_names[base + l]); else n = strcat("the ", item_keys_names[base + l]); - + keylist = bitshift(keylist, -(l + 1)); base+= l + 1; } - + return n; } @@ -65,14 +65,14 @@ item_key void item_key_touch(void) { if (!IS_PLAYER(other)) return; - + // player already picked up this key if (other.itemkeys & self.itemkeys) return; - + other.itemkeys |= self.itemkeys; play2(other, self.noise); - + centerprint(other, self.message); }; @@ -81,17 +81,17 @@ void item_key_touch(void) { */ void spawn_item_key() { precache_model(self.model); - + if (self.spawnflags & 1) // FLOATING self.noalign = 1; - + if (self.noalign) self.movetype = MOVETYPE_NONE; else self.movetype = MOVETYPE_TOSS; - + precache_sound(self.noise); - + self.mdl = self.model; self.effects = EF_LOWPRECISION; setmodel(self, self.model); @@ -100,7 +100,7 @@ void spawn_item_key() { setsize(self, '-16 -16 -56', '16 16 0'); self.modelflags |= MF_ROTATE; self.solid = SOLID_TRIGGER; - + if (!self.noalign) { // first nudge it off the floor a little bit to avoid math errors @@ -116,7 +116,7 @@ void spawn_item_key() { /*QUAKED item_key (0 .5 .8) (-16 -16 -24) (16 16 32) FLOATING A key entity. The itemkeys should contain one of the following key IDs: -1 - GOLD key - +1 - GOLD key - 2 - SILVER key 4 - BRONZE key 8 - RED keycard @@ -142,7 +142,7 @@ itemkeys MUST always have exactly one bit set. void spawnfunc_item_key() { local string _model, _netname; local vector _colormod; - + // reject this entity if more than one key was set! if (self.itemkeys>0 && (self.itemkeys & (self.itemkeys-1)) != 0) { objerror("item_key.itemkeys must contain only 1 bit set specifying the key it represents!"); @@ -156,32 +156,32 @@ void spawnfunc_item_key() { _netname = "GOLD key"; _colormod = '1 .9 0'; break; - + case 2: _netname = "SILVER key"; _colormod = '.9 .9 .9'; break; - + case 4: _netname = "BRONZE key"; _colormod = '.6 .25 0'; break; - + case 8: _netname = "RED keycard"; _colormod = '.9 0 0'; break; - + case 16: _netname = "BLUE keycard"; _colormod = '0 0 .9'; break; - + case 32: _netname = "GREEN keycard"; _colormod = '0 .9 0'; break; - + default: _netname = "FLUFFY PINK keycard"; _colormod = '1 1 1'; @@ -192,9 +192,9 @@ void spawnfunc_item_key() { return; } break; - + } - + // find default model #ifdef GMQCC _model = string_null; @@ -208,30 +208,30 @@ void spawnfunc_item_key() { remove(self); return; } - + // set defailt netname if (self.netname == "") self.netname = _netname; - + // set default colormod if (!self.colormod) self.colormod = _colormod; - + // set default model if (self.model == "") self.model = _model; - + // set default pickup message if (self.message == "") self.message = strzone(strcat("You've picked up the ", self.netname, "!")); if (self.noise == "") self.noise = "misc/itempickup.wav"; - + // save the name for later item_keys_names[lowestbit(self.itemkeys)] = self.netname; - // put the key on the map + // put the key on the map spawn_item_key(); } @@ -283,12 +283,12 @@ trigger_keylock */ void trigger_keylock_trigger(string s) { local entity t, stemp, otemp, atemp; - + stemp = self; otemp = other; atemp = activator; - - + + for(t = world; (t = find(t, targetname, s)); ) if (t.use) { self = t; @@ -296,7 +296,7 @@ void trigger_keylock_trigger(string s) { activator = atemp; self.use(); } - + self = stemp; other = otemp; activator = atemp; @@ -313,21 +313,21 @@ void trigger_keylock_kill(string s) { void trigger_keylock_touch(void) { local float key_used, started_delay; - + key_used = FALSE; started_delay = FALSE; - + // only player may trigger the lock if (!IS_PLAYER(other)) return; - - + + // check silver key if (self.itemkeys) key_used = item_keys_usekey(self, other); - + activator = other; - + if (self.itemkeys) { // at least one of the keys is missing if (key_used) { @@ -341,7 +341,7 @@ void trigger_keylock_touch(void) { centerprint(other, strcat("You need ", item_keys_keylist(self.itemkeys), "!")); other.key_door_messagetime = time + 2; } - + // trigger target2 if (self.delay <= time || started_delay == TRUE) if (self.target2) { @@ -353,16 +353,16 @@ void trigger_keylock_touch(void) { // all keys were given! play2(other, self.noise); centerprint(other, self.message); - + if (self.target) trigger_keylock_trigger(self.target); - + if (self.killtarget) trigger_keylock_kill(self.killtarget); - + remove(self); } - + }; /*QUAKED trigger_keylock (.0 .5 .8) ? @@ -390,10 +390,10 @@ void spawnfunc_trigger_keylock(void) { return; } - // set unlocked message + // set unlocked message if (self.message == "") self.message = "Unlocked!"; - + // set default unlock noise if (self.noise == "") { if (self.sounds == 1) @@ -403,26 +403,26 @@ void spawnfunc_trigger_keylock(void) { else //if (self.sounds == 3) { self.noise = "misc/trigger1.wav"; } - + // set default use key sound if (self.noise1 == "") self.noise1 = "misc/decreasevalue.wav"; - + // set closed sourd if (self.noise2 == "") self.noise2 = "misc/talk.wav"; - + // delay between triggering message2 and trigger2 if (!self.wait) self.wait = 5; - + // precache sounds precache_sound(self.noise); precache_sound(self.noise1); precache_sound(self.noise2); - + EXACTTRIGGER_INIT; - + self.touch = trigger_keylock_touch; }; diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index c1298d0e7..947a6b92a 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -648,16 +648,16 @@ float want_weapon(string cvarprefix, entity weaponinfo, float allguns) d = 0; // weapon is set a few lines later else d = (i == WEP_LASER || i == WEP_SHOTGUN); - + if(g_grappling_hook) // if possible, redirect off-hand hook to on-hand hook d |= (i == WEP_HOOK); if(weaponinfo.spawnflags & WEP_FLAG_MUTATORBLOCKED) // never default mutator blocked guns d = 0; var float t = cvar(strcat(cvarprefix, weaponinfo.netname)); - + //print(strcat("want_weapon: ", weaponinfo.netname, " - d: ", ftos(d), ", t: ", ftos(t), ". \n")); - + // bit order in t: // 1: want or not // 2: is default? @@ -789,7 +789,7 @@ void readplayerstartcvars() if(!cvar("g_use_ammunition")) start_items |= IT_UNLIMITED_AMMO; - + if(start_items & IT_UNLIMITED_WEAPON_AMMO) { start_ammo_rockets = 999; @@ -907,7 +907,7 @@ void readlevelcvars(void) // load mutators #define CHECK_MUTATOR_ADD(mut_cvar,mut_name,dependence) \ { if(cvar(mut_cvar) && dependence) { MUTATOR_ADD(mut_name); } } - + CHECK_MUTATOR_ADD("g_dodging", mutator_dodging, 1); CHECK_MUTATOR_ADD("g_spawn_near_teammate", mutator_spawn_near_teammate, 1); CHECK_MUTATOR_ADD("g_physical_items", mutator_physical_items, 1); @@ -928,9 +928,9 @@ void readlevelcvars(void) CHECK_MUTATOR_ADD("g_nades", mutator_nades, 1); CHECK_MUTATOR_ADD("g_sandbox", sandbox, 1); CHECK_MUTATOR_ADD("g_campcheck", mutator_campcheck, 1); - + #undef CHECK_MUTATOR_ADD - + if(cvar("sv_allow_fullbright")) serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT; @@ -949,7 +949,7 @@ void readlevelcvars(void) g_bugrigs_speed_ref = cvar("g_bugrigs_speed_ref"); g_bugrigs_speed_pow = cvar("g_bugrigs_speed_pow"); g_bugrigs_steer = cvar("g_bugrigs_steer"); - + g_minstagib = cvar("g_minstagib"); sv_clones = cvar("sv_clones"); @@ -1818,7 +1818,7 @@ string uid2name(string myuid) { db_put(ServerProgsDB, strcat("uid2name", myuid), ""); } } - + if(s == "") s = "^1Unregistered Player"; return s; diff --git a/qcsrc/server/movelib.qc b/qcsrc/server/movelib.qc index 9b9f7fde0..de82b16a8 100644 --- a/qcsrc/server/movelib.qc +++ b/qcsrc/server/movelib.qc @@ -1,4 +1,4 @@ -#ifdef SVQC +#ifdef SVQC .vector moveto; /** diff --git a/qcsrc/server/mutators/base.qh b/qcsrc/server/mutators/base.qh index 98a44944d..893ebb301 100644 --- a/qcsrc/server/mutators/base.qh +++ b/qcsrc/server/mutators/base.qh @@ -72,7 +72,7 @@ MUTATOR_HOOKABLE(PlayerDies); entity frag_attacker; entity frag_target; // same as self float frag_deathtype; - + MUTATOR_HOOKABLE(PlayerJump); // called when a player presses the jump key // INPUT, OUTPUT: @@ -114,7 +114,7 @@ MUTATOR_HOOKABLE(BuildMutatorsPrettyString); // appends ", Mutator name" to ret_string for display // INPUT, OUTPUT: string ret_string; - + MUTATOR_HOOKABLE(CustomizeWaypoint); // called every frame // customizes the waypoint for spectators @@ -127,7 +127,7 @@ MUTATOR_HOOKABLE(FilterItem); MUTATOR_HOOKABLE(TurretSpawn); // return error to request removal // INPUT: self - turret - + MUTATOR_HOOKABLE(OnEntityPreSpawn); // return error to prevent entity spawn, or modify the entity @@ -163,7 +163,7 @@ MUTATOR_HOOKABLE(PlayerDamage_SplitHealthArmor); // INPUT, OUTPUT: float damage_take; float damage_save; - + MUTATOR_HOOKABLE(PlayerDamage_Calculate); // called to adjust damage and force values which are applied to the player, used for e.g. strength damage/force multiplier // i'm not sure if I should change this around slightly (Naming of the entities, and also how they're done in g_damage). @@ -180,7 +180,7 @@ MUTATOR_HOOKABLE(PlayerPowerups); // called at the end of player_powerups() in cl_client.qc, used for manipulating the values which are set by powerup items. // INPUT entity self; - float olditems; // also technically output, but since it is at the end of the function it's useless for that :P + float olditems; // also technically output, but since it is at the end of the function it's useless for that :P MUTATOR_HOOKABLE(PlayerUseKey); // called when the use key is pressed @@ -231,7 +231,7 @@ MUTATOR_HOOKABLE(SV_StartFrame); MUTATOR_HOOKABLE(SetModname); // OUT string modname; // name of the mutator/mod if it warrants showing as such in the server browser - + MUTATOR_HOOKABLE(Item_Spawn); // called for each item being spawned on a map, including dropped weapons // return 1 to remove an item @@ -244,13 +244,13 @@ MUTATOR_HOOKABLE(SetWeaponreplace); entity other; // weapon info // IN+OUT string ret_string; - + MUTATOR_HOOKABLE(Item_RespawnCountdown); // called when an item is about to respawn // INPUT+OUTPUT: string item_name; vector item_color; - + MUTATOR_HOOKABLE(BotShouldAttack); // called when a bot checks a target to attack // INPUT @@ -261,7 +261,7 @@ MUTATOR_HOOKABLE(PortalTeleport); // allows you to strip a player of an item if they go through the teleporter to help prevent cheating // INPUT entity self; - + MUTATOR_HOOKABLE(HelpMePing); // called whenever a player uses impulse 33 (help me) in cl_impulse.qc // normally help me ping uses self.waypointsprite_attachedforcarrier, @@ -269,32 +269,32 @@ MUTATOR_HOOKABLE(HelpMePing); // in a special manner using this hook // INPUT entity self; // the player who pressed impulse 33 - + MUTATOR_HOOKABLE(VehicleSpawn); // called when a vehicle initializes // return TRUE to remove the vehicle - + MUTATOR_HOOKABLE(VehicleEnter); // called when a player enters a vehicle // allows mutators to set special settings in this event // INPUT entity vh_player; // player entity vh_vehicle; // vehicle - + MUTATOR_HOOKABLE(VehicleTouch); // called when a player touches a vehicle // return TRUE to stop player from entering the vehicle // INPUT entity self; // vehicle entity other; // player - + MUTATOR_HOOKABLE(VehicleExit); // called when a player exits a vehicle // allows mutators to set special settings in this event // INPUT entity vh_player; // player entity vh_vehicle; // vehicle - + MUTATOR_HOOKABLE(AbortSpeedrun); // called when a speedrun is aborted and the player is teleported back to start position // INPUT diff --git a/qcsrc/server/mutators/gamemode_arena.qc b/qcsrc/server/mutators/gamemode_arena.qc index bb6312ea1..2a9e677a2 100644 --- a/qcsrc/server/mutators/gamemode_arena.qc +++ b/qcsrc/server/mutators/gamemode_arena.qc @@ -242,7 +242,7 @@ MUTATOR_HOOKFUNCTION(arena_FilterItem) if(autocvar_g_powerups <= 0) if(self.flags & FL_POWERUP) return TRUE; - + return FALSE; } diff --git a/qcsrc/server/mutators/gamemode_assault.qc b/qcsrc/server/mutators/gamemode_assault.qc index ceeb51dd9..0325067f2 100644 --- a/qcsrc/server/mutators/gamemode_assault.qc +++ b/qcsrc/server/mutators/gamemode_assault.qc @@ -267,7 +267,7 @@ void assault_new_round() void spawnfunc_info_player_attacker() { if (!g_assault) { remove(self); return; } - + self.team = NUM_TEAM_1; // red, gets swapped every round spawnfunc_info_player_deathmatch(); } @@ -275,7 +275,7 @@ void spawnfunc_info_player_attacker() void spawnfunc_info_player_defender() { if (!g_assault) { remove(self); return; } - + self.team = NUM_TEAM_2; // blue, gets swapped every round spawnfunc_info_player_deathmatch(); } @@ -283,7 +283,7 @@ void spawnfunc_info_player_defender() void spawnfunc_target_objective() { if (!g_assault) { remove(self); return; } - + self.classname = "target_objective"; self.use = assault_objective_use; assault_objective_reset(); @@ -312,10 +312,10 @@ void spawnfunc_target_objective_decrease() void spawnfunc_func_assault_destructible() { if (!g_assault) { remove(self); return; } - + self.spawnflags = 3; self.classname = "func_assault_destructible"; - + if(assault_attacker_team == NUM_TEAM_1) self.team = NUM_TEAM_2; else @@ -327,7 +327,7 @@ void spawnfunc_func_assault_destructible() void spawnfunc_func_assault_wall() { if (!g_assault) { remove(self); return; } - + self.classname = "func_assault_wall"; self.mdl = self.model; setmodel(self, self.mdl); @@ -351,7 +351,7 @@ void spawnfunc_target_assault_roundend() void spawnfunc_target_assault_roundstart() { if (!g_assault) { remove(self); return; } - + assault_attacker_team = NUM_TEAM_1; self.classname = "target_assault_roundstart"; self.use = assault_roundstart_use; @@ -549,7 +549,7 @@ MUTATOR_HOOKFUNCTION(assault_PlayerSpawn) centerprint(self, "You are attacking!"); else centerprint(self, "You are defending!"); - + return FALSE; } @@ -589,7 +589,7 @@ MUTATOR_DEFINITION(gamemode_assault) MUTATOR_HOOK(TurretSpawn, assault_TurretSpawn, CBC_ORDER_ANY); MUTATOR_HOOK(VehicleSpawn, assault_VehicleSpawn, CBC_ORDER_ANY); MUTATOR_HOOK(HavocBot_ChooseRule, assault_BotRoles, CBC_ORDER_ANY); - + MUTATOR_ONADD { if(time > 1) // game loads at time 1 diff --git a/qcsrc/server/mutators/gamemode_ca.qc b/qcsrc/server/mutators/gamemode_ca.qc index f55c46e00..9fbd483ca 100644 --- a/qcsrc/server/mutators/gamemode_ca.qc +++ b/qcsrc/server/mutators/gamemode_ca.qc @@ -232,7 +232,7 @@ MUTATOR_HOOKFUNCTION(ca_SetStartItems) start_ammo_rockets = cvar("g_lms_start_ammo_rockets"); start_ammo_cells = cvar("g_lms_start_ammo_cells"); start_ammo_fuel = cvar("g_lms_start_ammo_fuel"); - + start_items &= ~IT_UNLIMITED_AMMO; return 0; @@ -244,9 +244,9 @@ MUTATOR_HOOKFUNCTION(ca_PlayerDamage) if(frag_target.deadflag == DEAD_NO) if(frag_target == frag_attacker || SAME_TEAM(frag_target, frag_attacker) || frag_deathtype == DEATH_FALL) frag_damage = 0; - + frag_mirrordamage = 0; - + return FALSE; } @@ -255,20 +255,20 @@ MUTATOR_HOOKFUNCTION(ca_FilterItem) if(autocvar_g_powerups <= 0) if(self.flags & FL_POWERUP) return TRUE; - + if(autocvar_g_pickup_items <= 0) return TRUE; - + return FALSE; } MUTATOR_HOOKFUNCTION(ca_PlayerDamage_SplitHealthArmor) { float excess = max(0, frag_damage - damage_take - damage_save); - + if(frag_target != frag_attacker && IS_PLAYER(frag_attacker)) PlayerTeamScore_Add(frag_attacker, SP_SCORE, ST_SCORE, (frag_damage - excess) * autocvar_g_ca_damage2score_multiplier); - + return FALSE; } diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 42e7b6294..19cc563f8 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -25,20 +25,20 @@ void ctf_CaptureRecord(entity flag, entity player) float cap_record = ctf_captimerecord; float cap_time = (time - flag.ctf_pickuptime); string refername = db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname")); - + // notify about shit if(!ctf_captimerecord) { Send_Notification(NOTIF_ALL, world, MSG_CHOICE, APP_TEAM_ENT_2(flag, CHOICE_CTF_CAPTURE_TIME_), player.netname, (cap_time * 100)); } else if(cap_time < cap_record) { Send_Notification(NOTIF_ALL, world, MSG_CHOICE, APP_TEAM_ENT_2(flag, CHOICE_CTF_CAPTURE_BROKEN_), player.netname, refername, (cap_time * 100), (cap_record * 100)); } else { Send_Notification(NOTIF_ALL, world, MSG_CHOICE, APP_TEAM_ENT_2(flag, CHOICE_CTF_CAPTURE_UNBROKEN_), player.netname, refername, (cap_time * 100), (cap_record * 100)); } - + // write that shit in the database if((!ctf_captimerecord) || (cap_time < cap_record)) { ctf_captimerecord = cap_time; db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time"), ftos(cap_time)); db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"), player.netname); - write_recordmarker(player, (time - cap_time), cap_time); - } + write_recordmarker(player, (time - cap_time), cap_time); + } } void ctf_FlagcarrierWaypoints(entity player) @@ -92,7 +92,7 @@ float ctf_CheckPassDirection(vector head_center, vector passer_center, vector pa float ang; // angle between shotdir and h float h; // hypotenuse, which is the distance between attacker to head float a; // adjacent side, which is the distance between attacker and the point on w_shotdir that is closest to head.origin - + h = vlen(head_center - passer_center); ang = acos(dotproduct(normalize(head_center - passer_center), v_forward)); a = h * cos(ang); @@ -113,10 +113,10 @@ float ctf_CheckPassDirection(vector head_center, vector passer_center, vector pa // ======================= -// CaptureShield Functions +// CaptureShield Functions // ======================= -float ctf_CaptureShield_CheckStatus(entity p) +float ctf_CaptureShield_CheckStatus(entity p) { float s, se; entity e; @@ -142,7 +142,7 @@ float ctf_CaptureShield_CheckStatus(entity p) // player is in the worse half, if >= half the players are better than him, or consequently, if < half of the players are worse // use this rule here - + if(players_worseeq >= players_total * ctf_captureshield_max_ratio) return FALSE; @@ -163,7 +163,7 @@ float ctf_CaptureShield_Customize() { if(!other.ctf_captureshielded) { return FALSE; } if(SAME_TEAM(self, other)) { return FALSE; } - + return TRUE; } @@ -171,7 +171,7 @@ void ctf_CaptureShield_Touch() { if(!other.ctf_captureshielded) { return; } if(SAME_TEAM(self, other)) { return; } - + vector mymid = (self.absmin + self.absmax) * 0.5; vector othermid = (other.absmin + other.absmax) * 0.5; @@ -182,7 +182,7 @@ void ctf_CaptureShield_Touch() void ctf_CaptureShield_Spawn(entity flag) { entity shield = spawn(); - + shield.enemy = self; shield.team = self.team; shield.touch = ctf_CaptureShield_Touch; @@ -193,7 +193,7 @@ void ctf_CaptureShield_Spawn(entity flag) shield.solid = SOLID_TRIGGER; shield.avelocity = '7 0 11'; shield.scale = 0.5; - + setorigin(shield, self.origin); setmodel(shield, "models/ctf/shield.md3"); setsize(shield, shield.scale * shield.mins, shield.scale * shield.maxs); @@ -217,16 +217,16 @@ void ctf_Handle_Drop(entity flag, entity player, float droptype) flag.ctf_droptime = time; flag.ctf_dropper = player; flag.ctf_status = FLAG_DROPPED; - + // messages and sounds Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_LOST_), player.netname); sound(flag, CH_TRIGGER, flag.snd_flag_dropped, VOL_BASE, ATTEN_NONE); ctf_EventLog("dropped", player.team, player); // scoring - PlayerTeamScore_AddScore(player, -autocvar_g_ctf_score_penalty_drop); + PlayerTeamScore_AddScore(player, -autocvar_g_ctf_score_penalty_drop); PlayerScore_Add(player, SP_CTF_DROPS, 1); - + // waypoints if(autocvar_g_ctf_flag_dropped_waypoint) WaypointSprite_Spawn("flagdropped", 0, 0, flag, FLAG_WAYPOINT_OFFSET, world, ((autocvar_g_ctf_flag_dropped_waypoint == 2) ? 0 : player.team), flag, wps_flagdropped, TRUE, RADARICON_FLAG, WPCOLOR_DROPPEDFLAG(flag.team)); @@ -236,9 +236,9 @@ void ctf_Handle_Drop(entity flag, entity player, float droptype) WaypointSprite_UpdateMaxHealth(flag.wps_flagdropped, flag.max_flag_health); WaypointSprite_UpdateHealth(flag.wps_flagdropped, flag.health); } - + player.throw_antispam = time + autocvar_g_ctf_pass_wait; - + if(droptype == DROP_PASS) { flag.pass_distance = 0; @@ -251,11 +251,11 @@ void ctf_Handle_Retrieve(entity flag, entity player) { entity tmp_player; // temporary entity which the FOR_EACH_PLAYER loop uses to scan players entity sender = flag.pass_sender; - + // transfer flag to player flag.owner = player; flag.owner.flagcarried = flag; - + // reset flag setattachment(flag, player, ""); setorigin(flag, FLAG_CARRY_OFFSET); @@ -268,7 +268,7 @@ void ctf_Handle_Retrieve(entity flag, entity player) // messages and sounds sound(player, CH_TRIGGER, flag.snd_flag_pass, VOL_BASE, ATTEN_NORM); ctf_EventLog("receive", flag.team, player); - + FOR_EACH_REALPLAYER(tmp_player) { if(tmp_player == sender) @@ -278,10 +278,10 @@ void ctf_Handle_Retrieve(entity flag, entity player) else if(SAME_TEAM(tmp_player, sender)) Send_Notification(NOTIF_ONE, tmp_player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PASS_OTHER_), sender.netname, player.netname); } - + // create new waypoint ctf_FlagcarrierWaypoints(player); - + sender.throw_antispam = time + autocvar_g_ctf_pass_wait; player.throw_antispam = sender.throw_antispam; @@ -294,12 +294,12 @@ void ctf_Handle_Throw(entity player, entity receiver, float droptype) { entity flag = player.flagcarried; vector targ_origin, flag_velocity; - + if(!flag) { return; } if((droptype == DROP_PASS) && !receiver) { return; } - + if(flag.speedrunning) { ctf_RespawnFlag(flag); return; } - + // reset the flag setattachment(flag, world, ""); setorigin(flag, player.origin + FLAG_DROP_OFFSET); @@ -308,9 +308,9 @@ void ctf_Handle_Throw(entity player, entity receiver, float droptype) flag.solid = SOLID_TRIGGER; flag.ctf_dropper = player; flag.ctf_droptime = time; - + flag.flags = FL_ITEM | FL_NOTARGET; // clear FL_ONGROUND for MOVETYPE_TOSS - + switch(droptype) { case DROP_PASS: @@ -331,30 +331,30 @@ void ctf_Handle_Throw(entity player, entity receiver, float droptype) flag.pass_sender = player; flag.pass_target = receiver; flag.ctf_status = FLAG_PASSING; - + // other sound(player, CH_TRIGGER, flag.snd_flag_touch, VOL_BASE, ATTEN_NORM); WarpZone_TrailParticles(world, particleeffectnum(flag.passeffect), player.origin, targ_origin); ctf_EventLog("pass", flag.team, player); break; } - + case DROP_THROW: { makevectors((player.v_angle_y * '0 1 0') + (bound(autocvar_g_ctf_throw_angle_min, player.v_angle_x, autocvar_g_ctf_throw_angle_max) * '1 0 0')); - + flag_velocity = (('0 0 1' * autocvar_g_ctf_throw_velocity_up) + ((v_forward * autocvar_g_ctf_throw_velocity_forward) * ((player.items & IT_STRENGTH) ? autocvar_g_ctf_throw_strengthmultiplier : 1))); flag.velocity = W_CalculateProjectileVelocity(player.velocity, flag_velocity, FALSE); ctf_Handle_Drop(flag, player, droptype); break; } - + case DROP_RESET: { flag.velocity = '0 0 0'; // do nothing break; } - + default: case DROP_NORMAL: { @@ -367,10 +367,10 @@ void ctf_Handle_Throw(entity player, entity receiver, float droptype) // kill old waypointsprite WaypointSprite_Ping(player.wps_flagcarrier); WaypointSprite_Kill(player.wps_flagcarrier); - + if(player.wps_enemyflagcarrier) WaypointSprite_Kill(player.wps_enemyflagcarrier); - + // captureshield ctf_CaptureShield_Update(player, 0); // shield player from picking up flag } @@ -384,22 +384,22 @@ void ctf_Handle_Capture(entity flag, entity toucher, float capturetype) { entity enemy_flag = ((capturetype == CAPTURE_NORMAL) ? toucher.flagcarried : toucher); entity player = ((capturetype == CAPTURE_NORMAL) ? toucher : enemy_flag.ctf_dropper); - float old_time, new_time; - + float old_time, new_time; + if (!player) { return; } // without someone to give the reward to, we can't possibly cap - + // messages and sounds Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_ENT_2(enemy_flag, CENTER_CTF_CAPTURE_)); ctf_CaptureRecord(enemy_flag, player); sound(player, CH_TRIGGER, flag.snd_flag_capture, VOL_BASE, ATTEN_NONE); - + switch(capturetype) { case CAPTURE_NORMAL: ctf_EventLog("capture", enemy_flag.team, player); break; case CAPTURE_DROPPED: ctf_EventLog("droppedcapture", enemy_flag.team, player); break; default: break; } - + // scoring PlayerTeamScore_AddScore(player, autocvar_g_ctf_score_capture); PlayerTeamScore_Add(player, SP_CTF_CAPS, ST_CTF_CAPS, 1); @@ -418,11 +418,11 @@ void ctf_Handle_Capture(entity flag, entity toucher, float capturetype) { WaypointSprite_Kill(player.wps_flagcarrier); if(flag.speedrunning) { ctf_FakeTimeLimit(player, -1); } - + if((enemy_flag.ctf_dropper) && (player != enemy_flag.ctf_dropper)) { PlayerTeamScore_AddScore(enemy_flag.ctf_dropper, autocvar_g_ctf_score_capture_assist); } } - + // reset the flag player.next_take_time = time + autocvar_g_ctf_flag_collect_delay; ctf_RespawnFlag(enemy_flag); @@ -441,14 +441,14 @@ void ctf_Handle_Return(entity flag, entity player) PlayerScore_Add(player, SP_CTF_RETURNS, 1); // add to count of returns TeamScore_AddToTeam(flag.team, ST_SCORE, -autocvar_g_ctf_score_penalty_returned); // punish the team who was last carrying it - - if(flag.ctf_dropper) + + if(flag.ctf_dropper) { PlayerScore_Add(flag.ctf_dropper, SP_SCORE, -autocvar_g_ctf_score_penalty_returned); // punish the player who dropped the flag - ctf_CaptureShield_Update(flag.ctf_dropper, 0); // shield player from picking up flag + ctf_CaptureShield_Update(flag.ctf_dropper, 0); // shield player from picking up flag flag.ctf_dropper.next_take_time = time + autocvar_g_ctf_flag_collect_delay; // set next take time } - + // reset the flag ctf_RespawnFlag(flag); } @@ -457,20 +457,20 @@ void ctf_Handle_Pickup(entity flag, entity player, float pickuptype) { // declarations float pickup_dropped_score; // used to calculate dropped pickup score - + // attach the flag to the player flag.owner = player; player.flagcarried = flag; setattachment(flag, player, ""); setorigin(flag, FLAG_CARRY_OFFSET); - + // flag setup flag.movetype = MOVETYPE_NONE; flag.takedamage = DAMAGE_NO; flag.solid = SOLID_NOT; flag.angles = '0 0 0'; flag.ctf_status = FLAG_CARRY; - + switch(pickuptype) { case PICKUP_BASE: flag.ctf_pickuptime = time; break; // used for timing runs @@ -479,26 +479,26 @@ void ctf_Handle_Pickup(entity flag, entity player, float pickuptype) } // messages and sounds - Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_PICKUP_), player.netname); + Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_PICKUP_), player.netname); Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PICKUP_)); if(ctf_stalemate) { Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_STALEMATE_CARRIER); } - + Send_Notification(NOTIF_TEAM_EXCEPT, player, MSG_CHOICE, CHOICE_CTF_PICKUP_TEAM, Team_ColorCode(player.team), player.netname); Send_Notification(NOTIF_TEAM, flag, MSG_CHOICE, CHOICE_CTF_PICKUP_ENEMY, Team_ColorCode(player.team), player.netname); - + sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTEN_NONE); - + // scoring PlayerScore_Add(player, SP_CTF_PICKUPS, 1); switch(pickuptype) - { + { case PICKUP_BASE: { PlayerTeamScore_AddScore(player, autocvar_g_ctf_score_pickup_base); ctf_EventLog("steal", flag.team, player); break; } - + case PICKUP_DROPPED: { pickup_dropped_score = (autocvar_g_ctf_flag_return_time ? bound(0, ((flag.ctf_droptime + autocvar_g_ctf_flag_return_time) - time) / autocvar_g_ctf_flag_return_time, 1) : 1); @@ -508,10 +508,10 @@ void ctf_Handle_Pickup(entity flag, entity player, float pickuptype) ctf_EventLog("pickup", flag.team, player); break; } - + default: break; } - + // speedrunning if(pickuptype == PICKUP_BASE) { @@ -519,11 +519,11 @@ void ctf_Handle_Pickup(entity flag, entity player, float pickuptype) if((player.speedrunning) && (ctf_captimerecord)) ctf_FakeTimeLimit(player, time + ctf_captimerecord); } - + // effects pointparticles(particleeffectnum(flag.toucheffect), player.origin, '0 0 0', 1); - - // waypoints + + // waypoints if(pickuptype == PICKUP_DROPPED) { WaypointSprite_Kill(flag.wps_flagdropped); } ctf_FlagcarrierWaypoints(player); WaypointSprite_Ping(player.wps_flagcarrier); @@ -539,7 +539,7 @@ void ctf_CheckFlagReturn(entity flag, float returntype) if((flag.ctf_status == FLAG_DROPPED) || (flag.ctf_status == FLAG_PASSING)) { if(flag.wps_flagdropped) { WaypointSprite_UpdateHealth(flag.wps_flagdropped, flag.health); } - + if((flag.health <= 0) || (time >= flag.ctf_droptime + autocvar_g_ctf_flag_return_time)) { switch(returntype) @@ -548,7 +548,7 @@ void ctf_CheckFlagReturn(entity flag, float returntype) case RETURN_DAMAGE: Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_DAMAGED_)); break; case RETURN_SPEEDRUN: Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_SPEEDRUN_), ctf_captimerecord); break; case RETURN_NEEDKILL: Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_NEEDKILL_)); break; - + default: case RETURN_TIMEOUT: { Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_TIMEOUT_)); break; } @@ -577,7 +577,7 @@ void ctf_CheckStalemate(void) { tmp_entity.ctf_staleflagnext = ctf_staleflaglist; // link flag into staleflaglist ctf_staleflaglist = tmp_entity; - + switch(tmp_entity.team) { case NUM_TEAM_1: ++stale_red_flags; break; @@ -592,7 +592,7 @@ void ctf_CheckStalemate(void) { ctf_stalemate = FALSE; wpforenemy_announced = FALSE; } else if((!stale_red_flags || !stale_blue_flags) && autocvar_g_ctf_stalemate_endcondition == 1) { ctf_stalemate = FALSE; wpforenemy_announced = FALSE; } - + // if sufficient stalemate, then set up the waypointsprite and announce the stalemate if necessary if(ctf_stalemate) { @@ -601,12 +601,12 @@ void ctf_CheckStalemate(void) if((tmp_entity.owner) && (!tmp_entity.owner.wps_enemyflagcarrier)) WaypointSprite_Spawn("enemyflagcarrier", 0, 0, tmp_entity.owner, FLAG_WAYPOINT_OFFSET, world, tmp_entity.team, tmp_entity.owner, wps_enemyflagcarrier, TRUE, RADARICON_FLAG, WPCOLOR_ENEMYFC(tmp_entity.owner.team)); } - + if (!wpforenemy_announced) { FOR_EACH_REALPLAYER(tmp_entity) Send_Notification(NOTIF_ONE, tmp_entity, MSG_CENTER, ((tmp_entity.flagcarried) ? CENTER_CTF_STALEMATE_CARRIER : CENTER_CTF_STALEMATE_OTHER)); - + wpforenemy_announced = TRUE; } } @@ -621,7 +621,7 @@ void ctf_FlagDamage(entity inflictor, entity attacker, float damage, float death ctf_CheckFlagReturn(self, RETURN_NEEDKILL); return; } - if(autocvar_g_ctf_flag_return_damage) + if(autocvar_g_ctf_flag_return_damage) { // reduce health and check if it should be returned self.health = self.health - damage; @@ -648,7 +648,7 @@ void ctf_FlagThink() tracebox(self.origin, FLAG_MIN, FLAG_MAX, self.origin, MOVE_NOMONSTERS, self); if(!trace_startsolid) // can we resize it without getting stuck? setsize(self, FLAG_MIN, FLAG_MAX); } - + switch(self.ctf_status) // reset flag angles in case warpzones adjust it { case FLAG_DROPPED: @@ -656,13 +656,13 @@ void ctf_FlagThink() self.angles = '0 0 0'; break; } - + default: break; } // main think method switch(self.ctf_status) - { + { case FLAG_BASE: { if(autocvar_g_ctf_dropped_capture_radius) @@ -675,7 +675,7 @@ void ctf_FlagThink() } return; } - + case FLAG_DROPPED: { if(autocvar_g_ctf_flag_dropped_floatinwater) @@ -684,7 +684,7 @@ void ctf_FlagThink() if(pointcontents(midpoint) == CONTENT_WATER) { self.velocity = self.velocity * 0.5; - + if(pointcontents(midpoint + FLAG_FLOAT_OFFSET) == CONTENT_WATER) { self.velocity_z = autocvar_g_ctf_flag_dropped_floatinwater; } else @@ -706,13 +706,13 @@ void ctf_FlagThink() self.health -= ((self.max_flag_health / autocvar_g_ctf_flag_return_time) * FLAG_THINKRATE); ctf_CheckFlagReturn(self, RETURN_TIMEOUT); return; - } + } return; } - + case FLAG_CARRY: { - if(self.speedrunning && ctf_captimerecord && (time >= self.ctf_pickuptime + ctf_captimerecord)) + if(self.speedrunning && ctf_captimerecord && (time >= self.ctf_pickuptime + ctf_captimerecord)) { self.health = 0; ctf_CheckFlagReturn(self, RETURN_SPEEDRUN); @@ -733,13 +733,13 @@ void ctf_FlagThink() } return; } - + case FLAG_PASSING: { vector targ_origin = ((self.pass_target.absmin + self.pass_target.absmax) * 0.5); targ_origin = WarpZone_RefSys_TransformOrigin(self.pass_target, self, targ_origin); // origin of target as seen by the flag (us) WarpZone_TraceLine(self.origin, targ_origin, MOVE_NOMONSTERS, self); - + if((self.pass_target == world) || (self.pass_target.deadflag != DEAD_NO) || (vlen(self.origin - targ_origin) > autocvar_g_ctf_pass_radius) @@ -768,9 +768,9 @@ void ctf_FlagThink() void ctf_FlagTouch() { if(gameover) { return; } - + entity toucher = other; - + // automatically kill the flag and return it if it touched lava/slime/nodrop surfaces if(ITEM_TOUCH_NEEDKILL()) { @@ -778,7 +778,7 @@ void ctf_FlagTouch() ctf_CheckFlagReturn(self, RETURN_NEEDKILL); return; } - + // special touch behaviors if(toucher.vehicle_flags & VHF_ISVEHICLE) { @@ -799,8 +799,8 @@ void ctf_FlagTouch() } else if(toucher.deadflag != DEAD_NO) { return; } - switch(self.ctf_status) - { + switch(self.ctf_status) + { case FLAG_BASE: { if(SAME_TEAM(toucher, self) && (toucher.flagcarried) && DIFF_TEAM(toucher.flagcarried, self)) @@ -809,7 +809,7 @@ void ctf_FlagTouch() ctf_Handle_Pickup(self, toucher, PICKUP_BASE); // toucher just stole the enemies flag break; } - + case FLAG_DROPPED: { if(SAME_TEAM(toucher, self)) @@ -818,13 +818,13 @@ void ctf_FlagTouch() ctf_Handle_Pickup(self, toucher, PICKUP_DROPPED); // toucher just picked up a dropped enemy flag break; } - + case FLAG_CARRY: { dprint("Someone touched a flag even though it was being carried?\n"); break; } - + case FLAG_PASSING: { if((IS_PLAYER(toucher)) && (toucher.deadflag == DEAD_NO) && (toucher != self.pass_sender)) @@ -847,15 +847,15 @@ void ctf_RespawnFlag(entity flag) { backtrace("flag respawn called twice quickly! please notify Samual about this..."); } flag.last_respawn = time; - + // reset the player (if there is one) if((flag.owner) && (flag.owner.flagcarried == flag)) { if(flag.owner.wps_enemyflagcarrier) WaypointSprite_Kill(flag.owner.wps_enemyflagcarrier); - + WaypointSprite_Kill(flag.wps_flagcarrier); - + flag.owner.flagcarried = world; if(flag.speedrunning) @@ -868,7 +868,7 @@ void ctf_RespawnFlag(entity flag) // reset the flag setattachment(flag, world, ""); setorigin(flag, flag.ctf_spawnorigin); - + flag.movetype = ((flag.noalign) ? MOVETYPE_NONE : MOVETYPE_TOSS); flag.takedamage = DAMAGE_NO; flag.health = flag.max_flag_health; @@ -876,7 +876,7 @@ void ctf_RespawnFlag(entity flag) flag.velocity = '0 0 0'; flag.angles = flag.mangle; flag.flags = FL_ITEM | FL_NOTARGET; - + flag.ctf_status = FLAG_BASE; flag.owner = world; flag.pass_distance = 0; @@ -892,7 +892,7 @@ void ctf_Reset() if(self.owner) if(IS_PLAYER(self.owner)) ctf_Handle_Throw(self.owner, world, DROP_RESET); - + ctf_RespawnFlag(self); } @@ -911,12 +911,12 @@ void ctf_DelayedFlagSetup(void) // called after a flag is placed on a map by ctf ctf_CaptureShield_Spawn(self); } -void ctf_FlagSetup(float teamnumber, entity flag) // called when spawning a flag entity on the map as a spawnfunc -{ +void ctf_FlagSetup(float teamnumber, entity flag) // called when spawning a flag entity on the map as a spawnfunc +{ // declarations - teamnumber = fabs(teamnumber - bound(0, autocvar_g_ctf_reverse, 1)); // if we were originally 1, this will become 0. If we were originally 0, this will become 1. + teamnumber = fabs(teamnumber - bound(0, autocvar_g_ctf_reverse, 1)); // if we were originally 1, this will become 0. If we were originally 0, this will become 1. self = flag; // for later usage with droptofloor() - + // main setup flag.ctf_worldflagnext = ctf_worldflaglist; // link flag into ctf_worldflaglist ctf_worldflaglist = flag; @@ -931,7 +931,7 @@ void ctf_FlagSetup(float teamnumber, entity flag) // called when spawning a flag flag.flags = FL_ITEM | FL_NOTARGET; flag.solid = SOLID_TRIGGER; flag.takedamage = DAMAGE_NO; - flag.damageforcescale = autocvar_g_ctf_flag_damageforcescale; + flag.damageforcescale = autocvar_g_ctf_flag_damageforcescale; flag.max_flag_health = ((autocvar_g_ctf_flag_return_damage && autocvar_g_ctf_flag_health) ? autocvar_g_ctf_flag_health : 100); flag.health = flag.max_flag_health; flag.event_damage = ctf_FlagDamage; @@ -954,8 +954,8 @@ void ctf_FlagSetup(float teamnumber, entity flag) // called when spawning a flag if(flag.toucheffect == "") { flag.toucheffect = ((teamnumber) ? "redflag_touch" : "blueflag_touch"); } if(flag.passeffect == "") { flag.passeffect = ((teamnumber) ? "red_pass" : "blue_pass"); } if(flag.capeffect == "") { flag.capeffect = ((teamnumber) ? "red_cap" : "blue_cap"); } - - // sound + + // sound if(flag.snd_flag_taken == "") { flag.snd_flag_taken = ((teamnumber) ? "ctf/red_taken.wav" : "ctf/blue_taken.wav"); } if(flag.snd_flag_returned == "") { flag.snd_flag_returned = ((teamnumber) ? "ctf/red_returned.wav" : "ctf/blue_returned.wav"); } if(flag.snd_flag_capture == "") { flag.snd_flag_capture = ((teamnumber) ? "ctf/red_capture.wav" : "ctf/blue_capture.wav"); } // blue team scores by capturing the red flag @@ -963,7 +963,7 @@ void ctf_FlagSetup(float teamnumber, entity flag) // called when spawning a flag if(flag.snd_flag_dropped == "") { flag.snd_flag_dropped = ((teamnumber) ? "ctf/red_dropped.wav" : "ctf/blue_dropped.wav"); } if(flag.snd_flag_touch == "") { flag.snd_flag_touch = "ctf/touch.wav"; } // again has no team-based sound if(flag.snd_flag_pass == "") { flag.snd_flag_pass = "ctf/pass.wav"; } // same story here - + // precache precache_sound(flag.snd_flag_taken); precache_sound(flag.snd_flag_returned); @@ -980,33 +980,33 @@ void ctf_FlagSetup(float teamnumber, entity flag) // called when spawning a flag setmodel(flag, flag.model); // precision set below setsize(flag, FLAG_MIN, FLAG_MAX); setorigin(flag, (flag.origin + FLAG_SPAWN_OFFSET)); - + if(autocvar_g_ctf_flag_glowtrails) { flag.glow_color = ((teamnumber) ? 251 : 210); // 251: red - 210: blue flag.glow_size = 25; flag.glow_trail = 1; } - + flag.effects |= EF_LOWPRECISION; if(autocvar_g_ctf_fullbrightflags) { flag.effects |= EF_FULLBRIGHT; } if(autocvar_g_ctf_dynamiclights) { flag.effects |= ((teamnumber) ? EF_RED : EF_BLUE); } - + // flag placement if((flag.spawnflags & 1) || flag.noalign) // don't drop to floor, just stay at fixed location - { - flag.dropped_origin = flag.origin; + { + flag.dropped_origin = flag.origin; flag.noalign = TRUE; flag.movetype = MOVETYPE_NONE; } else // drop to floor, automatically find a platform and set that as spawn origin - { + { flag.noalign = FALSE; self = flag; droptofloor(); - flag.movetype = MOVETYPE_TOSS; - } - + flag.movetype = MOVETYPE_TOSS; + } + InitializeEntity(flag, ctf_DelayedFlagSetup, INITPRIO_SETLOCATION); } @@ -1675,12 +1675,12 @@ void havocbot_role_ctf_setrole(entity bot, float role) MUTATOR_HOOKFUNCTION(ctf_PlayerPreThink) { entity flag; - + // initially clear items so they can be set as necessary later. self.items &= ~(IT_RED_FLAG_CARRYING | IT_RED_FLAG_TAKEN | IT_RED_FLAG_LOST | IT_BLUE_FLAG_CARRYING | IT_BLUE_FLAG_TAKEN | IT_BLUE_FLAG_LOST | IT_CTF_SHIELDED); - // scan through all the flags and notify the client about them + // scan through all the flags and notify the client about them for(flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext) { switch(flag.ctf_status) @@ -1690,7 +1690,7 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerPreThink) { if((flag.owner == self) || (flag.pass_sender == self)) self.items |= ((flag.items & IT_KEY2) ? IT_RED_FLAG_CARRYING : IT_BLUE_FLAG_CARRYING); // carrying: self is currently carrying the flag - else + else self.items |= ((flag.items & IT_KEY2) ? IT_RED_FLAG_TAKEN : IT_BLUE_FLAG_TAKEN); // taken: someone on self's team is carrying the flag break; } @@ -1701,15 +1701,15 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerPreThink) } } } - + // item for stopping players from capturing the flag too often if(self.ctf_captureshielded) self.items |= IT_CTF_SHIELDED; - + // update the health of the flag carrier waypointsprite - if(self.wps_flagcarrier) + if(self.wps_flagcarrier) WaypointSprite_UpdateHealth(self.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON)); - + return FALSE; } @@ -1748,10 +1748,10 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerDies) PlayerTeamScore_AddScore(frag_attacker, autocvar_g_ctf_score_kill); PlayerScore_Add(frag_attacker, SP_CTF_FCKILLS, 1); } - + if(frag_target.flagcarried) { ctf_Handle_Throw(frag_target, world, DROP_NORMAL); } - + return FALSE; } @@ -1764,23 +1764,23 @@ MUTATOR_HOOKFUNCTION(ctf_GiveFragsForKill) MUTATOR_HOOKFUNCTION(ctf_RemovePlayer) { entity flag; // temporary entity for the search method - + if(self.flagcarried) { ctf_Handle_Throw(self, world, DROP_NORMAL); } - + for(flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext) { if(flag.pass_sender == self) { flag.pass_sender = world; } if(flag.pass_target == self) { flag.pass_target = world; } if(flag.ctf_dropper == self) { flag.ctf_dropper = world; } } - + return FALSE; } MUTATOR_HOOKFUNCTION(ctf_PortalTeleport) { - if(self.flagcarried) + if(self.flagcarried) if(!autocvar_g_ctf_portalteleport) { ctf_Handle_Throw(self, world, DROP_NORMAL); } @@ -1790,7 +1790,7 @@ MUTATOR_HOOKFUNCTION(ctf_PortalTeleport) MUTATOR_HOOKFUNCTION(ctf_PlayerUseKey) { if(MUTATOR_RETURNVALUE || gameover) { return FALSE; } - + entity player = self; if((time > player.throw_antispam) && (player.deadflag == DEAD_NO) && !player.speedrunning && (!player.vehicle || autocvar_g_ctf_allow_vehicle_touch)) @@ -1800,21 +1800,21 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerUseKey) { entity head, closest_target = world; head = WarpZone_FindRadius(player.origin, autocvar_g_ctf_pass_radius, TRUE); - + while(head) // find the closest acceptable target to pass to { if(IS_PLAYER(head) && head.deadflag == DEAD_NO) if(head != player && SAME_TEAM(head, player)) if(!head.speedrunning && !head.vehicle) { - // if it's a player, use the view origin as reference (stolen from RadiusDamage functions in g_damage.qc) + // if it's a player, use the view origin as reference (stolen from RadiusDamage functions in g_damage.qc) vector head_center = WarpZone_UnTransformOrigin(head, CENTER_OR_VIEWOFS(head)); vector passer_center = CENTER_OR_VIEWOFS(player); - + if(ctf_CheckPassDirection(head_center, passer_center, player.v_angle, head.WarpZone_findradius_nearest)) { - if(autocvar_g_ctf_pass_request && !player.flagcarried && head.flagcarried) - { + if(autocvar_g_ctf_pass_request && !player.flagcarried && head.flagcarried) + { if(IS_BOT_CLIENT(head)) { Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_PASS_REQUESTING, head.netname); @@ -1825,8 +1825,8 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerUseKey) Send_Notification(NOTIF_ONE, head, MSG_CENTER, CENTER_CTF_PASS_REQUESTED, player.netname); Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_PASS_REQUESTING, head.netname); } - player.throw_antispam = time + autocvar_g_ctf_pass_wait; - return TRUE; + player.throw_antispam = time + autocvar_g_ctf_pass_wait; + return TRUE; } else if(player.flagcarried) { @@ -1842,10 +1842,10 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerUseKey) } head = head.chain; } - + if(closest_target) { ctf_Handle_Throw(player, closest_target, DROP_PASS); return TRUE; } } - + // throw the flag in front of you if(autocvar_g_ctf_throw && player.flagcarried) { @@ -1869,14 +1869,14 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerUseKey) if(time > player.throw_prevtime + autocvar_g_ctf_throw_punish_time) { player.throw_count = 1; } else { player.throw_count += 1; } if(player.throw_count >= autocvar_g_ctf_throw_punish_count) { player.throw_count = -1; } - + player.throw_prevtime = time; ctf_Handle_Throw(player, world, DROP_THROW); return TRUE; } } } - + return FALSE; } @@ -1886,7 +1886,7 @@ MUTATOR_HOOKFUNCTION(ctf_HelpMePing) { self.wps_helpme_time = time; WaypointSprite_HelpMePing(self.wps_flagcarrier); - } + } else // create a normal help me waypointsprite { WaypointSprite_Spawn("helpme", waypointsprite_deployed_lifetime, waypointsprite_limitedrange, self, FLAG_WAYPOINT_OFFSET, world, self.team, self, wps_helpme, FALSE, RADARICON_HELPME, '1 0.5 0'); @@ -1905,15 +1905,15 @@ MUTATOR_HOOKFUNCTION(ctf_VehicleEnter) ctf_Handle_Throw(vh_player, world, DROP_NORMAL); } else - { - setattachment(vh_player.flagcarried, vh_vehicle, ""); + { + setattachment(vh_player.flagcarried, vh_vehicle, ""); setorigin(vh_player.flagcarried, VEHICLE_FLAG_OFFSET); vh_player.flagcarried.scale = VEHICLE_FLAG_SCALE; - //vh_player.flagcarried.angles = '0 0 0'; + //vh_player.flagcarried.angles = '0 0 0'; } return TRUE; } - + return FALSE; } @@ -1921,7 +1921,7 @@ MUTATOR_HOOKFUNCTION(ctf_VehicleExit) { if(vh_player.flagcarried) { - setattachment(vh_player.flagcarried, vh_player, ""); + setattachment(vh_player.flagcarried, vh_player, ""); setorigin(vh_player.flagcarried, FLAG_CARRY_OFFSET); vh_player.flagcarried.scale = FLAG_SCALE; vh_player.flagcarried.angles = '0 0 0'; @@ -1939,14 +1939,14 @@ MUTATOR_HOOKFUNCTION(ctf_AbortSpeedrun) ctf_RespawnFlag(self.flagcarried); return TRUE; } - + return FALSE; } MUTATOR_HOOKFUNCTION(ctf_MatchEnd) { entity flag; // temporary entity for the search method - + for(flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext) { switch(flag.ctf_status) @@ -1959,11 +1959,11 @@ MUTATOR_HOOKFUNCTION(ctf_MatchEnd) flag.takedamage = DAMAGE_NO; flag.solid = SOLID_NOT; flag.nextthink = FALSE; // stop thinking - + //dprint("stopping the ", flag.netname, " from moving.\n"); break; } - + default: case FLAG_BASE: case FLAG_CARRY: @@ -1973,7 +1973,7 @@ MUTATOR_HOOKFUNCTION(ctf_MatchEnd) } } } - + return FALSE; } @@ -1994,7 +1994,7 @@ Keys: "angle" viewing angle when spawning. */ void spawnfunc_info_player_team1() { if(g_assault) { remove(self); return; } - + self.team = NUM_TEAM_1; // red spawnfunc_info_player_deathmatch(); } @@ -2006,7 +2006,7 @@ Keys: "angle" viewing angle when spawning. */ void spawnfunc_info_player_team2() { if(g_assault) { remove(self); return; } - + self.team = NUM_TEAM_2; // blue spawnfunc_info_player_deathmatch(); } @@ -2017,7 +2017,7 @@ Keys: "angle" viewing angle when spawning. */ void spawnfunc_info_player_team3() { if(g_assault) { remove(self); return; } - + self.team = NUM_TEAM_3; // yellow spawnfunc_info_player_deathmatch(); } @@ -2029,20 +2029,20 @@ Keys: "angle" viewing angle when spawning. */ void spawnfunc_info_player_team4() { if(g_assault) { remove(self); return; } - + self.team = NUM_TEAM_4; // purple spawnfunc_info_player_deathmatch(); } /*QUAKED spawnfunc_item_flag_team1 (0 0.5 0.8) (-48 -48 -37) (48 48 37) CTF flag for team one (Red). -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 and blue as skins 0 and 1... "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_team1() @@ -2054,13 +2054,13 @@ void spawnfunc_item_flag_team1() /*QUAKED spawnfunc_item_flag_team2 (0 0.5 0.8) (-48 -48 -37) (48 48 37) CTF flag for team two (Blue). -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 and blue as skins 0 and 1... "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_team2() @@ -2079,7 +2079,7 @@ Keys: void spawnfunc_ctf_team() { if(!g_ctf) { remove(self); return; } - + self.classname = "ctf_team"; self.team = self.cnt + 1; } @@ -2135,7 +2135,7 @@ void ctf_DelayedInit() // Do this check with a delay so we can wait for teams to ctf_SpawnTeam("Red", NUM_TEAM_1 - 1); ctf_SpawnTeam("Blue", NUM_TEAM_2 - 1); } - + ctf_ScoreRules(); } @@ -2146,7 +2146,7 @@ void ctf_Initialize() ctf_captureshield_min_negscore = autocvar_g_ctf_shield_min_negscore; ctf_captureshield_max_ratio = autocvar_g_ctf_shield_max_ratio; ctf_captureshield_force = autocvar_g_ctf_shield_force; - + InitializeEntity(world, ctf_DelayedInit, INITPRIO_GAMETYPE); } @@ -2167,7 +2167,7 @@ MUTATOR_DEFINITION(gamemode_ctf) MUTATOR_HOOK(VehicleExit, ctf_VehicleExit, CBC_ORDER_ANY); MUTATOR_HOOK(AbortSpeedrun, ctf_AbortSpeedrun, CBC_ORDER_ANY); MUTATOR_HOOK(HavocBot_ChooseRule, ctf_BotRoles, CBC_ORDER_ANY); - + MUTATOR_ONADD { if(time > 1) // game loads at time 1 diff --git a/qcsrc/server/mutators/gamemode_ctf.qh b/qcsrc/server/mutators/gamemode_ctf.qh index 58699208e..ca4961edd 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qh +++ b/qcsrc/server/mutators/gamemode_ctf.qh @@ -38,7 +38,7 @@ void ctf_RespawnFlag(entity flag); #define WPCOLOR_FLAGCARRIER(t) ('0.8 0.8 0') #define WPCOLOR_DROPPEDFLAG(t) (('0.25 0.25 0.25' + colormapPaletteColor(t - 1, FALSE)) * 0.5) -// sounds +// sounds #define snd_flag_taken noise #define snd_flag_returned noise1 #define snd_flag_capture noise2 @@ -60,7 +60,7 @@ entity ctf_worldflaglist; // waypoint sprites .entity bot_basewaypoint; // flag waypointsprite .entity wps_helpme; -.entity wps_flagbase; +.entity wps_flagbase; .entity wps_flagcarrier; .entity wps_flagdropped; .entity wps_enemyflagcarrier; diff --git a/qcsrc/server/mutators/gamemode_domination.qc b/qcsrc/server/mutators/gamemode_domination.qc index f0e4955b2..89e6fe485 100644 --- a/qcsrc/server/mutators/gamemode_domination.qc +++ b/qcsrc/server/mutators/gamemode_domination.qc @@ -34,7 +34,7 @@ void dompoint_captured () self.model = head.mdl; self.modelindex = head.dmg; self.skin = head.skin; - + float points, wait_time; if (autocvar_g_domination_point_amt) points = autocvar_g_domination_point_amt; @@ -75,7 +75,7 @@ void dompoint_captured () SUB_UseTargets (); self.delay = old_delay; self.team = old_team; - + switch(self.team) { case NUM_TEAM_1: msg = "dom-red"; break; @@ -85,7 +85,7 @@ void dompoint_captured () } WaypointSprite_UpdateSprites(self.sprite, msg, "", ""); - + total_pps = 0, pps_red = 0, pps_blue = 0, pps_yellow = 0, pps_pink = 0; for(head = world; (head = find(head, classname, "dom_controlpoint")) != world; ) { @@ -467,7 +467,7 @@ void dom_DelayedInit() // Do this check with a delay so we can wait for teams to print("No ""dom_team"" entities found on this map, creating them anyway.\n"); dom_spawnteams(); } - + ScoreRules_dom(); } @@ -479,13 +479,13 @@ void dom_Initialize() precache_model("models/domination/dom_pink.md3"); precache_model("models/domination/dom_unclaimed.md3"); precache_sound("domination/claim.wav"); - + addstat(STAT_DOM_TOTAL_PPS, AS_FLOAT, dom_total_pps); addstat(STAT_DOM_PPS_RED, AS_FLOAT, dom_pps_red); addstat(STAT_DOM_PPS_BLUE, AS_FLOAT, dom_pps_blue); if(c3 >= 0) addstat(STAT_DOM_PPS_YELLOW, AS_FLOAT, dom_pps_yellow); if(c4 >= 0) addstat(STAT_DOM_PPS_PINK, AS_FLOAT, dom_pps_pink); - + InitializeEntity(world, dom_DelayedInit, INITPRIO_GAMETYPE); } @@ -494,7 +494,7 @@ MUTATOR_DEFINITION(gamemode_domination) { MUTATOR_HOOK(ClientConnect, dom_ClientConnect, CBC_ORDER_ANY); MUTATOR_HOOK(HavocBot_ChooseRule, dom_BotRoles, CBC_ORDER_ANY); - + MUTATOR_ONADD { if(time > 1) // game loads at time 1 diff --git a/qcsrc/server/mutators/gamemode_freezetag.qc b/qcsrc/server/mutators/gamemode_freezetag.qc index 38465aca7..9bc065223 100644 --- a/qcsrc/server/mutators/gamemode_freezetag.qc +++ b/qcsrc/server/mutators/gamemode_freezetag.qc @@ -531,7 +531,7 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerPhysics) } else self.movement = '0 0 0'; - + self.disableclientprediction = 1; } return 1; @@ -551,7 +551,7 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerDamage_Calculate) Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED_FALL, frag_target.netname); Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_FREEZETAG_REVIVE_FALL); } - + frag_damage = 0; frag_force = frag_force * autocvar_g_freezetag_frozen_force; } @@ -562,7 +562,7 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerJump) { if(self.freezetag_frozen) return TRUE; // no jumping in freezetag when frozen - + return FALSE; } @@ -614,7 +614,7 @@ MUTATOR_HOOKFUNCTION(freezetag_VehicleTouch) { if(other.freezetag_frozen) return TRUE; - + return FALSE; } diff --git a/qcsrc/server/mutators/gamemode_keepaway.qc b/qcsrc/server/mutators/gamemode_keepaway.qc index 98695f693..ec6ee8cd4 100644 --- a/qcsrc/server/mutators/gamemode_keepaway.qc +++ b/qcsrc/server/mutators/gamemode_keepaway.qc @@ -3,12 +3,12 @@ // Last updated: September, 2012 // =========================================================== -float ka_ballcarrier_waypointsprite_visible_for_player(entity e) // runs on waypoints which are attached to ballcarriers, updates once per frame +float ka_ballcarrier_waypointsprite_visible_for_player(entity e) // runs on waypoints which are attached to ballcarriers, updates once per frame { if(e.ballcarried) - if(IS_SPEC(other)) + if(IS_SPEC(other)) return FALSE; // we don't want spectators of the ballcarrier to see the attached waypoint on the top of their screen - + // TODO: Make the ballcarrier lack a waypointsprite whenever they have the invisibility powerup return TRUE; @@ -24,7 +24,7 @@ void ka_RespawnBall() // runs whenever the ball needs to be relocated { if(gameover) { return; } vector oldballorigin = self.origin; - + if(MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 10, 1024, 256)) { makevectors(self.angles); @@ -34,18 +34,18 @@ void ka_RespawnBall() // runs whenever the ball needs to be relocated self.effects = autocvar_g_keepawayball_effects; self.think = ka_RespawnBall; self.nextthink = time + autocvar_g_keepawayball_respawntime; - + pointparticles(particleeffectnum("electro_combo"), oldballorigin, '0 0 0', 1); pointparticles(particleeffectnum("electro_combo"), self.origin, '0 0 0', 1); WaypointSprite_Spawn("ka-ball", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, '0 1 1'); - WaypointSprite_Ping(self.waypointsprite_attachedforcarrier); + WaypointSprite_Ping(self.waypointsprite_attachedforcarrier); - sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) + sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) } else { - ka_RespawnBall(); // finding a location failed, retry + ka_RespawnBall(); // finding a location failed, retry } } @@ -55,7 +55,7 @@ void ka_TimeScoring() { // add points for holding the ball after a certain amount of time if(autocvar_g_keepaway_score_timepoints) PlayerScore_Add(self.owner, SP_SCORE, autocvar_g_keepaway_score_timepoints); - + PlayerScore_Add(self.owner, SP_KEEPAWAY_BCTIME, (autocvar_g_keepaway_score_timeinterval / 1)); // interval is divided by 1 so that time always shows "seconds" self.nextthink = time + autocvar_g_keepaway_score_timeinterval; } @@ -71,11 +71,11 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth return; } if(other.deadflag != DEAD_NO) { return; } - if (!IS_PLAYER(other)) + if (!IS_PLAYER(other)) { // The ball just touched an object, most likely the world pointparticles(particleeffectnum("kaball_sparks"), self.origin, '0 0 0', 1); sound(self, CH_TRIGGER, "keepaway/touch.wav", VOL_BASE, ATTEN_NORM); - return; + return; } else if(self.wait > time) { return; } @@ -84,7 +84,7 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth other.ballcarried = self; setattachment(self, other, ""); setorigin(self, '0 0 0'); - + // make the ball invisible/unable to do anything/set up time scoring self.velocity = '0 0 0'; self.movetype = MOVETYPE_NONE; @@ -98,13 +98,13 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth other.glow_color = autocvar_g_keepawayball_trail_color; other.glow_trail = TRUE; other.effects |= autocvar_g_keepaway_ballcarrier_effects; - + // messages and sounds ka_EventLog("pickup", other); Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_KEEPAWAY_PICKUP, other.netname); Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEEPAWAY_PICKUP, other.netname); - sound(self.owner, CH_TRIGGER, "keepaway/pickedup.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) - + sound(self.owner, CH_TRIGGER, "keepaway/pickedup.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) + // scoring PlayerScore_Add(other, SP_KEEPAWAY_PICKUPS, 1); @@ -112,7 +112,7 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth WaypointSprite_AttachCarrier("ka-ballcarrier", other, RADARICON_FLAGCARRIER, '1 0 0'); other.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = ka_ballcarrier_waypointsprite_visible_for_player; WaypointSprite_UpdateRule(other.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT); - WaypointSprite_Ping(other.waypointsprite_attachedforcarrier); + WaypointSprite_Ping(other.waypointsprite_attachedforcarrier); WaypointSprite_Kill(self.waypointsprite_attachedforcarrier); } @@ -122,21 +122,21 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los ball = plyr.ballcarried; if(!ball) { return; } - + // reset the ball setattachment(ball, world, ""); ball.movetype = MOVETYPE_BOUNCE; - ball.wait = time + 1; + ball.wait = time + 1; ball.touch = ka_TouchEvent; ball.think = ka_RespawnBall; ball.nextthink = time + autocvar_g_keepawayball_respawntime; ball.takedamage = DAMAGE_YES; - ball.effects &= ~EF_NODRAW; + ball.effects &= ~EF_NODRAW; setorigin(ball, plyr.origin + '0 0 10'); ball.velocity = '0 0 200' + '0 100 0'*crandom() + '100 0 0'*crandom(); - ball.owner.ballcarried = world; // I hope nothing checks to see if the world has the ball in the rest of my code :P + ball.owner.ballcarried = world; // I hope nothing checks to see if the world has the ball in the rest of my code :P ball.owner = world; - + // reset the player effects plyr.glow_trail = FALSE; plyr.effects &= ~autocvar_g_keepaway_ballcarrier_effects; @@ -145,15 +145,15 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los ka_EventLog("dropped", plyr); Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_KEEPAWAY_DROPPED, plyr.netname); Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEEPAWAY_DROPPED, plyr.netname); - sound(other, CH_TRIGGER, "keepaway/dropped.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) - + sound(other, CH_TRIGGER, "keepaway/dropped.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) + // scoring // PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless. - + // waypoints WaypointSprite_Spawn("ka-ball", 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, '0 1 1'); WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT); - WaypointSprite_Ping(ball.waypointsprite_attachedforcarrier); + WaypointSprite_Ping(ball.waypointsprite_attachedforcarrier); WaypointSprite_Kill(plyr.waypointsprite_attachedforcarrier); } @@ -265,14 +265,14 @@ MUTATOR_HOOKFUNCTION(ka_Scoring) MUTATOR_HOOKFUNCTION(ka_GiveFragsForKill) { frag_score = 0; // no frags counted in keepaway - return 1; // you deceptive little bugger ;3 This needs to be true in order for this function to even count. + return 1; // you deceptive little bugger ;3 This needs to be true in order for this function to even count. } MUTATOR_HOOKFUNCTION(ka_PlayerPreThink) { // clear the item used for the ball in keepaway self.items &= ~IT_KEY1; - + // if the player has the ball, make sure they have the item for it (Used for HUD primarily) if(self.ballcarried) self.items |= IT_KEY1; @@ -331,13 +331,13 @@ MUTATOR_HOOKFUNCTION(ka_RemovePlayer) MUTATOR_HOOKFUNCTION(ka_PlayerPowerups) { // In the future this hook is supposed to allow me to do some extra stuff with waypointsprites and invisibility powerup - // So bare with me until I can fix a certain bug with ka_ballcarrier_waypointsprite_visible_for_player() - + // So bare with me until I can fix a certain bug with ka_ballcarrier_waypointsprite_visible_for_player() + self.effects &= ~autocvar_g_keepaway_ballcarrier_effects; if(self.ballcarried) self.effects |= autocvar_g_keepaway_ballcarrier_effects; - + return 0; } @@ -358,10 +358,10 @@ MUTATOR_HOOKFUNCTION(ka_BotRoles) void ka_SpawnBall() // loads various values for the ball, runs only once at start of match { if(!g_keepaway) { return; } - + entity e; e = spawn(); - e.model = "models/orbs/orbblue.md3"; + e.model = "models/orbs/orbblue.md3"; precache_model(e.model); setmodel(e, e.model); setsize(e, '-16 -16 -20', '16 16 20'); // 20 20 20 was too big, player is only 16 16 24... gotta cheat with the Z (20) axis so that the particle isn't cut off @@ -378,7 +378,7 @@ void ka_SpawnBall() // loads various values for the ball, runs only once at star e.owner = world; ka_ball = e; - InitializeEntity(e, ka_RespawnBall, INITPRIO_SETLOCATION); // is this the right priority? Neh, I have no idea.. Well-- it works! So. + InitializeEntity(e, ka_RespawnBall, INITPRIO_SETLOCATION); // is this the right priority? Neh, I have no idea.. Well-- it works! So. } void ka_ScoreRules() @@ -394,7 +394,7 @@ void ka_Initialize() // run at the start of a match, initiates game mode { if(!g_keepaway) return; - + precache_sound("keepaway/pickedup.wav"); precache_sound("keepaway/dropped.wav"); precache_sound("keepaway/respawn.wav"); diff --git a/qcsrc/server/mutators/gamemode_keyhunt.qc b/qcsrc/server/mutators/gamemode_keyhunt.qc index 138f16144..34d87f97b 100644 --- a/qcsrc/server/mutators/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/gamemode_keyhunt.qc @@ -627,9 +627,9 @@ void kh_LoserTeam(float teem, entity lostkey) // runs when a player pushes a fl --j; } } - + Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_4(lostkey, INFO_KEYHUNT_LOST_), lostkey.kh_previous_owner.netname); - + play2all(kh_sound_destroy); te_tarexplosion(lostkey.origin); @@ -790,7 +790,7 @@ void kh_Key_DropOne(entity key) kh_Scores_Event(player, key, "dropkey", 0, 0); PlayerScore_Add(player, SP_KH_LOSSES, 1); Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_4(key, INFO_KEYHUNT_DROP_), player.netname); - + kh_Key_AssignTo(key, world); makevectors(player.v_angle); key.velocity = W_CalculateProjectileVelocity(player.velocity, autocvar_g_balance_keyhunt_throwvelocity * v_forward, FALSE); @@ -840,7 +840,7 @@ float kh_CheckPlayers(float num) if(!tmp_player.BUTTON_CHAT) if(tmp_player.team == t_team) ++players; - + if (!players) { return t_team; } } return 0; @@ -893,7 +893,7 @@ void kh_StartRound() // runs at the start of each round Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEYHUNT_WAIT, p1, p2, p3, p4); return; } - + Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_KEYHUNT); Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_KEYHUNT_OTHER); diff --git a/qcsrc/server/mutators/gamemode_lms.qc b/qcsrc/server/mutators/gamemode_lms.qc index f980607a7..928c78b34 100644 --- a/qcsrc/server/mutators/gamemode_lms.qc +++ b/qcsrc/server/mutators/gamemode_lms.qc @@ -22,7 +22,7 @@ MUTATOR_HOOKFUNCTION(lms_ResetMap) { lms_lowest_lives = 999; lms_next_place = player_count; - + return FALSE; } @@ -32,7 +32,7 @@ MUTATOR_HOOKFUNCTION(lms_ResetPlayers) FOR_EACH_CLIENT(self) if(IS_PLAYER(self)) PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives()); - + return FALSE; } @@ -49,7 +49,7 @@ MUTATOR_HOOKFUNCTION(lms_PlayerPreSpawn) MUTATOR_HOOKFUNCTION(lms_PlayerDies) { self.respawn_flags |= RESPAWN_FORCE; - + return FALSE; } @@ -60,13 +60,13 @@ MUTATOR_HOOKFUNCTION(lms_RemovePlayer) self.frags = FRAGS_SPECTATOR; else self.frags = FRAGS_LMS_LOSER; - + if(self.killcount != -666) if(PlayerScore_Add(self, SP_LMS_RANK, 0) > 0 && self.lms_spectate_warning != 2) Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_LMS_NOLIVES, self.netname); else Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_LMS_FORFEIT, self.netname); - + return FALSE; } @@ -74,13 +74,13 @@ MUTATOR_HOOKFUNCTION(lms_ClientConnect) { self.classname = "player"; campaign_bots_may_start = 1; - + if(PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives()) <= 0) { PlayerScore_Add(self, SP_LMS_RANK, 666); self.frags = FRAGS_SPECTATOR; } - + return FALSE; } @@ -88,7 +88,7 @@ MUTATOR_HOOKFUNCTION(lms_PlayerThink) { if(self.deadflag == DEAD_DYING) self.deadflag = DEAD_RESPAWNING; - + return FALSE; } @@ -115,7 +115,7 @@ MUTATOR_HOOKFUNCTION(lms_GiveFragsForKill) --lms_next_place; } frag_score = 0; - + return TRUE; } @@ -147,7 +147,7 @@ MUTATOR_HOOKFUNCTION(lms_FilterItem) self.max_health = 1; return FALSE; } - + return TRUE; } @@ -159,7 +159,7 @@ MUTATOR_HOOKFUNCTION(lms_ItemTouch) Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_EXTRALIVES); PlayerScore_Add(other, SP_LMS_LIVES, autocvar_g_lms_extra_lives); } - + return MUT_ITEMTOUCH_CONTINUE; } @@ -176,7 +176,7 @@ void lms_Initialize() { lms_lowest_lives = 9999; lms_next_place = 0; - + lms_ScoreRules(); } diff --git a/qcsrc/server/mutators/gamemode_nexball.qc b/qcsrc/server/mutators/gamemode_nexball.qc index 75dc8fda5..2d2c857e9 100644 --- a/qcsrc/server/mutators/gamemode_nexball.qc +++ b/qcsrc/server/mutators/gamemode_nexball.qc @@ -107,7 +107,7 @@ void GiveBall(entity plyr, entity ball) { WaypointSprite_Kill(ball.waypointsprite_attachedforcarrier); } - + //setattachment(ball, plyr, ""); setorigin(ball, plyr.origin + plyr.view_ofs); @@ -136,9 +136,9 @@ void GiveBall(entity plyr, entity ball) ball.think = DropOwner; ball.nextthink = time + autocvar_g_nexball_basketball_delay_hold; } - + ownr = self; - self = plyr; + self = plyr; self.weaponentity.weapons = self.weapons; self.weaponentity.switchweapon = self.weapon; self.weapons = WEPSET_PORTO; @@ -655,13 +655,13 @@ void W_Nexball_Think() //dprint("W_Nexball_Think\n"); //vector new_dir = steerlib_arrive(self.enemy.origin, 2500); vector new_dir = normalize(self.enemy.origin + '0 0 50' - self.origin); - vector old_dir = normalize(self.velocity); - float _speed = vlen(self.velocity); + vector old_dir = normalize(self.velocity); + float _speed = vlen(self.velocity); vector new_vel = normalize(old_dir + (new_dir * autocvar_g_nexball_safepass_turnrate)) * _speed; //vector new_vel = (new_dir * autocvar_g_nexball_safepass_turnrate - + self.velocity = new_vel; - + self.nextthink = time; } @@ -671,7 +671,7 @@ void W_Nexball_Touch(void) attacker = self.owner; //self.think = func_null; //self.enemy = world; - + PROJECTILE_TOUCH; if(attacker.team != other.team || autocvar_g_nexball_basketball_teamsteal) if((ball = other.ballcarried) && (IS_PLAYER(attacker))) @@ -725,9 +725,9 @@ void W_Nexball_Attack(float t) mul = 2 - mul; mul = mi + (ma - mi) * mul; // range from the minimal power to the maximal power } - + DropBall(ball, w_shotorg, W_CalculateProjectileVelocity(self.velocity, w_shotdir * autocvar_g_balance_nexball_primary_speed * mul, FALSE)); - + //TODO: use the speed_up cvar too ?? } @@ -743,10 +743,10 @@ void W_Nexball_Attack2(void) _ball.nextthink = time; return; } - + if(!autocvar_g_nexball_tackling) return; - + entity missile; if(!(balls & BALL_BASKET)) return; @@ -782,8 +782,8 @@ float ball_customize() self.scale = 1; self.customizeentityforclient = func_null; return TRUE; - } - + } + if(other == self.owner) { self.scale = autocvar_g_nexball_viewmodel_scale; @@ -791,13 +791,13 @@ float ball_customize() self.effects |= EF_FLAME; else self.effects &= ~EF_FLAME; - } + } else { self.effects &= ~EF_FLAME; self.scale = 1; } - + return TRUE; } @@ -875,18 +875,18 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerPreThink) { makevectors(self.v_angle); if(nexball_mode & NBM_BASKETBALL) - { + { if(self.ballcarried) { // 'view ball' - self.ballcarried.velocity = self.velocity; + self.ballcarried.velocity = self.velocity; self.ballcarried.customizeentityforclient = ball_customize; - - setorigin(self.ballcarried, self.origin + self.view_ofs + - v_forward * autocvar_g_nexball_viewmodel_offset_x + - v_right * autocvar_g_nexball_viewmodel_offset_y + - v_up * autocvar_g_nexball_viewmodel_offset_z); - + + setorigin(self.ballcarried, self.origin + self.view_ofs + + v_forward * autocvar_g_nexball_viewmodel_offset_x + + v_right * autocvar_g_nexball_viewmodel_offset_y + + v_up * autocvar_g_nexball_viewmodel_offset_z); + // 'safe passing' if(autocvar_g_nexball_safepass_maxdist) { @@ -895,50 +895,50 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerPreThink) //centerprint(self, sprintf("Lost lock on %s", self.ballcarried.enemy.netname)); self.ballcarried.enemy = world; } - - + + //tracebox(self.origin + self.view_ofs, '-2 -2 -2', '2 2 2', self.origin + self.view_ofs + v_forward * autocvar_g_nexball_safepass_maxdist); crosshair_trace(self); - if( trace_ent && + if( trace_ent && IS_CLIENT(trace_ent) && trace_ent.deadflag == DEAD_NO && trace_ent.team == self.team && vlen(trace_ent.origin - self.origin) <= autocvar_g_nexball_safepass_maxdist ) { - + //if(self.ballcarried.enemy != trace_ent) // centerprint(self, sprintf("Locked to %s", trace_ent.netname)); self.ballcarried.enemy = trace_ent; self.ballcarried.wait = time + autocvar_g_nexball_safepass_holdtime; - - + + } } } else - { + { if(self.weaponentity.weapons) { self.weapons = self.weaponentity.weapons; weapon_action(WEP_PORTO, WR_RESETPLAYER); self.switchweapon = self.weaponentity.switchweapon; W_SwitchWeapon(self.switchweapon); - + self.weaponentity.weapons = '0 0 0'; } } - + } - + nexball_setstatus(); - + return FALSE; } MUTATOR_HOOKFUNCTION(nexball_PlayerSpawn) -{ +{ self.weaponentity.weapons = '0 0 0'; - + if(nexball_mode & NBM_BASKETBALL) self.weapons |= WEPSET_PORTO; else @@ -950,7 +950,7 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerSpawn) MUTATOR_HOOKFUNCTION(nexball_SetStartItems) { start_items |= IT_UNLIMITED_SUPERWEAPONS; // FIXME BAD BAD BAD BAD HACK, NEXBALL SHOULDN'T ABUSE PORTO'S WEAPON SLOT - + return FALSE; } diff --git a/qcsrc/server/mutators/gamemode_onslaught.qc b/qcsrc/server/mutators/gamemode_onslaught.qc index a419d7b1f..fa82cabb2 100644 --- a/qcsrc/server/mutators/gamemode_onslaught.qc +++ b/qcsrc/server/mutators/gamemode_onslaught.qc @@ -407,12 +407,12 @@ void onslaught_generator_think() d = d + 1; e = e.chain; } - + if(autocvar_g_campaign && autocvar__campaign_testrun) d = d * self.max_health; else d = d * self.max_health / max(30, 60 * autocvar_timelimit_suddendeath); - + Damage(self, self, self, d, DEATH_HURTTRIGGER, self.origin, '0 0 0'); } else if (overtime_msg_time) @@ -910,13 +910,13 @@ void spawnfunc_onslaught_generator() precache_sound("onslaught/electricity_explode.wav"); if (!self.team) objerror("team must be set"); - + if(self.team == NUM_TEAM_1) ons_red_generator = self; if(self.team == NUM_TEAM_2) ons_blue_generator = self; - + self.team_saved = self.team; self.colormap = 1024 + (self.team - 1) * 17; self.solid = SOLID_BBOX; @@ -956,7 +956,7 @@ void spawnfunc_onslaught_generator() waypoint_spawnforitem(self); onslaught_updatelinks(); - + self.reset = onslaught_generator_reset; } @@ -1084,7 +1084,7 @@ void onslaught_controlpoint_icon_think() float _friendly_count = 0; float _dist; entity _player; - + FOR_EACH_PLAYER(_player) { if(!_player.deadflag) @@ -1226,7 +1226,7 @@ void onslaught_controlpoint_icon_buildthink() a = onslaught_controlpoint_can_be_linked(self.owner, self.owner.team); if(!a) return; - + self.health = self.health + self.count; if (self.health >= self.max_health) @@ -1524,24 +1524,24 @@ MUTATOR_HOOKFUNCTION(ons_BuildMutatorsPrettyString) MUTATOR_HOOKFUNCTION(ons_Spawn_Score) { - + /* float _neer_home = (random() > 0.5 ? TRUE : FALSE); - + RandomSelection_Init(); - + if(self.team == NUM_TEAM_1) RandomSelection_Add(ons_red_generator, 0, string_null, 1, 1); - + if(self.team == NUM_TEAM_2) RandomSelection_Add(ons_blue_generator, 0, string_null, 1, 1); - + entity _cp = findchain(classname, "onslaught_controlpoint"): while _cp; { - if(_cp.team == self.team) + if(_cp.team == self.team) RandomSelection_Add(_cp, 0, string_null, 1, 1); - + _cp = _cp.chain; } @@ -1552,9 +1552,9 @@ MUTATOR_HOOKFUNCTION(ons_Spawn_Score) } else if(self.team == spawn_spot.team) spawn_score_x += SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM; // prefer same team, if we can't find a spawn near teammate - + */ - + return 0; } @@ -1562,55 +1562,55 @@ MUTATOR_HOOKFUNCTION(ons_PlayerSpawn) { if(!autocvar_g_onslaught_spawn_at_controlpoints) return 0; - + if(random() < 0.5) // 50/50 chane to use default spawnsystem. return 0; - + float _close_to_home = ((random() > 0.5) ? TRUE : FALSE); entity _best = world, _trg_gen = world; float _score, _best_score = MAX_SHOT_DISTANCE; - + RandomSelection_Init(); - + if(self.team == NUM_TEAM_1) { if(!_close_to_home) _trg_gen = ons_blue_generator; - else - _trg_gen = ons_red_generator; + else + _trg_gen = ons_red_generator; } - + if(self.team == NUM_TEAM_2) { if(_close_to_home) _trg_gen = ons_blue_generator; - else - _trg_gen = ons_red_generator; + else + _trg_gen = ons_red_generator; } - + entity _cp = findchain(classname, "onslaught_controlpoint"); while(_cp) { - if(_cp.team == self.team) - { + if(_cp.team == self.team) + { _score = vlen(_trg_gen.origin - _cp.origin); if(_score < _best_score) { _best = _cp; - _best_score = _score; + _best_score = _score; } - } + } _cp = _cp.chain; } - - vector _loc; - float i; + + vector _loc; + float i; if(_best) { for(i = 0; i < 10; ++i) { _loc = _best.origin + '0 0 96'; - _loc += ('0 1 0' * random()) * 128; + _loc += ('0 1 0' * random()) * 128; tracebox(_loc, PL_MIN, PL_MAX, _loc, MOVE_NORMAL, self); if(trace_fraction == 1.0 && !trace_startsolid) { @@ -1624,13 +1624,13 @@ MUTATOR_HOOKFUNCTION(ons_PlayerSpawn) { if(!autocvar_g_onslaught_spawn_at_generator) return 0; - + _trg_gen = ((self.team == NUM_TEAM_1) ? ons_red_generator : ons_blue_generator); - + for(i = 0; i < 10; ++i) { _loc = _trg_gen.origin + '0 0 96'; - _loc += ('0 1 0' * random()) * 128; + _loc += ('0 1 0' * random()) * 128; tracebox(_loc, PL_MIN, PL_MAX, _loc, MOVE_NORMAL, self); if(trace_fraction == 1.0 && !trace_startsolid) { @@ -1640,7 +1640,7 @@ MUTATOR_HOOKFUNCTION(ons_PlayerSpawn) } } } - + return 0; } diff --git a/qcsrc/server/mutators/mutator_bloodloss.qc b/qcsrc/server/mutators/mutator_bloodloss.qc index adffdece9..4d990b3cf 100644 --- a/qcsrc/server/mutators/mutator_bloodloss.qc +++ b/qcsrc/server/mutators/mutator_bloodloss.qc @@ -6,14 +6,14 @@ MUTATOR_HOOKFUNCTION(bloodloss_PlayerThink) if(self.health <= autocvar_g_bloodloss && self.deadflag == DEAD_NO) { self.BUTTON_CROUCH = TRUE; - + if(time >= self.bloodloss_timer) { self.event_damage(self, self, 1, DEATH_ROT, self.origin, '0 0 0'); self.bloodloss_timer = time + 0.5 + random() * 0.5; } } - + return FALSE; } @@ -21,7 +21,7 @@ MUTATOR_HOOKFUNCTION(bloodloss_PlayerJump) { if(self.health <= autocvar_g_bloodloss) return TRUE; - + return FALSE; } diff --git a/qcsrc/server/mutators/mutator_campcheck.qc b/qcsrc/server/mutators/mutator_campcheck.qc index d9d219c5a..fb20d1cff 100644 --- a/qcsrc/server/mutators/mutator_campcheck.qc +++ b/qcsrc/server/mutators/mutator_campcheck.qc @@ -4,7 +4,7 @@ MUTATOR_HOOKFUNCTION(campcheck_PlayerDies) { Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_CAMPCHECK); - + return FALSE; } @@ -17,7 +17,7 @@ MUTATOR_HOOKFUNCTION(campcheck_PlayerDamage) frag_target.campcheck_traveled_distance = autocvar_g_campcheck_distance; frag_attacker.campcheck_traveled_distance = autocvar_g_campcheck_distance; } - + return FALSE; } @@ -62,7 +62,7 @@ MUTATOR_HOOKFUNCTION(campcheck_PlayerSpawn) { self.campcheck_nextcheck = time + autocvar_g_campcheck_interval * 2; self.campcheck_traveled_distance = 0; - + return FALSE; } diff --git a/qcsrc/server/mutators/mutator_dodging.qc b/qcsrc/server/mutators/mutator_dodging.qc index 2eaa5f0b2..3f808499a 100644 --- a/qcsrc/server/mutators/mutator_dodging.qc +++ b/qcsrc/server/mutators/mutator_dodging.qc @@ -34,7 +34,7 @@ MUTATOR_HOOKFUNCTION(dodging_PlayerPhysics) { float velocity_difference; float clean_up_and_do_nothing; float horiz_speed = autocvar_sv_dodging_horiz_speed; - + if(self.freezetag_frozen) horiz_speed = autocvar_sv_dodging_horiz_speed_frozen; @@ -61,13 +61,13 @@ MUTATOR_HOOKFUNCTION(dodging_PlayerPhysics) { // make sure v_up, v_right and v_forward are sane makevectors(self.angles); - // if we have e.g. 0.5 sec ramptime and a frametime of 0.25, then the ramp code - // will be called ramp_time/frametime times = 2 times. so, we need to + // if we have e.g. 0.5 sec ramptime and a frametime of 0.25, then the ramp code + // will be called ramp_time/frametime times = 2 times. so, we need to // add 0.5 * the total speed each frame until the dodge action is done.. common_factor = sys_frametime / autocvar_sv_dodging_ramp_time; // if ramp time is smaller than frametime we get problems ;D - if (common_factor > 1) + if (common_factor > 1) common_factor = 1; new_velocity_gain = self.dodging_velocity_gain - (common_factor * horiz_speed); @@ -81,8 +81,8 @@ MUTATOR_HOOKFUNCTION(dodging_PlayerPhysics) { //disable jump key during dodge accel phase if (self.movement_z > 0) self.movement_z = 0; - self.velocity = - self.velocity + self.velocity = + self.velocity + ((self.dodging_direction_y * velocity_difference) * v_right) + ((self.dodging_direction_x * velocity_difference) * v_forward); @@ -93,8 +93,8 @@ MUTATOR_HOOKFUNCTION(dodging_PlayerPhysics) { if (self.dodging_single_action == 1) { self.flags &= ~FL_ONGROUND; - self.velocity = - self.velocity + self.velocity = + self.velocity + (autocvar_sv_dodging_up_speed * v_up); if (autocvar_sv_dodging_sound == 1) @@ -168,7 +168,7 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) { tap_direction_x = 0; tap_direction_y = 0; - + float frozen_dodging; frozen_dodging = (self.freezetag_frozen && autocvar_sv_dodging_frozen); @@ -182,14 +182,14 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) { if ((time - self.last_dodging_time) < autocvar_sv_dodging_delay) return 0; - if (check_close_to_ground(autocvar_sv_dodging_height_threshold) != 1 + if (check_close_to_ground(autocvar_sv_dodging_height_threshold) != 1 && check_close_to_wall(autocvar_sv_dodging_wall_distance_threshold) != 1) return 0; if (self.movement_x > 0) { // is this a state change? if (!(self.pressedkeys & KEY_FORWARD) || frozen_dodging) { - if ((time - self.last_FORWARD_KEY_time) < self.cvar_cl_dodging_timeout) { + if ((time - self.last_FORWARD_KEY_time) < self.cvar_cl_dodging_timeout) { tap_direction_x = 1.0; dodge_detected = 1; } @@ -201,7 +201,7 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) { // is this a state change? if (!(self.pressedkeys & KEY_BACKWARD) || frozen_dodging) { tap_direction_x = -1.0; - if ((time - self.last_BACKWARD_KEY_time) < self.cvar_cl_dodging_timeout) { + if ((time - self.last_BACKWARD_KEY_time) < self.cvar_cl_dodging_timeout) { dodge_detected = 1; } self.last_BACKWARD_KEY_time = time; @@ -212,7 +212,7 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) { // is this a state change? if (!(self.pressedkeys & KEY_RIGHT) || frozen_dodging) { tap_direction_y = 1.0; - if ((time - self.last_RIGHT_KEY_time) < self.cvar_cl_dodging_timeout) { + if ((time - self.last_RIGHT_KEY_time) < self.cvar_cl_dodging_timeout) { dodge_detected = 1; } self.last_RIGHT_KEY_time = time; @@ -223,7 +223,7 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) { // is this a state change? if (!(self.pressedkeys & KEY_LEFT) || frozen_dodging) { tap_direction_y = -1.0; - if ((time - self.last_LEFT_KEY_time) < self.cvar_cl_dodging_timeout) { + if ((time - self.last_LEFT_KEY_time) < self.cvar_cl_dodging_timeout) { dodge_detected = 1; } self.last_LEFT_KEY_time = time; diff --git a/qcsrc/server/mutators/mutator_melee_only.qc b/qcsrc/server/mutators/mutator_melee_only.qc index 33d0e27b6..73b7dd949 100644 --- a/qcsrc/server/mutators/mutator_melee_only.qc +++ b/qcsrc/server/mutators/mutator_melee_only.qc @@ -2,10 +2,10 @@ MUTATOR_HOOKFUNCTION(melee_SetStartItems) { start_ammo_shells = 0; warmup_start_ammo_shells = 0; - + start_weapons = WEPSET_SHOTGUN; warmup_start_weapons = WEPSET_SHOTGUN; - + return FALSE; } @@ -17,7 +17,7 @@ MUTATOR_HOOKFUNCTION(melee_FilterItem) case IT_ARMOR_SHARD: return FALSE; } - + return TRUE; } diff --git a/qcsrc/server/mutators/mutator_midair.qc b/qcsrc/server/mutators/mutator_midair.qc index 0d48fef9d..f13ae5c8a 100644 --- a/qcsrc/server/mutators/mutator_midair.qc +++ b/qcsrc/server/mutators/mutator_midair.qc @@ -18,7 +18,7 @@ MUTATOR_HOOKFUNCTION(midair_PlayerPowerups) self.effects |= (EF_ADDITIVE | EF_FULLBRIGHT); self.midair_shieldtime = max(self.midair_shieldtime, time + autocvar_g_midair_shieldtime); } - + return FALSE; } diff --git a/qcsrc/server/mutators/mutator_minstagib.qc b/qcsrc/server/mutators/mutator_minstagib.qc index 26dfb5a4d..ac6e158ed 100644 --- a/qcsrc/server/mutators/mutator_minstagib.qc +++ b/qcsrc/server/mutators/mutator_minstagib.qc @@ -1,9 +1,9 @@ -void spawnfunc_item_minst_cells (void) +void spawnfunc_item_minst_cells (void) { if (!g_minstagib) { remove(self); return; } if (!self.ammo_cells) self.ammo_cells = autocvar_g_minstagib_ammo_drop; - + StartItem ("models/items/a_cells.md3", "misc/itempickup.wav", 45, 0, "MinstaNex Ammo", IT_CELLS, 0, 0, generic_pickupevalfunc, 100); @@ -105,7 +105,7 @@ MUTATOR_HOOKFUNCTION(minstagib_MatchEnd) entity head; FOR_EACH_PLAYER(head) minstagib_stop_countdown(head); - + return FALSE; } @@ -113,7 +113,7 @@ MUTATOR_HOOKFUNCTION(minstagib_BotShouldAttack) { if(checkentity.items & IT_STRENGTH) return TRUE; - + return FALSE; } @@ -188,7 +188,7 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerPhysics) { if(self.items & IT_INVINCIBLE) self.stat_sv_maxspeed = self.stat_sv_maxspeed * autocvar_g_minstagib_speed_highspeed; - + return FALSE; } @@ -196,7 +196,7 @@ MUTATOR_HOOKFUNCTION(minstagib_SplitHealthArmor) { damage_save = 0; damage_take = frag_damage; - + return FALSE; } @@ -212,7 +212,7 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerDamage) { if(autocvar_g_friendlyfire == 0 && SAME_TEAM(frag_target, frag_attacker) && IS_PLAYER(frag_target) && IS_PLAYER(frag_attacker)) frag_damage = 0; - + if(IS_PLAYER(frag_target)) { if ((frag_deathtype == DEATH_FALL) || @@ -222,7 +222,7 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerDamage) { frag_damage = 0; } - + if(IS_PLAYER(frag_attacker)) if(DEATH_ISWEAPON(frag_deathtype, WEP_MINSTANEX)) if(frag_target.armorvalue) @@ -233,7 +233,7 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerDamage) frag_target.hitsound += 1; frag_attacker.hitsound += 1; // TODO change this to a future specific hitsound for armor hit } - + if(IS_PLAYER(frag_attacker)) if (DEATH_ISWEAPON(frag_deathtype, WEP_LASER)) { @@ -249,7 +249,7 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerDamage) } } } - + if(IS_PLAYER(frag_attacker)) if(frag_mirrordamage > 0) { @@ -262,23 +262,23 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerDamage) } frag_mirrordamage = 0; } - + if(frag_target.items & IT_STRENGTH) yoda = 1; - + return FALSE; } MUTATOR_HOOKFUNCTION(minstagib_SetStartItems) { start_ammo_cells = cvar("g_minstagib_ammo_start"); - + start_health = 100; start_armorvalue = 0; start_weapons = WEPSET_MINSTANEX; warmup_start_weapons = WEPSET_MINSTANEX; start_items |= IT_UNLIMITED_SUPERWEAPONS; - + return FALSE; } @@ -286,13 +286,13 @@ MUTATOR_HOOKFUNCTION(minstagib_FilterItem) { if(self.classname == "item_cells") return TRUE; // no normal cells? - + if(self.weapon == WEP_MINSTANEX && self.classname == "droppedweapon") { self.ammo_cells = autocvar_g_minstagib_ammo_drop; return FALSE; } - + if(self.weapon == WEP_ROCKET_LAUNCHER || self.weapon == WEP_NEX) { entity e = spawn(); @@ -304,29 +304,29 @@ MUTATOR_HOOKFUNCTION(minstagib_FilterItem) self = oldself; return TRUE; } - + if(self.flags & FL_POWERUP) return FALSE; - + if(self.ammo_cells > autocvar_g_minstagib_ammo_drop && self.classname != "item_minst_cells") self.ammo_cells = autocvar_g_minstagib_ammo_drop; - + if(self.ammo_cells && !self.weapon) return FALSE; - + return TRUE; } MUTATOR_HOOKFUNCTION(minstagib_CustomizeWaypoint) { entity e = WaypointSprite_getviewentity(other); - + // if you have the invisibility powerup, sprites ALWAYS are restricted to your team // but only apply this to real players, not to spectators if((self.owner.flags & FL_CLIENT) && (self.owner.items & IT_STRENGTH) && (e == other)) if(DIFF_TEAM(self.owner, e)) return TRUE; - + return FALSE; } @@ -359,14 +359,14 @@ MUTATOR_HOOKFUNCTION(minstagib_ItemTouch) return MUT_ITEMTOUCH_CONTINUE; } - + if(self.max_health) { other.armorvalue = bound(other.armorvalue, 999, other.armorvalue + autocvar_g_minstagib_extralives); Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_EXTRALIVES); return MUT_ITEMTOUCH_PICKUP; } - + return MUT_ITEMTOUCH_CONTINUE; } @@ -375,21 +375,21 @@ MUTATOR_HOOKFUNCTION(minstagib_OnEntityPreSpawn) if (!autocvar_g_powerups) { return FALSE; } if (!(self.classname == "item_strength" || self.classname == "item_invincible" || self.classname == "item_health_mega")) return FALSE; - + entity e = spawn(); - + if(random() < 0.3) e.think = spawnfunc_item_strength; else if(random() < 0.6) e.think = minstagib_health_mega; else e.think = spawnfunc_item_invincible; - + e.nextthink = time + 0.1; e.spawnflags = self.spawnflags; e.noalign = self.noalign; setorigin(e, self.origin); - + return TRUE; } diff --git a/qcsrc/server/mutators/mutator_multijump.qc b/qcsrc/server/mutators/mutator_multijump.qc index c945e1c2f..50741dc20 100644 --- a/qcsrc/server/mutators/mutator_multijump.qc +++ b/qcsrc/server/mutators/mutator_multijump.qc @@ -10,7 +10,7 @@ MUTATOR_HOOKFUNCTION(multijump_PlayerPhysics) else self.multijump_count = -2; // the cvar value for infinite jumps is -1, so this needs to be smaller } - + return FALSE; } @@ -20,7 +20,7 @@ MUTATOR_HOOKFUNCTION(multijump_PlayerJump) self.multijump_ready = TRUE; // this is necessary to check that we released the jump button and pressed it again else self.multijump_ready = FALSE; - + if(!player_multijump && self.multijump_ready && self.multijump_count < autocvar_g_multijump && self.velocity_z > autocvar_g_multijump_speed) { if (autocvar_g_multijump) diff --git a/qcsrc/server/mutators/mutator_nades.qc b/qcsrc/server/mutators/mutator_nades.qc index 3d0df5dae..5ab6df75d 100644 --- a/qcsrc/server/mutators/mutator_nades.qc +++ b/qcsrc/server/mutators/mutator_nades.qc @@ -4,13 +4,13 @@ void nade_timer_think() self.nextthink = time; if(!self.owner || wasfreed(self.owner)) remove(self); - + } void nade_burn_spawn(entity _nade) { float p; - + switch(_nade.realowner.team) { case NUM_TEAM_1: p = PROJECTILE_NADE_RED_BURN; break; @@ -19,7 +19,7 @@ void nade_burn_spawn(entity _nade) case NUM_TEAM_4: p = PROJECTILE_NADE_PINK_BURN; break; default: p = PROJECTILE_NADE_BURN; break; } - + CSQCProjectile(_nade, TRUE, p, TRUE); } @@ -35,9 +35,9 @@ void nade_spawn(entity _nade) timer.think = nade_timer_think; timer.nextthink = time; timer.wait = _nade.wait; - timer.owner = _nade; + timer.owner = _nade; timer.skin = 10; - + switch(_nade.realowner.team) { case NUM_TEAM_1: p = PROJECTILE_NADE_RED; break; @@ -46,15 +46,15 @@ void nade_spawn(entity _nade) case NUM_TEAM_4: p = PROJECTILE_NADE_PINK; break; default: p = PROJECTILE_NADE; break; } - + CSQCProjectile(_nade, TRUE, p, TRUE); - + } void nade_boom() { string expef; - + switch(self.realowner.team) { case NUM_TEAM_1: expef = "nade_red_explode"; break; @@ -63,11 +63,11 @@ void nade_boom() case NUM_TEAM_4: expef = "nade_pink_explode"; break; default: expef = "nade_explode"; break; } - + sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM); sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum(expef), self.origin + '0 0 1', '0 0 0', 1); - + Damage_DamageInfo(self.origin, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage, autocvar_g_nades_nade_radius, '1 1 1' * autocvar_g_nades_nade_force, self.projectiledeathtype, 0, self); self.takedamage = DAMAGE_NO; @@ -115,13 +115,13 @@ void nade_damage(entity inflictor, entity attacker, float damage, float deathtyp if(DEATH_ISWEAPON(deathtype, WEP_SHOTGUN) && !(deathtype & HITTYPE_SECONDARY)) damage = self.max_health * 1.1; - + if(DEATH_ISWEAPON(deathtype, WEP_SHOTGUN) && (deathtype & HITTYPE_SECONDARY)) { damage = self.max_health * 0.1; force *= 15; } - + self.velocity += force; if(!damage || (self.flags & FL_ONGROUND && IS_PLAYER(attacker))) @@ -147,16 +147,16 @@ void toss_nade(entity e, vector _velocity, float _time) { entity _nade = e.nade; e.nade = world; - + remove(e.fake_nade); e.fake_nade = world; - + makevectors(e.v_angle); - + W_SetupShot(e, FALSE, FALSE, "", CH_WEAPON_A, 0); - + Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER_CPID, CPID_NADES); - + //setorigin(_nade, CENTER_OR_VIEWOFS(e) + (v_right * 10) * -1); setorigin(_nade, w_shotorg + (v_right * 25) * -1); setmodel(_nade, "models/weapons/v_ok_grenade.md3"); @@ -164,11 +164,11 @@ void toss_nade(entity e, vector _velocity, float _time) PROJECTILE_MAKETRIGGER(_nade); setsize(_nade, '-16 -16 -16', '16 16 16'); _nade.movetype = MOVETYPE_BOUNCE; - + tracebox(_nade.origin, _nade.mins, _nade.maxs, _nade.origin, FALSE, _nade); if (trace_startsolid) setorigin(_nade, e.origin); - + if(e.crouch) _nade.velocity = '0 0 -10'; else if(autocvar_g_nades_nade_newton_style == 1) @@ -207,10 +207,10 @@ void nade_prime() { if(self.nade) remove(self.nade); - + if(self.fake_nade) remove(self.fake_nade); - + self.nade = spawn(); setmodel(self.nade, "null"); setattachment(self.nade, self, "bip01 l hand"); @@ -240,22 +240,22 @@ float CanThrowNade() { if(self.vehicle) return FALSE; - + if(gameover) return FALSE; - + if(self.deadflag != DEAD_NO) return FALSE; - + if (!autocvar_g_nades) return FALSE; // allow turning them off mid match - + if(forbidWeaponUse()) return FALSE; - + if (!IS_PLAYER(self)) return FALSE; - + return TRUE; } @@ -263,7 +263,7 @@ void nades_CheckThrow() { if(!CanThrowNade()) return; - + if(!self.nade) { if(self.nade_refire < time) @@ -290,18 +290,18 @@ MUTATOR_HOOKFUNCTION(nades_VehicleEnter) { if(other.nade) toss_nade(other, '0 0 100', max(other.nade.wait, time + 0.05)); - + return FALSE; } MUTATOR_HOOKFUNCTION(nades_PlayerPreThink) { float key_pressed = ((g_grappling_hook || client_hasweapon(self, WEP_HOOK, FALSE, FALSE) || (weaponsInMap & WEPSET_HOOK)) ? self.button16 : self.BUTTON_HOOK); - + if(self.nade) if(self.nade.wait - 0.1 <= time) toss_nade(self, '0 0 0', time + 0.05); - + if(CanThrowNade()) if(self.nade_refire < time) { @@ -317,7 +317,7 @@ MUTATOR_HOOKFUNCTION(nades_PlayerPreThink) makevectors(self.v_angle); float _force = time - self.nade.lifetime; _force /= autocvar_g_nades_nade_lifetime; - _force = autocvar_g_nades_nade_minforce + (_force * (autocvar_g_nades_nade_maxforce - autocvar_g_nades_nade_minforce)); + _force = autocvar_g_nades_nade_minforce + (_force * (autocvar_g_nades_nade_maxforce - autocvar_g_nades_nade_minforce)); toss_nade(self, (v_forward * 0.7 + v_up * 0.2 + v_right * 0.1) * _force, 0); } } @@ -340,7 +340,7 @@ MUTATOR_HOOKFUNCTION(nades_PlayerDies) { if(self.nade) toss_nade(self, '0 0 100', max(self.nade.wait, time + 0.05)); - + return FALSE; } @@ -351,7 +351,7 @@ MUTATOR_HOOKFUNCTION(nades_RemovePlayer) if(self.fake_nade) remove(self.fake_nade); - + return FALSE; } @@ -377,11 +377,11 @@ MUTATOR_DEFINITION(mutator_nades) MUTATOR_HOOK(ClientDisconnect, nades_RemovePlayer, CBC_ORDER_ANY); MUTATOR_HOOK(BuildMutatorsString, nades_BuildMutatorsString, CBC_ORDER_ANY); MUTATOR_HOOK(BuildMutatorsPrettyString, nades_BuildMutatorsPrettyString, CBC_ORDER_ANY); - + MUTATOR_ONADD { precache_model("models/ok_nade_counter/ok_nade_counter.md3"); - + precache_model("models/weapons/h_ok_grenade.iqm"); precache_model("models/weapons/v_ok_grenade.md3"); precache_sound("weapons/rocket_impact.wav"); diff --git a/qcsrc/server/mutators/mutator_new_toys.qc b/qcsrc/server/mutators/mutator_new_toys.qc index f384a0aad..f11298451 100644 --- a/qcsrc/server/mutators/mutator_new_toys.qc +++ b/qcsrc/server/mutators/mutator_new_toys.qc @@ -4,7 +4,7 @@ CORE laser nex lg rl cry gl elec hagar fireb minsta porto tuba -NEW rifle hlac minel seeker +NEW rifle hlac minel seeker IDEAS OPEN flak OPEN FUN FUN FUN FUN @@ -127,7 +127,7 @@ MUTATOR_HOOKFUNCTION(nt_SetStartItems) WepSet newdefault; WepSet warmup_newdefault; - + newdefault = '0 0 0'; warmup_newdefault = '0 0 0'; diff --git a/qcsrc/server/mutators/mutator_pinata.qc b/qcsrc/server/mutators/mutator_pinata.qc index af5d4a8b1..6d982d5a4 100644 --- a/qcsrc/server/mutators/mutator_pinata.qc +++ b/qcsrc/server/mutators/mutator_pinata.qc @@ -6,7 +6,7 @@ MUTATOR_HOOKFUNCTION(pinata_PlayerDies) if(self.switchweapon != j) if(W_IsWeaponThrowable(j)) W_ThrowNewWeapon(self, j, FALSE, self.origin + (self.mins + self.maxs) * 0.5, randomvec() * 175 + '0 0 325'); - + return TRUE; } diff --git a/qcsrc/server/mutators/mutator_random_gravity.qc b/qcsrc/server/mutators/mutator_random_gravity.qc index e2832ace2..184047189 100644 --- a/qcsrc/server/mutators/mutator_random_gravity.qc +++ b/qcsrc/server/mutators/mutator_random_gravity.qc @@ -7,20 +7,20 @@ float gravity_delay; MUTATOR_HOOKFUNCTION(gravity_StartFrame) { - if(gameover || !cvar("g_random_gravity")) return FALSE; + if(gameover || !cvar("g_random_gravity")) return FALSE; if(time < gravity_delay) return FALSE; if(time < game_starttime) return FALSE; if(round_handler_IsActive() && !round_handler_IsRoundStarted()) return FALSE; - - if(random() >= autocvar_g_random_gravity_negative_chance) + + if(random() >= autocvar_g_random_gravity_negative_chance) cvar_set("sv_gravity", ftos(bound(autocvar_g_random_gravity_min, random() - random() * -autocvar_g_random_gravity_negative, autocvar_g_random_gravity_max))); else cvar_set("sv_gravity", ftos(bound(autocvar_g_random_gravity_min, random() * autocvar_g_random_gravity_positive, autocvar_g_random_gravity_max))); - + gravity_delay = time + autocvar_g_random_gravity_delay; - + dprint("Gravity is now: ", ftos(autocvar_sv_gravity), "\n"); - + return FALSE; } @@ -41,7 +41,7 @@ MUTATOR_DEFINITION(mutator_random_gravity) MUTATOR_HOOK(SV_StartFrame, gravity_StartFrame, CBC_ORDER_ANY); MUTATOR_HOOK(BuildMutatorsString, gravity_BuildMutatorsString, CBC_ORDER_ANY); MUTATOR_HOOK(BuildMutatorsPrettyString, gravity_BuildMutatorsPrettyString, CBC_ORDER_ANY); - + MUTATOR_ONADD { cvar_settemp("sv_gravity", cvar_string("sv_gravity")); // settemp current gravity so it's restored on match end diff --git a/qcsrc/server/mutators/mutator_vampire.qc b/qcsrc/server/mutators/mutator_vampire.qc index edfcba439..73317d0c1 100644 --- a/qcsrc/server/mutators/mutator_vampire.qc +++ b/qcsrc/server/mutators/mutator_vampire.qc @@ -7,7 +7,7 @@ MUTATOR_HOOKFUNCTION(vampire_PlayerDamage) frag_attacker.health += bound(0, damage_take, frag_target.health); frag_attacker.health = bound(0, frag_attacker.health, autocvar_g_balance_health_limit); } - + return FALSE; } diff --git a/qcsrc/server/pathlib/debug.qc b/qcsrc/server/pathlib/debug.qc index 64ce9da02..d432221f2 100644 --- a/qcsrc/server/pathlib/debug.qc +++ b/qcsrc/server/pathlib/debug.qc @@ -24,7 +24,7 @@ void path_dbg_think() void __showpath2_think() { - #ifdef TURRET_DEBUG + #ifdef TURRET_DEBUG mark_info(self.origin,1); #endif if(self.path_next) diff --git a/qcsrc/server/pathlib/path_waypoint.qc b/qcsrc/server/pathlib/path_waypoint.qc index 22d1e732e..9f443b0ac 100644 --- a/qcsrc/server/pathlib/path_waypoint.qc +++ b/qcsrc/server/pathlib/path_waypoint.qc @@ -22,14 +22,14 @@ float pathlib_wpp_opencb(entity wp, entity child, float cost) // FIXME! wp.wp##mincost is NOT distance. Make it distance or add a field for distance to be used here (for better speed) cost = vlen(child.origin - wp.origin); - + child.path_prev = wp; child.pathlib_list = openlist; child.pathlib_node_g = wp.pathlib_node_g + cost; child.pathlib_node_h = pathlib_heuristic(child.origin, goal_node.origin); child.pathlib_node_c = pathlib_wpp_waypointcallback(child, wp); child.pathlib_node_f = child.pathlib_node_g + child.pathlib_node_h + child.pathlib_node_c; - + if(child == goal_node) pathlib_foundgoal = TRUE; @@ -50,11 +50,11 @@ float pathlib_wpp_openncb(entity wp, entity child, float cost) // FIXME! wp.wp##mincost is NOT distance. Make it distance or add a field for distance to be used here (for better speed) cost = vlen(child.origin - wp.origin); - + child.path_prev = wp; child.pathlib_list = openlist; child.pathlib_node_g = wp.pathlib_node_g + cost; - child.pathlib_node_h = pathlib_heuristic(child.origin, goal_node.origin); + child.pathlib_node_h = pathlib_heuristic(child.origin, goal_node.origin); child.pathlib_node_f = child.pathlib_node_g + child.pathlib_node_h; if(child == goal_node) @@ -102,7 +102,7 @@ float pathlib_wpp_expand(entity wp) if(wp.wp29) pathlib_wpp_open(wp,wp.wp29,wp.wp29mincost); else return 29; if(wp.wp30) pathlib_wpp_open(wp,wp.wp30,wp.wp30mincost); else return 30; if(wp.wp31) pathlib_wpp_open(wp,wp.wp31,wp.wp31mincost); else return 31; - + return 32; } @@ -133,20 +133,20 @@ entity pathlib_waypointpath(entity wp_from, entity wp_to, float callback) float ptime; ptime = gettime(GETTIME_REALTIME); - pathlib_starttime = ptime; + pathlib_starttime = ptime; pathlib_movecost = 300; pathlib_movecost_diag = vlen('1 1 0' * pathlib_movecost); - - if (!pathlib_wpp_waypointcallback) + + if (!pathlib_wpp_waypointcallback) callback = FALSE; - + if (callback) pathlib_wpp_open = pathlib_wpp_opencb; else pathlib_wpp_open = pathlib_wpp_openncb; - + pathlib_heuristic = pathlib_h_none; - + if (!openlist) openlist = spawn(); @@ -168,12 +168,12 @@ entity pathlib_waypointpath(entity wp_from, entity wp_to, float callback) n.pathlib_node_g = 0; n.pathlib_node_f = 0; n.pathlib_node_h = 0; - + //setmodel(n, "models/runematch/rune.mdl"); //n.effects = EF_LOWPRECISION; //n.colormod = '0 0 0'; //n.scale = 1; - + } goal_node = wp_to; @@ -202,18 +202,18 @@ entity pathlib_waypointpath_step() } pathlib_wpp_close(n); dprint("Expanding ",ftos(pathlib_wpp_expand(n))," links\n"); - + if(pathlib_foundgoal) { entity start, end, open, ln; - + dprint("Target found. Rebuilding and filtering path...\n"); - + buildpath_nodefilter = buildpath_nodefilter_none; start = path_build(world, start_node.origin, world, world); end = path_build(world, goal_node.origin, world, start); ln = end; - + for(open = goal_node; open.path_prev != start_node; open = open.path_prev) { n = path_build(ln,open.origin,open.path_prev,start); @@ -221,8 +221,8 @@ entity pathlib_waypointpath_step() ln = n; } start.path_next = n; - n.path_prev = start; - + n.path_prev = start; + return start; } diff --git a/qcsrc/server/playerstats.qc b/qcsrc/server/playerstats.qc index 354b521e8..2c6e941a6 100644 --- a/qcsrc/server/playerstats.qc +++ b/qcsrc/server/playerstats.qc @@ -17,7 +17,7 @@ void PlayerStats_Init() // initiated before InitGameplayMode so that scores are if(playerstats_db >= 0) playerstats_waitforme = FALSE; // must wait for it at match end - serverflags |= SERVERFLAG_PLAYERSTATS; + serverflags |= SERVERFLAG_PLAYERSTATS; PlayerStats_AddEvent(PLAYERSTATS_ALIVETIME); PlayerStats_AddEvent(PLAYERSTATS_AVGLATENCY); @@ -83,7 +83,7 @@ void PlayerStats_AddPlayer(entity e) string key; key = sprintf("%s:*", e.playerstats_id); - + string p; p = db_get(playerstats_db, key); if(p == "") @@ -106,7 +106,7 @@ void PlayerStats_AddTeam(float t) string key; key = sprintf("%d", t); - + string p; p = db_get(playerstats_db, key); if(p == "") @@ -126,10 +126,10 @@ void PlayerStats_AddEvent(string event_id) { if(playerstats_db < 0) return; - + string key; key = sprintf("*:%s", event_id); - + string p; p = db_get(playerstats_db, key); if(p == "") @@ -149,7 +149,7 @@ float PlayerStats_Event(entity e, string event_id, float value) { if((e.playerstats_id == "") || playerstats_db < 0) return 0; - + string key; float val; key = sprintf("%s:%s", e.playerstats_id, event_id); @@ -194,7 +194,7 @@ float PlayerStats_TeamScore(float t, string event_id, float value) U: UDP port number of the server D: duration of the match P: player ID of an existing player; this also sets the owner for all following "n", "e" and "t" lines (lower case!) - Q: team number of an existing team (format: team#NN); this also sets the owner for all following "e" lines (lower case!) + Q: team number of an existing team (format: team#NN); this also sets the owner for all following "e" lines (lower case!) n: nickname of the player (optional) t: team ID i: player index diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 1e08c61e3..e6d7a43ac 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -174,7 +174,7 @@ void race_setTime(string map, float t, string myuid, string mynetname, entity e) oldrec = race_readTime(GetMapname(), newpos); oldrec_holder = race_readName(GetMapname(), newpos); - + // store new ranking race_writeTime(GetMapname(), t, myuid); @@ -187,7 +187,7 @@ void race_setTime(string map, float t, string myuid, string mynetname, entity e) if(rankings_reply) strunzone(rankings_reply); rankings_reply = strzone(getrankings()); - + if(newpos == player_prevpos) { Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_RACE_NEW_IMPROVED, mynetname, newpos, t, oldrec); @@ -477,7 +477,7 @@ void checkpoint_passed() other.porto_forbidden = 2; // decreased by 1 each StartFrame if(defrag_ents) { - if(self.race_checkpoint == -2) + if(self.race_checkpoint == -2) { self.race_checkpoint = other.race_checkpoint; } @@ -497,7 +497,7 @@ void checkpoint_passed() for(cp = world; (cp = find(cp, classname, "target_checkpoint"));) { if(cp.race_checkpoint == -2) // set defragcpexists to -1 so that the cp id file will be rewritten when someone finishes defragcpexists = -1; - } + } } } if(cp_amount == 0) { @@ -611,7 +611,7 @@ void trigger_race_checkpoint_verify() if(have_verified) return; have_verified = 1; - + qual = g_race_qualifying; oldself = self; @@ -637,7 +637,7 @@ void trigger_race_checkpoint_verify() self.race_place = race_lowest_place_spawn; if(!Spawn_FilterOutBadSpots(findchain(classname, "info_player_deathmatch"), 0, FALSE)) error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(self.race_place), " (used for qualifying) - bailing out")); - + // race only (initial spawn) g_race_qualifying = 0; for(p = 1; p <= race_highest_place_spawn; ++p) @@ -663,7 +663,7 @@ void trigger_race_checkpoint_verify() self.race_checkpoint = race_NextCheckpoint(0); g_race_qualifying = 1; self.race_place = 0; // there's only one spawn on defrag maps - + // check if a defragcp file already exists, then read it and apply the checkpoint order float fh; float len; @@ -739,8 +739,8 @@ void trigger_race_checkpoint_verify() targ.wait = 0; targ.delay = 0; - // These just make the game crash on some maps with oddly shaped triggers. - // (on the other hand they used to fix the case when two players ran through a checkpoint at once, + // These just make the game crash on some maps with oddly shaped triggers. + // (on the other hand they used to fix the case when two players ran through a checkpoint at once, // and often one of them just passed through without being registered. Hope it's fixed in a better way now. // (happened on item triggers too) // @@ -814,7 +814,7 @@ void spawnfunc_trigger_race_checkpoint() self.message2 = "was pushed backwards by"; if (self.race_penalty_reason == "") self.race_penalty_reason = "missing a checkpoint"; - + self.race_checkpoint = self.cnt; if(self.race_checkpoint > race_highest_checkpoint) @@ -1115,7 +1115,7 @@ float race_GetFractionalLapCount(entity e) l = PlayerScore_Add(e, SP_RACE_LAPS, 0); if(e.race_completed) return l; // not fractional - + vector o0, o1; float bestfraction, fraction; entity lastcp, cp0, cp1; @@ -1127,7 +1127,7 @@ float race_GetFractionalLapCount(entity e) if(nextcpindex == lastcpindex) return l; // finish - + bestfraction = 1; for(cp0 = world; (cp0 = find(cp0, classname, "trigger_race_checkpoint")); ) { diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index 0dc2b2f00..86a96aab1 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -688,7 +688,7 @@ float PlayerTeamScore_Compare(entity p1, entity p2, float teams, float strict) if(teams < 0) return 0; } - + return PlayerScore_Compare(p1.scorekeeper, p2.scorekeeper, strict); } @@ -712,7 +712,7 @@ entity PlayerScore_Sort(.float field, float teams, float strict, float nospectat plist = p; } // Now plist points to the whole list. - + pfirst = plast = world; i = j = 0; @@ -813,7 +813,7 @@ void Score_NicePrint_Team(entity to, float t, float w) s = "Scores:"; s = strcat(s, strpad(max(0, NAMEWIDTH - strlennocol(s)), "")); - + for(i = 0; i < MAX_SCORE; ++i) if(scores_label[i] != "") { @@ -847,7 +847,7 @@ void Score_NicePrint_Player(entity to, entity p, float w) break; } } - + for(i = 0; i < MAX_SCORE; ++i) if(scores_label[i] != "") { @@ -896,7 +896,7 @@ void Score_NicePrint(entity to) t = p.team; p = p.chain; } - + t = 0; FOR_EACH_CLIENT(p) if (!IS_PLAYER(p)) diff --git a/qcsrc/server/secret.qc b/qcsrc/server/secret.qc index 64c91685e..06f7e075d 100644 --- a/qcsrc/server/secret.qc +++ b/qcsrc/server/secret.qc @@ -12,7 +12,7 @@ void trigger_secret_touch() { // only a player can trigger this if (!IS_PLAYER(other)) return; - + // update secrets found counter secrets_found += 1; //print("Secret found: ", ftos(secret_counter.cnt), "/"); @@ -21,7 +21,7 @@ void trigger_secret_touch() { // centerprint message (multi_touch() doesn't always call centerprint()) centerprint(other, self.message); self.message = ""; - + // handle normal trigger features multi_touch(); remove(self); @@ -42,32 +42,32 @@ Trigger secret can only be trigger by a player's touch and can not be a target i */ void spawnfunc_trigger_secret() { // FIXME: should it be disabled in most modes? - + // update secrets count secrets_total += 1; - + // add default message if (self.message == "") self.message = "You found a secret!"; - + // set default sound if (self.noise == "") if (!self.sounds) self.sounds = 1; // misc/secret.wav - + // this entity can't be a target itself!!!! self.targetname = ""; - + // you can't just shoot a room to find it, can you? self.health = 0; - + // a secret can not be delayed self.delay = 0; - + // convert this trigger to trigger_once self.classname = "trigger_once"; spawnfunc_trigger_once(); - + // take over the touch() function, so we can mark secret as found self.touch = trigger_secret_touch; // ignore triggering; diff --git a/qcsrc/server/spawnpoints.qc b/qcsrc/server/spawnpoints.qc index 429bf8494..e62167ce0 100644 --- a/qcsrc/server/spawnpoints.qc +++ b/qcsrc/server/spawnpoints.qc @@ -13,7 +13,7 @@ float SpawnPoint_Send(entity to, float sf) float SpawnEvent_Send(entity to, float sf) { float send; - + WriteByte(MSG_ENTITY, ENT_CLIENT_SPAWNEVENT); if(autocvar_g_spawn_alloweffects) diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index 5510be0e1..043cb7713 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -2,15 +2,15 @@ void CreatureFrame (void) { entity oldself; float dm; - + oldself = self; for(self = world; (self = findfloat(self, damagedbycontents, TRUE)); ) { if (self.movetype == MOVETYPE_NOCLIP) { continue; } - + float vehic = (self.vehicle_flags & VHF_ISVEHICLE); float projectile = (self.flags & FL_PROJECTILE); - + if (self.watertype <= CONTENT_WATER && self.waterlevel > 0) // workaround a retarded bug made by id software :P (yes, it's that old of a bug) { if (!(self.flags & FL_INWATER)) @@ -38,11 +38,11 @@ void CreatureFrame (void) } } } - + if (self.dmgtime < time) { - self.dmgtime = time + autocvar_g_balance_contents_damagerate; - + self.dmgtime = time + autocvar_g_balance_contents_damagerate; + if (projectile) { if (self.watertype == CONTENT_LAVA) @@ -135,7 +135,7 @@ void CreatureFrame (void) } } } - + self.oldvelocity = self.velocity; } self = oldself; diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index ab4505ae5..1db8f6cd7 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -28,37 +28,37 @@ var string autocvr_cl_simpleitems_postfix = "_simple"; .float gravity; .vector colormod; void ItemDraw() -{ +{ if(self.gravity) - { + { Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy); - if(self.move_flags & FL_ONGROUND) + if(self.move_flags & FL_ONGROUND) { // For some reason move_avelocity gets set to '0 0 0' here ... self.oldorigin = self.origin; self.gravity = 0; - if(autocvar_cl_animate_items) - { // ... so reset it if animations are requested. + if(autocvar_cl_animate_items) + { // ... so reset it if animations are requested. if(self.ItemStatus & ITS_ANIMATE1) self.move_avelocity = '0 180 0'; - + if(self.ItemStatus & ITS_ANIMATE2) self.move_avelocity = '0 -90 0'; } } } else if (autocvar_cl_animate_items) - { + { if(self.ItemStatus & ITS_ANIMATE1) { self.angles += self.move_avelocity * frametime; - setorigin(self, '0 0 10' + self.oldorigin + '0 0 8' * sin(time * 2)); - } - + setorigin(self, '0 0 10' + self.oldorigin + '0 0 8' * sin(time * 2)); + } + if(self.ItemStatus & ITS_ANIMATE2) { self.angles += self.move_avelocity * frametime; - setorigin(self, '0 0 8' + self.oldorigin + '0 0 4' * sin(time * 3)); + setorigin(self, '0 0 8' + self.oldorigin + '0 0 4' * sin(time * 3)); } } } @@ -66,9 +66,9 @@ void ItemDraw() void ItemDrawSimple() { if(self.gravity) - { - Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy); - + { + Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy); + if(self.move_flags & FL_ONGROUND) self.gravity = 0; } @@ -86,19 +86,19 @@ void ItemRead(float _IsNew) setorigin(self, self.origin); self.oldorigin = self.origin; } - - if(sf & ISF_ANGLES) + + if(sf & ISF_ANGLES) { self.angles_x = ReadCoord(); self.angles_y = ReadCoord(); - self.angles_z = ReadCoord(); + self.angles_z = ReadCoord(); self.move_angles = self.angles; } - + if(sf & ISF_STATUS) // need to read/write status frist so model can handle simple, fb etc. { - self.ItemStatus = ReadByte(); - + self.ItemStatus = ReadByte(); + if(self.ItemStatus & ITS_AVAILABLE) { self.alpha = 1; @@ -113,19 +113,19 @@ void ItemRead(float _IsNew) } else self.alpha = -1; - } - + } + if(autocvar_cl_fullbright_items) if(self.ItemStatus & ITS_ALLOWFB) self.effects |= EF_FULLBRIGHT; - + if(self.ItemStatus & ITS_STAYWEP) { self.colormod = self.glowmod = autocvar_cl_weapon_stay_color; self.alpha = autocvar_cl_weapon_stay_alpha; - + } - + if(self.ItemStatus & ITS_POWERUP) { if(self.ItemStatus & ITS_AVAILABLE) @@ -134,26 +134,26 @@ void ItemRead(float _IsNew) self.effects &= ~(EF_ADDITIVE | EF_FULLBRIGHT); } } - + if(sf & ISF_MODEL) { self.drawmask = MASK_NORMAL; self.movetype = MOVETYPE_NOCLIP; self.draw = ItemDraw; - + if(self.mdl) strunzone(self.mdl); - + self.mdl = ""; string _fn = ReadString(); - + if(autocvar_cl_simple_items && (self.ItemStatus & ITS_ALLOWSI)) { string _fn2 = substring(_fn, 0 , strlen(_fn) -4); self.draw = ItemDrawSimple; - - - + + + if(fexists(sprintf("%s%s.md3", _fn2, autocvr_cl_simpleitems_postfix))) self.mdl = strzone(sprintf("%s%s.md3", _fn2, autocvr_cl_simpleitems_postfix)); else if(fexists(sprintf("%s%s.dpm", _fn2, autocvr_cl_simpleitems_postfix))) @@ -168,21 +168,21 @@ void ItemRead(float _IsNew) dprint("Simple item requested for ", _fn, " but no model exsist for it\n"); } } - - if(self.draw != ItemDrawSimple) - self.mdl = strzone(_fn); - - + + if(self.draw != ItemDrawSimple) + self.mdl = strzone(_fn); + + if(self.mdl == "") dprint("^1WARNING!^7 self.mdl is unset for item ", self.classname, " tell tZork aboute this!\n"); - + precache_model(self.mdl); setmodel(self, self.mdl); } - + if(sf & ISF_COLORMAP) self.colormap = ReadShort(); - + if(sf & ISF_DROP) { self.gravity = 1; @@ -193,7 +193,7 @@ void ItemRead(float _IsNew) self.move_velocity_z = ReadCoord(); self.velocity = self.move_velocity; self.move_origin = self.oldorigin; - + if(!self.move_time) { self.move_time = time; @@ -202,12 +202,12 @@ void ItemRead(float _IsNew) else self.move_time = max(self.move_time, time); } - + if(autocvar_cl_animate_items) - { + { if(self.ItemStatus & ITS_ANIMATE1) self.move_avelocity = '0 180 0'; - + if(self.ItemStatus & ITS_ANIMATE2) self.move_avelocity = '0 -90 0'; } @@ -223,8 +223,8 @@ float ItemSend(entity to, float sf) sf |= ISF_DROP; else sf &= ~ISF_DROP; - - WriteByte(MSG_ENTITY, ENT_CLIENT_ITEM); + + WriteByte(MSG_ENTITY, ENT_CLIENT_ITEM); WriteByte(MSG_ENTITY, sf); //WriteByte(MSG_ENTITY, self.cnt); @@ -234,7 +234,7 @@ float ItemSend(entity to, float sf) WriteCoord(MSG_ENTITY, self.origin_y); WriteCoord(MSG_ENTITY, self.origin_z); } - + if(sf & ISF_ANGLES) { WriteCoord(MSG_ENTITY, self.angles_x); @@ -247,14 +247,14 @@ float ItemSend(entity to, float sf) if(sf & ISF_MODEL) { - + if(self.mdl == "") dprint("^1WARNING!^7 self.mdl is unset for item ", self.classname, "exspect a crash just aboute now\n"); - + WriteString(MSG_ENTITY, self.mdl); } - - + + if(sf & ISF_COLORMAP) WriteShort(MSG_ENTITY, self.colormap); @@ -264,7 +264,7 @@ float ItemSend(entity to, float sf) WriteCoord(MSG_ENTITY, self.velocity_y); WriteCoord(MSG_ENTITY, self.velocity_z); } - + return TRUE; } @@ -374,7 +374,7 @@ float Item_Customize() */ void Item_Show (entity e, float mode) -{ +{ e.effects &= ~(EF_ADDITIVE | EF_STARDUST | EF_FULLBRIGHT | EF_NODEPTHTEST); e.ItemStatus &= ~ITS_STAYWEP; if (mode > 0) @@ -411,17 +411,17 @@ void Item_Show (entity e, float mode) e.spawnshieldtime = 1; e.ItemStatus &= ~ITS_AVAILABLE; } - + if (e.items & IT_STRENGTH || e.items & IT_INVINCIBLE) - e.ItemStatus |= ITS_POWERUP; - + e.ItemStatus |= ITS_POWERUP; + if (autocvar_g_nodepthtestitems) e.effects |= EF_NODEPTHTEST; - - + + if (autocvar_g_fullbrightitems) e.ItemStatus |= ITS_ALLOWFB; - + if (autocvar_sv_simple_items) e.ItemStatus |= ITS_ALLOWSI; @@ -651,7 +651,7 @@ float Item_GiveTo(entity item, entity player) } :skip - + // always eat teamed entities if(item.team) pickedup = TRUE; @@ -669,7 +669,7 @@ float Item_GiveTo(entity item, entity player) void Item_Touch (void) { entity e, head; - + // remove the item if it's currnetly in a NODROP brush or hits a NOIMPACT surface (such as sky) if(self.classname == "droppedweapon") { @@ -930,16 +930,16 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime, if(self.model == "") self.model = itemmodel; - + if(self.model == "") { error(strcat("^1Tried to spawn ", itemname, " with no model!\n")); return; } - + if(self.item_pickupsound == "") self.item_pickupsound = pickupsound; - + if(!self.respawntime) // both need to be set { self.respawntime = defaultrespawntime; @@ -951,7 +951,7 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime, if(weaponid) self.weapons = WepSet_FromWeapon(weaponid); - + self.flags = FL_ITEM | itemflags; if(MUTATOR_CALLHOOK(FilterItem)) // error means we do not want the item @@ -1009,7 +1009,7 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime, remove (self); return; } - + if(self.angles != '0 0 0') self.SendFlags |= ISF_ANGLES; @@ -1090,8 +1090,8 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime, self.netname = itemname; self.touch = Item_Touch; setmodel(self, "null"); // precision set below - //self.effects |= EF_LOWPRECISION; - + //self.effects |= EF_LOWPRECISION; + if((itemflags & FL_POWERUP) || self.health || self.armorvalue) { self.pos1 = '-16 -16 0'; @@ -1103,20 +1103,20 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime, self.pos2 = '16 16 32'; } setsize (self, self.pos1, self.pos2); - - if(itemflags & FL_POWERUP) + + if(itemflags & FL_POWERUP) self.ItemStatus |= ITS_ANIMATE1; - + if(self.armorvalue || self.health) self.ItemStatus |= ITS_ANIMATE2; - + if(itemflags & FL_WEAPON) { if (self.classname != "droppedweapon") // if dropped, colormap is already set up nicely self.colormap = 1024; // color shirt=0 pants=0 grey else self.gravity = 1; - + self.ItemStatus |= ITS_ANIMATE1; self.ItemStatus |= ISF_COLORMAP; } @@ -1126,13 +1126,13 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime, { if(!self.cnt) self.cnt = 1; // item probability weight - + self.effects |= EF_NODRAW; // marker for item team search InitializeEntity(self, Item_FindTeam, INITPRIO_FINDTARGET); } else Item_Reset(); - + Net_LinkEntity(self, FALSE, 0, ItemSend); // call this hook after everything else has been done @@ -1803,7 +1803,7 @@ float GiveItems(entity e, float beginarg, float endarg) e.strength_finished = max(0, e.strength_finished - time); e.invincible_finished = max(0, e.invincible_finished - time); e.superweapons_finished = max(0, e.superweapons_finished - time); - + PREGIVE(e, items); PREGIVE_WEAPONS(e); PREGIVE(e, strength_finished); diff --git a/qcsrc/server/t_plats.qc b/qcsrc/server/t_plats.qc index 55844c8d6..395544231 100644 --- a/qcsrc/server/t_plats.qc +++ b/qcsrc/server/t_plats.qc @@ -448,9 +448,9 @@ void spawnfunc_func_train() void func_rotating_setactive(float astate) { - + if (astate == ACTIVE_TOGGLE) - { + { if(self.active == ACTIVE_ACTIVE) self.active = ACTIVE_NOT; else @@ -458,8 +458,8 @@ void func_rotating_setactive(float astate) } else self.active = astate; - - if(self.active == ACTIVE_NOT) + + if(self.active == ACTIVE_NOT) self.avelocity = '0 0 0'; else self.avelocity = self.pos1; @@ -480,10 +480,10 @@ void spawnfunc_func_rotating() precache_sound(self.noise); ambientsound(self.origin, self.noise, VOL_BASE, ATTEN_IDLE); } - + self.active = ACTIVE_ACTIVE; self.setactive = func_rotating_setactive; - + if (!self.speed) self.speed = 100; // FIXME: test if this turns the right way, then remove this comment (negate as needed) @@ -495,9 +495,9 @@ void spawnfunc_func_rotating() // FIXME: test if this turns the right way, then remove this comment (negate as needed) else // Z self.avelocity = '0 1 0' * self.speed; - + self.pos1 = self.avelocity; - + if(self.dmg && (self.message == "")) self.message = " was squished"; if(self.dmg && (self.message2 == "")) @@ -527,13 +527,13 @@ void func_bobbing_controller_think() { vector v; self.nextthink = time + 0.1; - + if (!(self.owner.active == ACTIVE_ACTIVE)) { - self.owner.velocity = '0 0 0'; + self.owner.velocity = '0 0 0'; return; } - + // calculate sinewave using makevectors makevectors((self.nextthink * self.owner.cnt + self.owner.phase * 360) * '0 1 0'); v = self.owner.destvec + self.owner.movedir * v_forward_y; @@ -992,13 +992,13 @@ ACTIVATION FUNCTIONS float door_check_keys(void) { local entity door; - - + + if (self.owner) door = self.owner; else door = self; - + // no key needed if (!door.itemkeys) return TRUE; @@ -1007,7 +1007,7 @@ float door_check_keys(void) { // only a player can have a key if (!IS_PLAYER(other)) return FALSE; - + if (item_keys_usekey(door, other)) { // some keys were used if (other.key_door_messagetime <= time) { @@ -1099,7 +1099,7 @@ void door_use() entity oself; //dprint("door_use (model: ");dprint(self.model);dprint(")\n"); - + if (self.owner) { oself = self; @@ -1118,11 +1118,11 @@ void door_trigger_touch() if (time < self.attack_finished_single) return; - + // check if door is locked if (!door_check_keys()) return; - + self.attack_finished_single = time + 1; activator = other; @@ -1139,12 +1139,12 @@ void door_damage(entity inflictor, entity attacker, float damage, float deathtyp if(!(DEATH_ISSPECIAL(deathtype)) && (deathtype & HITTYPE_SPLASH)) return; self.health = self.health - damage; - + if (self.itemkeys) { // don't allow opening doors through damage if keys are required return; } - + if (self.health <= 0) { oself = self; @@ -1489,7 +1489,7 @@ void spawnfunc_func_door() self.itemkeys |= ITEM_KEY_BIT(0); if (self.spawnflags & SPAWNFLAGS_SILVER_KEY) self.itemkeys |= ITEM_KEY_BIT(1); - + //if (!self.deathtype) // map makers can override this // self.deathtype = " got in the way"; SetMovedir (); @@ -1942,7 +1942,7 @@ void func_fourier_controller_think() self.nextthink = time + 0.1; if (!(self.owner.active == ACTIVE_ACTIVE)) { - self.owner.velocity = '0 0 0'; + self.owner.velocity = '0 0 0'; return; } @@ -2075,7 +2075,7 @@ void func_vectormamamam_controller_think() if (!(self.owner.active == ACTIVE_ACTIVE)) { - self.owner.velocity = '0 0 0'; + self.owner.velocity = '0 0 0'; return; } diff --git a/qcsrc/server/t_swamp.qc b/qcsrc/server/t_swamp.qc index 2a9d5427b..e481dc634 100644 --- a/qcsrc/server/t_swamp.qc +++ b/qcsrc/server/t_swamp.qc @@ -1,7 +1,7 @@ /* * t_swamp.c * Adds spawnfunc_trigger_swamp and suppoart routines for xonotic 1.2.1+ -* Author tZork (Jakob MG) +* Author tZork (Jakob MG) * jakob@games43.se * 2005 11 29 */ @@ -20,16 +20,16 @@ void swampslug_think(); * It works like this: When the plyer enters teh swamp the spawnfunc_trigger_swamp * attaches a new "swampslug" to the player. As long as the plyer is inside * the swamp the swamp gives the slug new health. But the slug slowly kills itself -* so when the player goes outside the swamp, it dies and releases the player from the -* swamps curses (dmg/slowdown) -* +* so when the player goes outside the swamp, it dies and releases the player from the +* swamps curses (dmg/slowdown) +* * I do it this way becuz there is no "untouch" event. * -* --NOTE-- +* --NOTE-- * THE ACCTUAL slowdown is done in cl_physics.c on line 57-60 * --NOTE-- */ -void swampslug_think(void) +void swampslug_think(void) { //Slowly kill the slug self.health = self.health - 1; @@ -41,7 +41,7 @@ void swampslug_think(void) //centerprint(self.owner,"Killing slug...\n"); return; } - + // Slug still alive, so we are still in the swamp // Or we have exited it very recently. // Do the damage and renew the timer. @@ -50,7 +50,7 @@ void swampslug_think(void) self.nextthink = time + self.swamp_interval; } -void swamp_touch(void) +void swamp_touch(void) { // If whatever thats touching the swamp is not a player // or if its a dead player, just dont care abt it. @@ -82,20 +82,20 @@ void swamp_touch(void) } /*QUAKED spawnfunc_trigger_swamp (.5 .5 .5) ? -Players gettin into the swamp will +Players gettin into the swamp will get slowd down and damaged */ void spawnfunc_trigger_swamp(void) { // Init stuff EXACTTRIGGER_INIT; - self.touch = swamp_touch; + self.touch = swamp_touch; // Setup default keys, if missing - if(self.dmg <= 0) + if(self.dmg <= 0) self.dmg = 5; - if(self.swamp_interval <= 0) + if(self.swamp_interval <= 0) self.swamp_interval = 1; - if(self.swamp_slowdown <= 0) + if(self.swamp_slowdown <= 0) self.swamp_slowdown = 0.5; } diff --git a/qcsrc/server/t_teleporters.qc b/qcsrc/server/t_teleporters.qc index 0b2345118..8f15a4f82 100644 --- a/qcsrc/server/t_teleporters.qc +++ b/qcsrc/server/t_teleporters.qc @@ -25,7 +25,7 @@ void trigger_teleport_use() if(head != player) \ if(head.takedamage) \ if(boxesoverlap(deathmin, deathmax, head.absmin, head.absmax)) - + float check_tdeath(entity player, vector org, vector telefragmin, vector telefragmax) { @@ -153,14 +153,14 @@ entity Simple_TeleportPlayer(entity teleporter, entity player) vector locout; entity e; float p; - + // Find the output teleporter if(teleporter.enemy) { e = teleporter.enemy; } else - { + { RandomSelection_Init(); for(e = world; (e = find(e, targetname, teleporter.target)); ) { @@ -177,13 +177,13 @@ entity Simple_TeleportPlayer(entity teleporter, entity player) } if(!e) { sprint(player, "Teleport destination vanished. Sorry... please complain to the mapper.\n"); } - + makevectors(e.mangle); if(e.speed) if(vlen(player.velocity) > e.speed) player.velocity = normalize(player.velocity) * max(0, e.speed); - + if(autocvar_g_teleport_maxspeed) if(vlen(player.velocity) > autocvar_g_teleport_maxspeed) player.velocity = normalize(player.velocity) * max(0, autocvar_g_teleport_maxspeed); @@ -201,17 +201,17 @@ void Teleport_Touch (void) if (self.active != ACTIVE_ACTIVE) return; - + if (!other.teleportable) return; - + if(other.vehicle) if(!other.vehicle.teleportable) return; - + if(other.turrcaps_flags & TFL_TURRCAPS_ISTURRET) return; - + if(other.deadflag != DEAD_NO) return; @@ -223,7 +223,7 @@ void Teleport_Touch (void) if(IS_PLAYER(other)) RemoveGrapplingHook(other); - + entity e; e = Simple_TeleportPlayer(self, other); @@ -310,16 +310,16 @@ entity Teleport_Find(vector mi, vector ma) return world; } -entity teleport_first; +entity teleport_first; .entity teleport_next; void spawnfunc_trigger_teleport (void) { self.angles = '0 0 0'; EXACTTRIGGER_INIT; - - self.active = ACTIVE_ACTIVE; - + + self.active = ACTIVE_ACTIVE; + self.use = trigger_teleport_use; // this must be called to spawn the teleport waypoints for bots @@ -330,7 +330,7 @@ void spawnfunc_trigger_teleport (void) objerror ("Teleporter with no target"); return; } - + self.teleport_next = teleport_first; teleport_first = self; } diff --git a/qcsrc/server/target_spawn.qc b/qcsrc/server/target_spawn.qc index ebb89aa5c..4da6b13bb 100644 --- a/qcsrc/server/target_spawn.qc +++ b/qcsrc/server/target_spawn.qc @@ -256,7 +256,7 @@ float target_spawn_cancreate() ++c; // increase count to not include MYSELF for(e = world; (e = findfloat(e, target_spawn_id, self.target_spawn_id)); --c) ; - + // if c now is 0, we have AT LEAST the given count (maybe more), so don't spawn any more if(c == 0) return 0; diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index 3e1ce9588..2914744c0 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -192,7 +192,7 @@ void InitGameplayMode() have_team_spawns = -1; // request team spawns MUTATOR_ADD(gamemode_nexball); } - + if(g_keepaway) { MUTATOR_ADD(gamemode_keepaway); @@ -600,7 +600,7 @@ float TeamSmallerEqThanTeam(float ta, float tb, entity e) cb -= cbb * 0.999; } } - + // keep teams alive (teams of size 0 always count as smaller, ignoring score) if(ca < 1) if(cb >= 1) @@ -671,7 +671,7 @@ float FindSmallestTeam(entity pl, float ignore_pl) GetTeamCounts(world); RandomSelection_Init(); - + t = 1; if(TeamSmallerEqThanTeam(2, t, pl)) t = 2; diff --git a/qcsrc/server/tturrets/system/system_aimprocs.qc b/qcsrc/server/tturrets/system/system_aimprocs.qc index 6e283f415..c3dbe55a4 100644 --- a/qcsrc/server/tturrets/system/system_aimprocs.qc +++ b/qcsrc/server/tturrets/system/system_aimprocs.qc @@ -25,7 +25,7 @@ vector turret_stdproc_aim_generic() // Lead? if (self.aim_flags & TFL_AIM_LEAD) - { + { if (self.aim_flags & TFL_AIM_SHOTTIMECOMPENSATE) // Need to conpensate for shot traveltime { // FIXME: this cant be the best way to do this.. @@ -60,7 +60,7 @@ vector turret_stdproc_aim_generic() else pre_pos = pre_pos + self.enemy.velocity * mintime; } - + if(self.aim_flags & TFL_AIM_GROUNDGROUND) { //tracebox(pre_pos + '0 0 32',self.enemy.mins,self.enemy.maxs,pre_pos -'0 0 64',MOVE_WORLDONLY,self.enemy); diff --git a/qcsrc/server/tturrets/system/system_damage.qc b/qcsrc/server/tturrets/system/system_damage.qc index c75abd8b2..a8feaebc3 100644 --- a/qcsrc/server/tturrets/system/system_damage.qc +++ b/qcsrc/server/tturrets/system/system_damage.qc @@ -40,7 +40,7 @@ void turret_stdproc_die() self.SendFlags |= TNSF_STATUS; self.nextthink = time + 0.2; self.think = turret_hide; - + if (self.turret_diehook) self.turret_diehook(); } @@ -56,7 +56,7 @@ void turret_stdproc_respawn() self.deadflag = DEAD_NO; self.effects = EF_LOWPRECISION; self.solid = SOLID_BBOX; - + self.takedamage = DAMAGE_AIM; self.event_damage = turret_stdproc_damage; @@ -71,7 +71,7 @@ void turret_stdproc_respawn() self.nextthink = time + self.ticrate; self.think = turret_think; - + self.SendFlags = TNSF_FULL_UPDATE; if (self.turret_respawnhook) @@ -111,13 +111,13 @@ void turret_stdproc_damage (entity inflictor, entity attacker, float damage, flo { self.tur_head.angles_x = self.tur_head.angles_x + (-0.5 + random()) * damage; self.tur_head.angles_y = self.tur_head.angles_y + (-0.5 + random()) * damage; - + self.SendFlags |= TNSF_ANG; } if (self.turrcaps_flags & TFL_TURRCAPS_MOVE) self.velocity = self.velocity + vforce; - + if (self.health <= 0) { self.event_damage = func_null; @@ -126,6 +126,6 @@ void turret_stdproc_damage (entity inflictor, entity attacker, float damage, flo self.nextthink = time; self.think = turret_stdproc_die; } - + self.SendFlags |= TNSF_STATUS; } diff --git a/qcsrc/server/tturrets/system/system_main.qc b/qcsrc/server/tturrets/system/system_main.qc index 17343f417..b4ad709b4 100644 --- a/qcsrc/server/tturrets/system/system_main.qc +++ b/qcsrc/server/tturrets/system/system_main.qc @@ -1,49 +1,49 @@ #define cvar_base "g_turrets_unit_" .float clientframe; void turrets_setframe(float _frame, float client_only) -{ +{ if((client_only ? self.clientframe : self.frame ) != _frame) { self.SendFlags |= TNSF_ANIM; self.anim_start_time = time; } - + if(client_only) self.clientframe = _frame; else self.frame = _frame; - + } float turret_send(entity to, float sf) { - - WriteByte(MSG_ENTITY, ENT_CLIENT_TURRET); + + WriteByte(MSG_ENTITY, ENT_CLIENT_TURRET); WriteByte(MSG_ENTITY, sf); if(sf & TNSF_SETUP) { WriteByte(MSG_ENTITY, self.turret_type); - + 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); } - + if(sf & TNSF_ANG) { 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)); } - + if(sf & TNSF_MOVE) { WriteShort(MSG_ENTITY, rint(self.origin_x)); @@ -52,27 +52,27 @@ float turret_send(entity to, float sf) 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.velocity_z)); + + WriteShort(MSG_ENTITY, rint(self.angles_y)); } - + if(sf & TNSF_ANIM) { WriteCoord(MSG_ENTITY, self.anim_start_time); WriteByte(MSG_ENTITY, self.frame); } - + if(sf & TNSF_STATUS) { WriteByte(MSG_ENTITY, self.team); - + if(self.health <= 0) WriteByte(MSG_ENTITY, 0); else WriteByte(MSG_ENTITY, ceil((self.health / self.tur_health) * 255)); } - + return TRUE; } @@ -143,9 +143,9 @@ void load_unit_settings(entity ent, string unitname, float is_reload) void turret_projectile_explode() { - + self.takedamage = DAMAGE_NO; - self.event_damage = func_null; + self.event_damage = func_null; #ifdef TURRET_DEBUG float d; d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, self, self.owner.shot_force, self.totalfrags, world); @@ -183,12 +183,12 @@ entity turret_projectile(string _snd, float _size, float _health, float _death, proj.owner = self; proj.realowner = self; proj.bot_dodge = TRUE; - proj.bot_dodgerating = self.shot_dmg; + proj.bot_dodgerating = self.shot_dmg; proj.think = turret_projectile_explode; proj.touch = turret_projectile_touch; - proj.nextthink = time + 9; + proj.nextthink = time + 9; proj.movetype = MOVETYPE_FLYMISSILE; - proj.velocity = normalize(self.tur_shotdir_updated + randomvec() * self.shot_spread) * self.shot_speed; + proj.velocity = normalize(self.tur_shotdir_updated + randomvec() * self.shot_spread) * self.shot_speed; proj.flags = FL_PROJECTILE; proj.enemy = self.enemy; proj.totalfrags = _death; @@ -203,7 +203,7 @@ entity turret_projectile(string _snd, float _size, float _health, float _death, proj.flags |= FL_NOTARGET; CSQCProjectile(proj, _cli_anim, _proj_type, _cull); - + return proj; } @@ -241,8 +241,8 @@ void turret_do_updates(entity t_turret) } else*/ tracebox(self.tur_shotorg, '-1 -1 -1','1 1 1', self.tur_shotorg + (self.tur_shotdir_updated * self.tur_dist_aimpos), MOVE_NORMAL,self); - - self.tur_dist_impact_to_aimpos = vlen(trace_endpos - self.tur_aimpos) - (vlen(self.enemy.maxs - self.enemy.mins) * 0.5); + + self.tur_dist_impact_to_aimpos = vlen(trace_endpos - self.tur_aimpos) - (vlen(self.enemy.maxs - self.enemy.mins) * 0.5); self.tur_impactent = trace_ent; self.tur_impacttime = vlen(self.tur_shotorg - trace_endpos) / self.shot_speed; @@ -328,7 +328,7 @@ void turret_stdproc_track() vector v1, v2; v1 = self.tur_head.angles; v2 = self.tur_head.avelocity; - + if (self.track_flags == TFL_TRACK_NO) return; @@ -343,17 +343,17 @@ void turret_stdproc_track() } else { - target_angle = vectoangles(normalize(self.tur_aimpos - self.tur_shotorg)); + 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); // Find the diffrence between where we currently aim and where we want to aim //move_angle = target_angle - (self.angles + self.tur_head.angles); //move_angle = shortangle_vxy(move_angle,(self.angles + self.tur_head.angles)); - - move_angle = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(self.angles), AnglesTransform_FromAngles(target_angle))) - self.tur_head.angles; + + move_angle = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(self.angles), AnglesTransform_FromAngles(target_angle))) - self.tur_head.angles; move_angle = shortangle_vxy(move_angle, self.tur_head.angles); switch(self.track_type) @@ -379,10 +379,10 @@ void turret_stdproc_track() if(self.tur_head.angles_y < -self.aim_maxrot) self.tur_head.angles_y = self.aim_maxrot; } - + // CSQC self.SendFlags |= TNSF_ANG; - + return; case TFL_TRACKTYPE_FLUIDINERTIA: @@ -408,15 +408,15 @@ void turret_stdproc_track() { self.tur_head.avelocity_x = 0; self.tur_head.angles_x = self.aim_maxpitch; - + self.SendFlags |= TNSF_ANG; } - + 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; - + self.SendFlags |= TNSF_ANG; } } @@ -430,7 +430,7 @@ void turret_stdproc_track() { self.tur_head.avelocity_y = 0; self.tur_head.angles_y = self.aim_maxrot; - + self.SendFlags |= TNSF_ANG; } @@ -438,20 +438,20 @@ void turret_stdproc_track() { self.tur_head.avelocity_y = 0; self.tur_head.angles_y = -self.aim_maxrot; - + self.SendFlags |= TNSF_ANG; } } - + self.SendFlags |= TNSF_AVEL; - + // Force a angle update every 10'th frame self.turret_framecounter += 1; if(self.turret_framecounter >= 10) - { + { self.SendFlags |= TNSF_ANG; self.turret_framecounter = 0; - } + } } @@ -480,7 +480,7 @@ void turret_stdproc_track() float turret_stdproc_firecheck() { // This one just dont care =) - if (self.firecheck_flags & TFL_FIRECHECK_NO) + if (self.firecheck_flags & TFL_FIRECHECK_NO) return 1; if (self.enemy == world) @@ -494,7 +494,7 @@ float turret_stdproc_firecheck() if (self.shoot_flags & TFL_SHOOT_VOLLYALWAYS) if (self.volly_counter != self.shot_volly) if(self.ammo >= self.shot_dmg) - return 1; + return 1; // Lack of zombies makes shooting dead things unnecessary :P if (self.firecheck_flags & TFL_FIRECHECK_DEAD) @@ -510,22 +510,22 @@ float turret_stdproc_firecheck() if (self.firecheck_flags & TFL_FIRECHECK_OTHER_AMMO) if (self.enemy.ammo >= self.enemy.ammo_max) return 0; - + // Target of opertunity? if(turret_validate_target(self, self.tur_impactent, self.target_validate_flags) > 0) { self.enemy = self.tur_impactent; return 1; - } + } if (self.firecheck_flags & TFL_FIRECHECK_DISTANCES) { // To close? if (self.tur_dist_aimpos < self.target_range_min) - if(turret_validate_target(self, self.tur_impactent, self.target_validate_flags) > 0) + if(turret_validate_target(self, self.tur_impactent, self.target_validate_flags) > 0) return 1; // Target of opertunity? - else - return 0; + else + return 0; } // Try to avoid FF? @@ -571,7 +571,7 @@ float turret_stdproc_firecheck() float turret_validate_target(entity e_turret, entity e_target, float validate_flags) { vector v_tmp; - + //if(!validate_flags & TFL_TARGETSELECT_NOBUILTIN) // return -0.5; @@ -579,7 +579,7 @@ float turret_validate_target(entity e_turret, entity e_target, float validate_fl return -0.5; if (!checkpvs(e_target.origin, e_turret)) - return -1; + return -1; if (!e_target) return -2; @@ -596,7 +596,7 @@ float turret_validate_target(entity e_turret, entity e_target, float validate_fl return -5; // Cant touch this - if(e_target.vehicle_flags & VHF_ISVEHICLE) + if(e_target.vehicle_flags & VHF_ISVEHICLE) { if (e_target.vehicle_health <= 0) return -6; @@ -729,7 +729,7 @@ entity turret_select_target() e = findradius(self.origin, self.target_range); // Nothing to aim at? - if (!e) + if (!e) return world; while (e) @@ -759,7 +759,7 @@ void turret_think() entity e; self.nextthink = time + self.ticrate; - + // ONS uses somewhat backwards linking. if (teamplay) { @@ -788,7 +788,7 @@ void turret_think() if (!(self.spawnflags & TSF_NO_AMMO_REGEN)) if (self.ammo < self.ammo_max) self.ammo = min(self.ammo + self.ammo_recharge, self.ammo_max); - + // Inactive turrets needs to run the think loop, // So they can handle animation and wake up if need be. if (!self.active) @@ -1021,14 +1021,14 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa // Are turrets allowed? if (autocvar_g_turrets == 0) return 0; - + if(_turret_type < 1 || _turret_type > TID_LAST) { dprint("Invalid / Unkown turret type\"", ftos(_turret_type), "\", aborting!\n"); return 0; - } + } self.turret_type = _turret_type; - + e = find(world, classname, "turret_manager"); if (!e) { @@ -1037,7 +1037,7 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa e.think = turrets_manager_think; e.nextthink = time + 2; } - + if (!(self.spawnflags & TSF_SUSPENDED)) builtin_droptofloor(); // why can't we use regular droptofloor here? @@ -1058,7 +1058,7 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa load_unit_settings(self, self.cvar_basename, 0); self.effects = EF_NODRAW; - + // Handle turret teams. if (!teamplay) self.team = MAX_SHOT_DISTANCE; // Group all turrets into the same team, so they dont kill eachother. @@ -1082,13 +1082,13 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa * as possible beforehand. */ if (!self.ticrate) - { + { if (self.turrcaps_flags & TFL_TURRCAPS_SUPPORT) self.ticrate = 0.2; // Support units generaly dont need to have a high speed ai-loop else self.ticrate = 0.1; // 10 fps for normal turrets } - + self.ticrate = bound(sys_frametime, self.ticrate, 60); // keep it sane // General stuff @@ -1272,7 +1272,7 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa // Offsets & origins if (!self.tur_shotorg) self.tur_shotorg = '50 0 50'; - + if (!self.health) self.health = 150; @@ -1327,7 +1327,7 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa self.turret_firecheckfunc = turret_stdproc_firecheck; self.turret_firefunc = turret_stdproc_fire; self.event_damage = turret_stdproc_damage; - + if (self.turrcaps_flags & TFL_TURRCAPS_SUPPORT) self.turret_score_target = turret_stdproc_targetscore_support; else @@ -1366,11 +1366,11 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa activator = ee; self.use(); } - + turret_link(); - turret_stdproc_respawn(); + turret_stdproc_respawn(); turret_tag_fire_update(); - + return 1; } diff --git a/qcsrc/server/tturrets/system/system_misc.qc b/qcsrc/server/tturrets/system/system_misc.qc index 2e3a00688..3fdd5eb1e 100644 --- a/qcsrc/server/tturrets/system/system_misc.qc +++ b/qcsrc/server/tturrets/system/system_misc.qc @@ -4,12 +4,12 @@ float anglemods(float v) { v = v - 360 * floor(v / 360); - + if(v >= 180) return v - 360; else if(v <= -180) return v + 360; - else + else return v; } @@ -78,7 +78,7 @@ vector real_origin(entity ent) vector angleofs(entity from, entity to) { vector v_res; - + v_res = normalize(to.origin - from.origin); v_res = vectoangles(v_res); v_res = v_res - from.angles; @@ -95,7 +95,7 @@ vector angleofs(entity from, entity to) vector angleofs3(vector from, vector from_a, entity to) { vector v_res; - + v_res = normalize(to.origin - from); v_res = vectoangles(v_res); v_res = v_res - from_a; @@ -130,7 +130,7 @@ float turret_tag_fire_update_s() } /* -* Railgun-like beam, but has thickness and suppots slowing of target +* Railgun-like beam, but has thickness and suppots slowing of target */ void FireImoBeam (vector start, vector end, vector smin, vector smax, float bforce, float f_dmg, float f_velfactor, float deathtype) @@ -352,4 +352,4 @@ void paint_target3(vector where, float f_size, vector v_color, float f_time) e.colormod = v_color; SUB_SetFade(e,time,f_time); } -#endif +#endif diff --git a/qcsrc/server/tturrets/units/unit_checkpoint.qc b/qcsrc/server/tturrets/units/unit_checkpoint.qc index 481b4a285..c919601a3 100644 --- a/qcsrc/server/tturrets/units/unit_checkpoint.qc +++ b/qcsrc/server/tturrets/units/unit_checkpoint.qc @@ -38,7 +38,7 @@ void turret_checkpoint_think() { if(self.enemy) te_lightning1(self,self.origin, self.enemy.origin); - + self.nextthink = time + 0.25; } #endif @@ -72,7 +72,7 @@ void spawnfunc_turret_checkpoint() { setorigin(self,self.origin); self.think = turret_checkpoint_init; - self.nextthink = time + 0.2; + self.nextthink = time + 0.2; } // Compat. diff --git a/qcsrc/server/tturrets/units/unit_ewheel.qc b/qcsrc/server/tturrets/units/unit_ewheel.qc index 31b984e39..b98388984 100644 --- a/qcsrc/server/tturrets/units/unit_ewheel.qc +++ b/qcsrc/server/tturrets/units/unit_ewheel.qc @@ -8,12 +8,12 @@ void ewheel_attack() { float i; entity _mis; - + for (i = 0; i < 1; ++i) { turret_do_updates(self); - _mis = turret_projectile("weapons/lasergun_fire.wav", 1, 0, DEATH_TURRET_EWHEEL, PROJECTILE_LASER, TRUE, TRUE); + _mis = turret_projectile("weapons/lasergun_fire.wav", 1, 0, DEATH_TURRET_EWHEEL, PROJECTILE_LASER, TRUE, TRUE); _mis.missile_flags = MIF_SPLASH; pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); @@ -55,7 +55,7 @@ void ewheel_move_path() self.pathcurrent = self.pathcurrent.path_next; #else - if (vlen(self.origin - self.pathcurrent.origin) < 64) + if (vlen(self.origin - self.pathcurrent.origin) < 64) self.pathcurrent = self.pathcurrent.enemy; #endif @@ -73,7 +73,7 @@ void ewheel_move_enemy() { float newframe; - + self.steerto = steerlib_arrive(self.enemy.origin,self.target_range_optimal); //self.steerto = steerlib_standoff(self.enemy.origin,self.target_range_optimal); @@ -109,9 +109,9 @@ void ewheel_move_enemy() newframe = ewheel_amin_stop; movelib_beak_simple(autocvar_g_turrets_unit_ewheel_speed_stop); } - + turrets_setframe(newframe , FALSE); - + /*if(self.frame != newframe) { self.frame = newframe; @@ -164,7 +164,7 @@ void ewheel_postthink() self.velocity_z = vz; - + if(vlen(self.velocity)) self.SendFlags |= TNSF_MOVE; } @@ -176,7 +176,7 @@ void ewheel_respawnhook() // Respawn is called & first spawn to, to set team. need to make sure we do not move the initial spawn. if(self.movetype != MOVETYPE_WALK) return; - + self.velocity = '0 0 0'; self.enemy = world; @@ -221,7 +221,7 @@ void turret_ewheel_dinit() { entity e; - if (self.netname == "") + if (self.netname == "") self.netname = "eWheel Turret"; if (self.target != "") @@ -250,7 +250,7 @@ void turret_ewheel_dinit() remove(self); return; } - + self.frame = 1; self.target_select_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS; self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS; diff --git a/qcsrc/server/tturrets/units/unit_flac.qc b/qcsrc/server/tturrets/units/unit_flac.qc index 7c21ba7ab..8a01a9752 100644 --- a/qcsrc/server/tturrets/units/unit_flac.qc +++ b/qcsrc/server/tturrets/units/unit_flac.qc @@ -7,7 +7,7 @@ void turret_flac_projectile_think_explode() if(self.enemy != world) if(vlen(self.origin - self.enemy.origin) < self.owner.shot_radius * 3) setorigin(self,self.enemy.origin + randomvec() * self.owner.shot_radius); - + #ifdef TURRET_DEBUG float d; d = RadiusDamage (self, self.owner, self.owner.shot_dmg, self.owner.shot_dmg, self.owner.shot_radius, self, self.owner.shot_force, self.totalfrags, world); @@ -24,28 +24,28 @@ void turret_flac_attack() entity proj; turret_tag_fire_update(); - - proj = turret_projectile("weapons/hagar_fire.wav", 5, 0, DEATH_TURRET_FLAC, PROJECTILE_HAGAR, TRUE, TRUE); + + proj = turret_projectile("weapons/hagar_fire.wav", 5, 0, DEATH_TURRET_FLAC, PROJECTILE_HAGAR, TRUE, TRUE); pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); proj.think = turret_flac_projectile_think_explode; proj.nextthink = time + self.tur_impacttime + (random() * 0.01 - random() * 0.01); proj.missile_flags = MIF_SPLASH | MIF_PROXY; - + self.tur_head.frame = self.tur_head.frame + 1; - if (self.tur_head.frame >= 4) + if (self.tur_head.frame >= 4) self.tur_head.frame = 0; } void turret_flac_dinit() { - if (self.netname == "") + if (self.netname == "") self.netname = "FLAC Cannon"; self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_FASTPROJ | TFL_TURRCAPS_MISSILEKILL; self.ammo_flags = TFL_AMMO_ROCKETS | TFL_AMMO_RECHARGE; self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE; - + if (turret_stdproc_init("flac_std", "models/turrets/base.md3", "models/turrets/flac.md3", TID_FLAC) == 0) { remove(self); @@ -55,7 +55,7 @@ void turret_flac_dinit() self.damage_flags |= TFL_DMG_HEADSHAKE; self.target_select_flags |= TFL_TARGETSELECT_NOTURRETS | TFL_TARGETSELECT_MISSILESONLY; - + // Our fire routine self.turret_firefunc = turret_flac_attack; diff --git a/qcsrc/server/tturrets/units/unit_fusionreactor.qc b/qcsrc/server/tturrets/units/unit_fusionreactor.qc index 2833ab3f0..014fa25f6 100644 --- a/qcsrc/server/tturrets/units/unit_fusionreactor.qc +++ b/qcsrc/server/tturrets/units/unit_fusionreactor.qc @@ -28,7 +28,7 @@ void turret_fusionreactor_respawnhook() **/ float turret_fusionreactor_firecheck() { - if (self.attack_finished_single > time) + if (self.attack_finished_single > time) return 0; if (self.enemy.deadflag != DEAD_NO) @@ -42,16 +42,16 @@ float turret_fusionreactor_firecheck() if (self.enemy.ammo >= self.enemy.ammo_max) return 0; - + if (vlen(self.enemy.origin - self.origin) > self.target_range) - return 0; - + return 0; + if(self.team != self.enemy.team) return 0; - + if (!(self.enemy.ammo_flags & TFL_AMMO_ENERGY)) - return 0; - + return 0; + return 1; } diff --git a/qcsrc/server/tturrets/units/unit_hellion.qc b/qcsrc/server/tturrets/units/unit_hellion.qc index 75360bcd7..e1b88b06a 100644 --- a/qcsrc/server/tturrets/units/unit_hellion.qc +++ b/qcsrc/server/tturrets/units/unit_hellion.qc @@ -66,12 +66,12 @@ void turret_hellion_missile_think() void turret_hellion_attack() { entity missile; - + if(self.tur_head.frame != 0) self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire")); else self.tur_shotorg = gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_fire2")); - + missile = turret_projectile("weapons/rocket_fire.wav", 6, 10, DEATH_TURRET_HELLION, PROJECTILE_ROCKET, FALSE, FALSE); te_explosion (missile.origin); missile.think = turret_hellion_missile_think; diff --git a/qcsrc/server/tturrets/units/unit_hk.qc b/qcsrc/server/tturrets/units/unit_hk.qc index c7d7396e8..6ce6c72e2 100644 --- a/qcsrc/server/tturrets/units/unit_hk.qc +++ b/qcsrc/server/tturrets/units/unit_hk.qc @@ -258,7 +258,7 @@ void turret_hk_attack() missile.cnt = time + 30; missile.ticrate = max(autocvar_sys_ticrate, 0.05); missile.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_AI; - + if (self.tur_head.frame == 0) self.tur_head.frame = self.tur_head.frame + 1; @@ -289,7 +289,7 @@ float turret_hk_addtarget(entity e_target,entity e_sender) void turret_hk_dinit() { - if (self.netname == "") + if (self.netname == "") self.netname = "Hunter-killer turret"; self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_RECIVETARGETS; diff --git a/qcsrc/server/tturrets/units/unit_machinegun.qc b/qcsrc/server/tturrets/units/unit_machinegun.qc index 62abe38aa..10d186193 100644 --- a/qcsrc/server/tturrets/units/unit_machinegun.qc +++ b/qcsrc/server/tturrets/units/unit_machinegun.qc @@ -20,7 +20,7 @@ void turret_machinegun_std_init() self.ammo_flags = TFL_AMMO_BULLETS | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE; self.turrcaps_flags = TFL_TURRCAPS_PLAYERKILL; self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE; - + if (!autocvar_g_antilag_bullets) self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN; diff --git a/qcsrc/server/tturrets/units/unit_mlrs.qc b/qcsrc/server/tturrets/units/unit_mlrs.qc index a12d9d725..783966032 100644 --- a/qcsrc/server/tturrets/units/unit_mlrs.qc +++ b/qcsrc/server/tturrets/units/unit_mlrs.qc @@ -16,12 +16,12 @@ void turret_mlrs_postthink() void turret_mlrs_attack() { entity missile; - - turret_tag_fire_update(); + + turret_tag_fire_update(); missile = turret_projectile("weapons/rocket_fire.wav", 6, 10, DEATH_TURRET_MLRS, PROJECTILE_ROCKET, TRUE, TRUE); missile.nextthink = time + max(self.tur_impacttime,(self.shot_radius * 2) / self.shot_speed); missile.missile_flags = MIF_SPLASH; - te_explosion (missile.origin); + te_explosion (missile.origin); } void turret_mlrs_dinit() diff --git a/qcsrc/server/tturrets/units/unit_plasma.qc b/qcsrc/server/tturrets/units/unit_plasma.qc index f4a60e545..9fce826a2 100644 --- a/qcsrc/server/tturrets/units/unit_plasma.qc +++ b/qcsrc/server/tturrets/units/unit_plasma.qc @@ -29,7 +29,7 @@ void turret_plasma_minsta_attack (void) { float flying; flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last - + FireRailgunBullet (self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000, 800, 0, 0, 0, 0, DEATH_TURRET_PLASMA); @@ -64,10 +64,10 @@ void turret_plasma_minsta_attack (void) } void turret_plasma_attack() -{ - entity missile = turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE); +{ + entity missile = turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE); missile.missile_flags = MIF_SPLASH; - + pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); if (self.tur_head.frame == 0) self.tur_head.frame = 1; @@ -75,8 +75,8 @@ void turret_plasma_attack() void turret_plasma_dual_attack() { - entity missile = turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE); - missile.missile_flags = MIF_SPLASH; + entity missile = turret_projectile("weapons/hagar_fire.wav", 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE); + missile.missile_flags = MIF_SPLASH; pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); self.tur_head.frame += 1; } diff --git a/qcsrc/server/tturrets/units/unit_tessla.qc b/qcsrc/server/tturrets/units/unit_tessla.qc index b4c220851..4989b2445 100644 --- a/qcsrc/server/tturrets/units/unit_tessla.qc +++ b/qcsrc/server/tturrets/units/unit_tessla.qc @@ -35,7 +35,7 @@ entity toast(entity from, float range, float damage) } if (etarget) - { + { te_csqc_lightningarc(from.origin,etarget.origin); Damage(etarget, self, self, damage, DEATH_TURRET_TESLA, etarget.origin, '0 0 0'); etarget.railgunhit = 1; @@ -48,7 +48,7 @@ float turret_tesla_firecheck() { // g_turrets_targetscan_maxdelay forces a target re-scan at least this often float do_target_scan = 0; - + if((self.target_select_time + autocvar_g_turrets_targetscan_maxdelay) < time) do_target_scan = 1; diff --git a/qcsrc/server/tturrets/units/unit_walker.qc b/qcsrc/server/tturrets/units/unit_walker.qc index 5e0feea35..615622e3b 100644 --- a/qcsrc/server/tturrets/units/unit_walker.qc +++ b/qcsrc/server/tturrets/units/unit_walker.qc @@ -29,12 +29,12 @@ void walker_meele_do_dmg() { vector where; entity e; - + makevectors(self.angles); where = self.origin + v_forward * 128; e = findradius(where,32); - while (e) + while (e) { if (turret_validate_target(self, e, self.target_validate_flags)) if (e != self && e.owner != self) @@ -59,7 +59,7 @@ void walker_rocket_damage (entity inflictor, entity attacker, float damage, floa { self.health = self.health - damage; self.velocity = self.velocity + vforce; - + if (self.health <= 0) W_PrepareExplosionByDamage(self.owner, walker_rocket_explode); } @@ -178,7 +178,7 @@ void walker_rocket_loop() void walker_fire_rocket(vector org) { entity rocket; - + fixedmakevectors(self.angles); te_explosion (org); @@ -199,7 +199,7 @@ void walker_fire_rocket(vector org) rocket.tur_shotorg = randomvec() * 512; rocket.cnt = time + 1; rocket.enemy = self.enemy; - + if (random() < 0.01) rocket.think = walker_rocket_loop; else @@ -216,7 +216,7 @@ void walker_fire_rocket(vector org) rocket.solid = SOLID_BBOX; rocket.tur_health = time + 9; rocket.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT; - + CSQCProjectile(rocket, FALSE, PROJECTILE_ROCKET, FALSE); // no culling, has fly sound } @@ -248,7 +248,7 @@ void walker_move_to(vector _target, float _dist) if(self.enemy) { self.enemy_last_loc = _target; - self.enemy_last_time = time; + self.enemy_last_time = time; } } @@ -287,12 +287,12 @@ void walker_move_path() walker_move_to(self.moveto, 0); #else - if (vlen(self.origin - self.pathcurrent.origin) < 64) + if (vlen(self.origin - self.pathcurrent.origin) < 64) self.pathcurrent = self.pathcurrent.enemy; - + if(!self.pathcurrent) return; - + self.moveto = self.pathcurrent.origin; self.steerto = steerlib_attract2(self.moveto, 0.5, 500, 0.95); walker_move_to(self.moveto, 0); @@ -316,35 +316,35 @@ void walker_postthink() { if(vlen(self.origin - self.enemy_last_loc) < 128 || time - self.enemy_last_time > 10) self.enemy_last_time = 0; - else + else walker_move_to(self.enemy_last_loc, 0); } else - { + { if(self.animflag != ANIM_NO) - { + { traceline(self.origin + '0 0 64', self.origin + '0 0 64' + v_forward * 128, MOVE_NORMAL, self); - + if(trace_fraction != 1.0) self.tur_head.idletime = -1337; else { - traceline(trace_endpos, trace_endpos - '0 0 256', MOVE_NORMAL, self); + traceline(trace_endpos, trace_endpos - '0 0 256', MOVE_NORMAL, self); if(trace_fraction == 1.0) self.tur_head.idletime = -1337; } - + if(self.tur_head.idletime == -1337) { - self.moveto = self.origin + randomvec() * 256; + self.moveto = self.origin + randomvec() * 256; self.tur_head.idletime = 0; } self.moveto = self.moveto * 0.9 + ((self.origin + v_forward * 500) + randomvec() * 400) * 0.1; - self.moveto_z = self.origin_z + 64; + self.moveto_z = self.origin_z + 64; walker_move_to(self.moveto, 0); - } - + } + if(self.idletime < time) { if(random() < 0.5 || !(self.spawnflags & TSL_ROAM)) @@ -357,12 +357,12 @@ void walker_postthink() { self.animflag = ANIM_WALK; self.idletime = time + 4 + random() * 2; - self.moveto = self.origin + randomvec() * 256; + self.moveto = self.origin + randomvec() * 256; self.tur_head.moveto = self.moveto; self.tur_head.idletime = 0; } } - } + } } } else @@ -370,8 +370,8 @@ void walker_postthink() if (self.tur_dist_enemy < autocvar_g_turrets_unit_walker_std_meele_range && self.animflag != ANIM_MEELE) { vector wish_angle; - - wish_angle = angleofs(self, self.enemy); + + wish_angle = angleofs(self, self.enemy); if (self.animflag != ANIM_SWIM) if (fabs(wish_angle_y) < 15) { @@ -381,17 +381,17 @@ void walker_postthink() } } else if (self.tur_head.attack_finished_single < time) - { + { if(self.tur_head.shot_volly) { self.animflag = ANIM_NO; - + self.tur_head.shot_volly = self.tur_head.shot_volly -1; if(self.tur_head.shot_volly == 0) self.tur_head.attack_finished_single = time + autocvar_g_turrets_unit_walker_std_rocket_refire; else self.tur_head.attack_finished_single = time + 0.2; - + if(self.tur_head.shot_volly > 1) walker_fire_rocket(gettaginfo(self, gettagindex(self, "tag_rocket01"))); else @@ -399,13 +399,13 @@ void walker_postthink() } else { - if (self.tur_dist_enemy > autocvar_g_turrets_unit_walker_std_rockets_range_min) + if (self.tur_dist_enemy > autocvar_g_turrets_unit_walker_std_rockets_range_min) if (self.tur_dist_enemy < autocvar_g_turrets_unit_walker_std_rockets_range) self.tur_head.shot_volly = 4; } } else - { + { if (self.animflag != ANIM_MEELE) walker_move_to(self.enemy.origin, self.tur_dist_enemy); } @@ -419,7 +419,7 @@ void walker_postthink() real_angle = vectoangles(self.steerto) - self.angles; vz = self.velocity_z; - + switch (self.animflag) { case ANIM_NO: @@ -461,7 +461,7 @@ void walker_postthink() case ANIM_PAIN: if(self.frame != ANIM_PAIN) defer(0.25, walker_setnoanim); - + break; case ANIM_MEELE: @@ -477,7 +477,7 @@ void walker_postthink() case ANIM_SWIM: turny = autocvar_g_turrets_unit_walker_turn_swim; turnx = autocvar_g_turrets_unit_walker_turn_swim; - + self.angles_x += bound(-10, shortangle_f(real_angle_x, self.angles_x), 10); movelib_move_simple(v_forward, autocvar_g_turrets_unit_walker_speed_swim, 0.3); vz = self.velocity_z + sin(time * 4) * 8; @@ -488,26 +488,26 @@ void walker_postthink() movelib_move_simple(v_forward ,autocvar_g_turrets_unit_walker_speed_roam, 0.5); break; } - + if(turny) - { + { turny = bound( turny * -1, shortangle_f(real_angle_y, self.angles_y), turny ); self.angles_y += turny; } if(turnx) - { + { turnx = bound( turnx * -1, shortangle_f(real_angle_x, self.angles_x), turnx ); self.angles_x += turnx; } - self.velocity_z = vz; + self.velocity_z = vz; } - + if(self.origin != self.oldorigin) self.SendFlags |= TNSF_MOVE; - + self.oldorigin = self.origin; turrets_setframe(self.animflag, FALSE); } @@ -528,10 +528,10 @@ void walker_respawnhook() // Respawn is called & first spawn to, to set team. need to make sure we do not move the initial spawn. if(self.movetype != MOVETYPE_WALK) return; - + setorigin(self, self.pos1); self.angles = self.pos2; - + if (self.target != "") { e = find(world, targetname, self.target); @@ -597,7 +597,7 @@ void turret_walker_dinit() self.damagedbycontents = TRUE; self.movetype = MOVETYPE_WALK; self.solid = SOLID_SLIDEBOX; - self.takedamage = DAMAGE_AIM; + self.takedamage = DAMAGE_AIM; setorigin(self, self.origin); tracebox(self.origin + '0 0 128', self.mins, self.maxs, self.origin - '0 0 10000', MOVE_NORMAL, self); setorigin(self, trace_endpos + '0 0 4'); diff --git a/qcsrc/server/vehicles/bumblebee.qc b/qcsrc/server/vehicles/bumblebee.qc index a0a7e5ffc..bc5f03d8a 100644 --- a/qcsrc/server/vehicles/bumblebee.qc +++ b/qcsrc/server/vehicles/bumblebee.qc @@ -97,12 +97,12 @@ float bumb_gunner_frame() self = vehic; - - + + vehic.solid = SOLID_NOT; //setorigin(gunner, vehic.origin); gunner.velocity = vehic.velocity; - + float _in, _out; vehic.angles_x *= -1; makevectors(vehic.angles); @@ -117,9 +117,9 @@ float bumb_gunner_frame() { _in = autocvar_g_vehicle_bumblebee_cannon_turnlimit_out; _out = autocvar_g_vehicle_bumblebee_cannon_turnlimit_in; - setorigin(gunner, vehic.origin + v_up * -16 + v_forward * -16 + v_right * -128); + setorigin(gunner, vehic.origin + v_up * -16 + v_forward * -16 + v_right * -128); } - + crosshair_trace(gunner); vector _ct = trace_endpos; vector ad; @@ -225,7 +225,7 @@ void bumb_gunner_exit(float _exitflag) WriteAngle(MSG_ONE, self.vehicle.angles_y); WriteAngle(MSG_ONE, 0); } - + CSQCVehicleSetup(self, HUD_NORMAL); setsize(self, PL_MIN, PL_MAX); @@ -252,16 +252,16 @@ void bumb_gunner_exit(float _exitflag) if(self == self.vehicle.owner.gunner1) { - self.vehicle.owner.gunner1 = world; + self.vehicle.owner.gunner1 = world; } else if(self == self.vehicle.owner.gunner2) { - self.vehicle.owner.gunner2 = world; + self.vehicle.owner.gunner2 = world; v_right *= -1; - } + } else dprint("^1self != gunner1 or gunner2, this is a BIG PROBLEM, tell tZork this happend.\n"); - + vector spot = self.vehicle.owner.origin + + v_up * 128 + v_right * 300; spot = vehicles_findgoodexit(spot); //setorigin(self , spot); @@ -327,7 +327,7 @@ float bumb_gunner_enter() _gun.vehicle_hudmodel.viewmodelforclient = other; CSQCVehicleSetup(other, other.hud); - + vh_player = other; vh_vehicle = _gun; MUTATOR_CALLHOOK(VehicleEnter); @@ -442,9 +442,9 @@ float bumb_pilot_frame() // Pitch ftmp = 0; - if(pilot.movement_x > 0 && vang_x < autocvar_g_vehicle_bumblebee_pitchlimit) + if(pilot.movement_x > 0 && vang_x < autocvar_g_vehicle_bumblebee_pitchlimit) ftmp = 4; - else if(pilot.movement_x < 0 && vang_x > -autocvar_g_vehicle_bumblebee_pitchlimit) + else if(pilot.movement_x < 0 && vang_x > -autocvar_g_vehicle_bumblebee_pitchlimit) ftmp = -8; newvel_x = bound(-autocvar_g_vehicle_bumblebee_pitchlimit, newvel_x , autocvar_g_vehicle_bumblebee_pitchlimit); @@ -490,10 +490,10 @@ float bumb_pilot_frame() vehic.velocity += newvel * frametime; pilot.velocity = pilot.movement = vehic.velocity; - + if(autocvar_g_vehicle_bumblebee_healgun_locktime) - { + { if(vehic.tur_head.lock_time < time || vehic.tur_head.enemy.deadflag) vehic.tur_head.enemy = world; @@ -511,19 +511,19 @@ float bumb_pilot_frame() } } else - { + { vehic.tur_head.enemy = trace_ent; vehic.tur_head.lock_time = time + autocvar_g_vehicle_bumblebee_healgun_locktime; } } - + if(vehic.tur_head.enemy) { - trace_endpos = real_origin(vehic.tur_head.enemy); - UpdateAuxiliaryXhair(pilot, trace_endpos, '0 0.75 0', 0); + trace_endpos = real_origin(vehic.tur_head.enemy); + UpdateAuxiliaryXhair(pilot, trace_endpos, '0 0.75 0', 0); } } - + vang = vehicle_aimturret(vehic, trace_endpos, self.gun3, "fire", autocvar_g_vehicle_bumblebee_raygun_pitchlimit_down * -1, autocvar_g_vehicle_bumblebee_raygun_pitchlimit_up, autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides * -1, autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides, autocvar_g_vehicle_bumblebee_raygun_turnspeed); @@ -532,12 +532,12 @@ float bumb_pilot_frame() { vehic.gun3.enemy.realowner = pilot; vehic.gun3.enemy.effects &= ~EF_NODRAW; - + vehic.gun3.enemy.hook_start = gettaginfo(vehic.gun3, gettagindex(vehic.gun3, "fire")); vehic.gun3.enemy.SendFlags |= BRG_START; - + traceline(vehic.gun3.enemy.hook_start, vehic.gun3.enemy.hook_start + v_forward * autocvar_g_vehicle_bumblebee_raygun_range, MOVE_NORMAL, vehic); - + if(trace_ent) { if(autocvar_g_vehicle_bumblebee_raygun) @@ -580,11 +580,11 @@ float bumb_pilot_frame() } } } - + vehic.gun3.enemy.hook_end = trace_endpos; setorigin(vehic.gun3.enemy, trace_endpos); vehic.gun3.enemy.SendFlags |= BRG_END; - + vehic.wait = time + 1; } else @@ -596,7 +596,7 @@ float bumb_pilot_frame() vehic.gun3.enemy = world; } */ - + VEHICLE_UPDATE_PLAYER(pilot, health, bumblebee); VEHICLE_UPDATE_PLAYER(pilot, energy, bumblebee); @@ -605,7 +605,7 @@ float bumb_pilot_frame() if(vehic.vehicle_flags & VHF_HASSHIELD) VEHICLE_UPDATE_PLAYER(pilot, shield, bumblebee); - + vehic.angles_x *= -1; makevectors(vehic.angles); vehic.angles_x *= -1; @@ -620,16 +620,16 @@ float bumb_pilot_frame() void bumb_think() { self.movetype = MOVETYPE_TOSS; - + //self.velocity = self.velocity * 0.5; self.angles_z *= 0.8; self.angles_x *= 0.8; - + self.nextthink = time + 0.05; - + if(!self.owner) { - entity oldself = self; + entity oldself = self; if(self.gunner1) { self = self.gunner1; @@ -642,7 +642,7 @@ void bumb_think() other = oldother; return; } - + if(self.gunner2) { self = self.gunner2; @@ -654,9 +654,9 @@ void bumb_think() self.touch(); other = oldother; return; - } + } } - + } void bumb_enter() @@ -672,19 +672,19 @@ void bumb_exit(float eject) self.touch = vehicles_touch; self.think = bumb_think; self.nextthink = time; - + if(!self.owner) return; - + fixedmakevectors(self.angles); vector spot; - if(vlen(self.velocity) > autocvar_g_vehicle_bumblebee_speed_forward * 0.5) + if(vlen(self.velocity) > autocvar_g_vehicle_bumblebee_speed_forward * 0.5) spot = self.origin + v_up * 128 + v_forward * 200; else spot = self.origin + v_up * 128 - v_forward * 200; - + spot = vehicles_findgoodexit(spot); - + // Hide beam if(self.gun3.enemy || !wasfreed(self.gun3.enemy)) { self.gun3.enemy.effects |= EF_NODRAW; @@ -693,7 +693,7 @@ void bumb_exit(float eject) self.owner.velocity = 0.75 * self.vehicle.velocity + normalize(spot - self.vehicle.origin) * 200; self.owner.velocity_z += 10; setorigin(self.owner, spot); - + antilag_clear(self.owner); self.owner = world; } @@ -708,10 +708,10 @@ void bumb_blowup() sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum("explosion_large"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1); - + if(self.owner.deadflag == DEAD_DYING) self.owner.deadflag = DEAD_DEAD; - + remove(self); } @@ -732,11 +732,11 @@ void bumb_diethink() void bumb_die() { entity oldself = self; - + // Hide beam if(self.gun3.enemy || !wasfreed(self.gun3.enemy)) self.gun3.enemy.effects |= EF_NODRAW; - + if(self.gunner1) { self = self.gunner1; @@ -764,15 +764,15 @@ void bumb_die() _body.touch = bumb_blowup; else _body.touch = func_null; - + _body.think = bumb_diethink; _body.nextthink = time; _body.wait = time + 2 + (random() * 8); _body.owner = self; _body.enemy = self.enemy; - + pointparticles(particleeffectnum("explosion_medium"), findbetterlocation(self.origin, 16), '0 0 0', 1); - + self.health = 0; self.event_damage = func_null; self.solid = SOLID_CORPSE; @@ -793,8 +793,8 @@ void bumb_die() void bumb_impact() { if(autocvar_g_vehicle_bumblebee_bouncepain_x) - vehilces_impact(autocvar_g_vehicle_bumblebee_bouncepain_x, - autocvar_g_vehicle_bumblebee_bouncepain_y, + vehilces_impact(autocvar_g_vehicle_bumblebee_bouncepain_x, + autocvar_g_vehicle_bumblebee_bouncepain_y, autocvar_g_vehicle_bumblebee_bouncepain_z); } @@ -861,14 +861,14 @@ void bumb_spawn(float _f) 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; } } @@ -880,7 +880,7 @@ void bumb_spawn(float _f) self.movetype = MOVETYPE_TOSS; self.vehicle_impact = bumb_impact; self.damageforcescale = 0.025; - + setorigin(self, self.origin + '0 0 25'); } @@ -971,7 +971,7 @@ void bumble_raygun_draw() _len = vlen(self.origin - self.move_origin); _dir = normalize(self.move_origin - self.origin); - + if(self.total_damages < time) { boxparticles(self.traileffect, self, self.origin, self.origin + _dir * -64, _dir * -_len , _dir * -_len, 1, PARTICLES_USEALPHA); @@ -1010,19 +1010,19 @@ void bumble_raygun_read(float bIsNew) self.cnt = ReadByte(); self.team = ReadByte(); self.cnt = ReadByte(); - + if(self.cnt) self.colormod = '1 0 0'; else self.colormod = '0 1 0'; self.traileffect = particleeffectnum("healray_muzzleflash"); - self.lip = particleeffectnum("healray_impact"); + self.lip = particleeffectnum("healray_impact"); self.draw = bumble_raygun_draw; } - - + + if(sf & BRG_START) { self.origin_x = ReadCoord(); diff --git a/qcsrc/server/vehicles/racer.qc b/qcsrc/server/vehicles/racer.qc index c4f7b436c..ff5453902 100644 --- a/qcsrc/server/vehicles/racer.qc +++ b/qcsrc/server/vehicles/racer.qc @@ -637,8 +637,8 @@ void spawnfunc_vehicle_racer() { remove(self); return; - } - + } + self.vehicle_flags |= VHF_DMGSHAKE; self.vehicle_flags |= VHF_DMGROLL; @@ -679,7 +679,7 @@ void spawnfunc_vehicle_racer() racer_frame, racer_enter, racer_exit, racer_die, racer_think, - TRUE, + TRUE, autocvar_g_vehicle_racer_health, autocvar_g_vehicle_racer_shield)) { diff --git a/qcsrc/server/vehicles/raptor.qc b/qcsrc/server/vehicles/raptor.qc index 229bbfeda..58a640e9c 100644 --- a/qcsrc/server/vehicles/raptor.qc +++ b/qcsrc/server/vehicles/raptor.qc @@ -208,15 +208,15 @@ void raptor_enter() if(self.owner.flagcarried) setorigin(self.owner.flagcarried, '-20 0 96'); - + CSQCVehicleSetup(self.owner, 0); } void raptor_land() -{ +{ float hgt; - - hgt = raptor_altitude(512); + + hgt = raptor_altitude(512); self.velocity = (self.velocity * 0.9) + ('0 0 -1800' * (hgt / 256) * sys_frametime); self.angles_x *= 0.95; self.angles_z *= 0.95; @@ -251,7 +251,7 @@ void raptor_exit(float eject) if (!self.owner) return; - + makevectors(self.angles); if(eject) { @@ -280,23 +280,23 @@ void raptor_exit(float eject) self.owner.oldvelocity = self.owner.velocity; setorigin(self.owner , spot); } - - antilag_clear(self.owner); + + antilag_clear(self.owner); self.owner = world; } float raptor_takeoff() { entity player, raptor; - + player = self; raptor = self.vehicle; self = raptor; if(self.sound_nexttime < time) - { + { self.sound_nexttime = time + 7.955812; //soundlength("vehicles/raptor_fly.wav"); sound (self, CH_TRIGGER_SINGLE, "vehicles/raptor_speed.wav", VOL_VEHICLEENGINE, ATTEN_NORM); - } + } // Takeoff sequense if(raptor.frame < 25) @@ -359,7 +359,7 @@ void raptor_flare_think() _missile.enemy = self; _missile = _missile.chain; } - + if(self.tur_impacttime < time) remove(self); } @@ -369,7 +369,7 @@ float raptor_frame() entity player, raptor; float ftmp = 0; vector df; - + if(intermission_running) return 1; @@ -379,28 +379,28 @@ float raptor_frame() vehicles_painframe(); /* ftmp = vlen(self.velocity); - if(ftmp > autocvar_g_vehicle_raptor_speed_forward) + if(ftmp > autocvar_g_vehicle_raptor_speed_forward) ftmp = 1; - else + else ftmp = ftmp / autocvar_g_vehicle_raptor_speed_forward; */ - + if(self.sound_nexttime < time) - { - self.sound_nexttime = time + 7.955812; + { + self.sound_nexttime = time + 7.955812; //sound (self.tur_head, CH_TRIGGER_SINGLE, "vehicles/raptor_fly.wav", 1 - ftmp, ATTEN_NORM ); - sound (self, CH_TRIGGER_SINGLE, "vehicles/raptor_speed.wav", 1, ATTEN_NORM); + sound (self, CH_TRIGGER_SINGLE, "vehicles/raptor_speed.wav", 1, ATTEN_NORM); self.wait = ftmp; - } + } /* else if(fabs(ftmp - self.wait) > 0.2) { sound (self.tur_head, CH_TRIGGER_SINGLE, "", 1 - ftmp, ATTEN_NORM ); - sound (self, CH_TRIGGER_SINGLE, "", ftmp, ATTEN_NORM); + sound (self, CH_TRIGGER_SINGLE, "", ftmp, ATTEN_NORM); self.wait = ftmp; } */ - + if(raptor.deadflag != DEAD_NO) { self = player; @@ -482,7 +482,7 @@ float raptor_frame() { if(raptor.gun1.lock_time < time || raptor.gun1.enemy.deadflag) raptor.gun1.enemy = world; - + if(trace_ent) if(trace_ent.movetype) if(trace_ent.takedamage) @@ -497,12 +497,12 @@ float raptor_frame() } } else - { + { raptor.gun1.enemy = trace_ent; raptor.gun1.lock_time = time + 0.5; } } - + if(raptor.gun1.enemy) { float i, distance, impact_time; @@ -512,7 +512,7 @@ float raptor_frame() vector _vel = raptor.gun1.enemy.velocity; if(raptor.gun1.enemy.movetype == MOVETYPE_WALK) _vel_z *= 0.1; - + if(autocvar_g_vehicle_raptor_cannon_predicttarget) { ad = vf; @@ -522,10 +522,10 @@ float raptor_frame() impact_time = distance / autocvar_g_vehicle_raptor_cannon_speed; ad = vf + _vel * impact_time; } - trace_endpos = ad; + trace_endpos = ad; } else - trace_endpos = vf; + trace_endpos = vf; } } else if(autocvar_g_vehicle_raptor_cannon_locktarget == 1) @@ -564,12 +564,12 @@ float raptor_frame() } - vehicle_aimturret(raptor, trace_endpos, raptor.gun1, "fire1", - autocvar_g_vehicle_raptor_cannon_pitchlimit_down * -1, autocvar_g_vehicle_raptor_cannon_pitchlimit_up, + vehicle_aimturret(raptor, trace_endpos, raptor.gun1, "fire1", + autocvar_g_vehicle_raptor_cannon_pitchlimit_down * -1, autocvar_g_vehicle_raptor_cannon_pitchlimit_up, autocvar_g_vehicle_raptor_cannon_turnlimit * -1, autocvar_g_vehicle_raptor_cannon_turnlimit, autocvar_g_vehicle_raptor_cannon_turnspeed); - vehicle_aimturret(raptor, trace_endpos, raptor.gun2, "fire1", - autocvar_g_vehicle_raptor_cannon_pitchlimit_down * -1, autocvar_g_vehicle_raptor_cannon_pitchlimit_up, + vehicle_aimturret(raptor, trace_endpos, raptor.gun2, "fire1", + autocvar_g_vehicle_raptor_cannon_pitchlimit_down * -1, autocvar_g_vehicle_raptor_cannon_pitchlimit_up, autocvar_g_vehicle_raptor_cannon_turnlimit * -1, autocvar_g_vehicle_raptor_cannon_turnlimit, autocvar_g_vehicle_raptor_cannon_turnspeed); /* @@ -578,7 +578,7 @@ float raptor_frame() traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, raptor); UpdateAuxiliaryXhair(player, trace_endpos, '0 1 0', 0); */ - + if(player.BUTTON_ATCK) if(raptor.attack_finished_single <= time) if(raptor.vehicle_energy > autocvar_g_vehicle_raptor_cannon_cost) @@ -616,7 +616,7 @@ float raptor_frame() raptor_bombdrop(); raptor.delay = time + autocvar_g_vehicle_raptor_bombs_refire; raptor.lip = time; - } + } } else { @@ -625,11 +625,11 @@ float raptor_frame() { float i; entity _flare; - + for(i = 0; i < 3; ++i) { _flare = spawn(); - setmodel(_flare, "models/runematch/rune.mdl"); + setmodel(_flare, "models/runematch/rune.mdl"); _flare.effects = EF_LOWPRECISION | EF_FLAME; _flare.scale = 0.5; setorigin(_flare, self.origin - '0 0 16'); @@ -650,7 +650,7 @@ float raptor_frame() raptor.lip = time; } } - + raptor.bomb1.alpha = raptor.bomb2.alpha = (time - raptor.lip) / (raptor.delay - raptor.lip); player.vehicle_reload2 = bound(0, raptor.bomb1.alpha * 100, 100); @@ -667,13 +667,13 @@ float raptor_frame() _missile = _missile.chain; } - + if(_incomming) sound(self, CH_PAIN_SINGLE, "vehicles/missile_alarm.wav", VOL_BASE, ATTEN_NONE); - + self.bomb1.cnt = time + 1; } - + VEHICLE_UPDATE_PLAYER(player, health, raptor); VEHICLE_UPDATE_PLAYER(player, energy, raptor); @@ -681,7 +681,7 @@ float raptor_frame() VEHICLE_UPDATE_PLAYER(player, shield, raptor); player.BUTTON_ATCK = player.BUTTON_ATCK2 = player.BUTTON_CROUCH = 0; - + self = player; return 1; } @@ -708,7 +708,7 @@ void raptor_diethink() { if(time >= self.wait) self.think = raptor_blowup; - + if(random() < 0.1) { sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM); @@ -728,7 +728,7 @@ void raptor_die() self.think = raptor_diethink; self.nextthink = time; self.wait = time + 5 + (random() * 5); - + pointparticles(particleeffectnum("explosion_medium"), findbetterlocation (self.origin, 16), '0 0 0', 1); self.velocity_z += 600; @@ -760,12 +760,12 @@ float raptor_impulse(float _imp) switch(_imp) { case 10: - case 15: + case 15: case 18: self.vehicle.vehicle_weapon2mode += 1; if(self.vehicle.vehicle_weapon2mode > RSM_LAST) self.vehicle.vehicle_weapon2mode = RSM_FIRST; - + CSQCVehicleSetup(self, 0); return TRUE; case 12: @@ -774,17 +774,17 @@ float raptor_impulse(float _imp) self.vehicle.vehicle_weapon2mode -= 1; if(self.vehicle.vehicle_weapon2mode < RSM_FIRST) self.vehicle.vehicle_weapon2mode = RSM_LAST; - + CSQCVehicleSetup(self, 0); return TRUE; - /* + /* case 17: // toss gun, could be used to exit? break; case 20: // Manual minigun reload? break; */ - } + } return FALSE; } @@ -797,9 +797,9 @@ void raptor_spawn(float _f) //FIXME: Camera is in a bad place in HUD model. //setorigin(self.vehicle_viewport, '25 0 5'); - + self.vehicles_impusle = raptor_impulse; - + self.frame = 0; self.bomb1 = spawn(); @@ -872,10 +872,10 @@ void raptor_spawn(float _f) setsize(self, RAPTOR_MIN, RAPTOR_MAX ); self.delay = time; - + self.bouncefactor = autocvar_g_vehicle_raptor_bouncefactor; - self.bouncestop = autocvar_g_vehicle_raptor_bouncestop; - self.vehicle_impact = raptor_impact; + self.bouncestop = autocvar_g_vehicle_raptor_bouncestop; + self.vehicle_impact = raptor_impact; self.damageforcescale = 0.25; } @@ -885,11 +885,11 @@ void spawnfunc_vehicle_raptor() { remove(self); return; - } - + } + self.vehicle_flags |= VHF_DMGSHAKE; self.vehicle_flags |= VHF_DMGROLL; - + if(autocvar_g_vehicle_raptor_shield) self.vehicle_flags |= VHF_HASSHIELD; @@ -909,11 +909,11 @@ void spawnfunc_vehicle_raptor() //precache_model ("models/vehicles/clusterbomb.md3"); precache_model ("models/vehicles/clusterbomb_folded.md3"); precache_model ("models/vehicles/raptor_body.dpm"); - + precache_sound ("vehicles/raptor_fly.wav"); precache_sound ("vehicles/raptor_speed.wav"); precache_sound ("vehicles/missile_alarm.wav"); - + if(!vehicle_initialize( "Raptor", "models/vehicles/raptor.dpm", @@ -927,14 +927,14 @@ void spawnfunc_vehicle_raptor() raptor_frame, raptor_enter, raptor_exit, raptor_die, raptor_think, - FALSE, + FALSE, autocvar_g_vehicle_raptor_health, autocvar_g_vehicle_raptor_shield)) { remove(self); return; } - - + + } #endif // SVQC diff --git a/qcsrc/server/vehicles/spiderbot.qc b/qcsrc/server/vehicles/spiderbot.qc index 9b37d3e6f..a36904139 100644 --- a/qcsrc/server/vehicles/spiderbot.qc +++ b/qcsrc/server/vehicles/spiderbot.qc @@ -132,12 +132,12 @@ void spiderbot_guide_release() } } -float spiberbot_calcartillery_flighttime; +float spiberbot_calcartillery_flighttime; vector spiberbot_calcartillery(vector org, vector tgt, float ht) { float grav, sdist, zdist, vs, vz, jumpheight; vector sdir; - + grav = autocvar_sv_gravity; zdist = tgt_z - org_z; sdist = vlen(tgt - org - zdist * '0 0 1'); @@ -213,7 +213,7 @@ void spiderbot_rocket_do() entity rocket = world; if (self.wait != -10) - { + { if (self.owner.BUTTON_ATCK2 && self.vehicle_weapon2mode == SBRM_GUIDE) { if (self.wait == 1) @@ -234,7 +234,7 @@ void spiderbot_rocket_do() self.wait = 0; } } - + if(self.gun2.cnt > time) return; @@ -243,14 +243,14 @@ void spiderbot_rocket_do() self.tur_head.frame = 1; self.wait = 0; } - + if (self.wait != -10) if (!self.owner.BUTTON_ATCK2) return; v = gettaginfo(self.tur_head,gettagindex(self.tur_head,"tag_fire")); - + switch(self.vehicle_weapon2mode) { case SBRM_VOLLY: @@ -277,36 +277,36 @@ void spiderbot_rocket_do() rocket.nextthink = time; rocket.think = spiderbot_rocket_guided; - + break; case SBRM_ARTILLERY: rocket = vehicles_projectile("spiderbot_rocket_launch", "weapons/rocket_fire.wav", v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed, autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1, DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, TRUE, self.owner); - + crosshair_trace(self.owner); - + rocket.pos1 = trace_endpos + randomvec() * (0.75 * autocvar_g_vehicle_spiderbot_rocket_radius); rocket.pos1_z = trace_endpos_z; - - traceline(v, v + '0 0 1' * MAX_SHOT_DISTANCE, MOVE_WORLDONLY, self); + + traceline(v, v + '0 0 1' * MAX_SHOT_DISTANCE, MOVE_WORLDONLY, self); float h1 = 0.75 * vlen(v - trace_endpos); - + //v = trace_endpos; - traceline(v , rocket.pos1 + '0 0 1' * MAX_SHOT_DISTANCE, MOVE_WORLDONLY, self); + traceline(v , rocket.pos1 + '0 0 1' * MAX_SHOT_DISTANCE, MOVE_WORLDONLY, self); float h2 = 0.75 * vlen(rocket.pos1 - v); - + rocket.velocity = spiberbot_calcartillery(v, rocket.pos1, ((h1 < h2) ? h1 : h2)); - rocket.movetype = MOVETYPE_TOSS; + rocket.movetype = MOVETYPE_TOSS; rocket.gravity = 1; - //rocket.think = spiderbot_rocket_artillery; + //rocket.think = spiderbot_rocket_artillery; break; } rocket.classname = "spiderbot_rocket"; - + rocket.cnt = time + autocvar_g_vehicle_spiderbot_rocket_lifetime; - + self.tur_head.frame += 1; if (self.tur_head.frame == 9) self.attack_finished_single = autocvar_g_vehicle_spiderbot_rocket_reload; @@ -329,17 +329,17 @@ float spiderbot_frame() if(intermission_running) return 1; - + player = self; spider = self.vehicle; self = spider; vehicles_painframe(); - + player.BUTTON_ZOOM = 0; player.BUTTON_CROUCH = 0; player.switchweapon = 0; - + #if 1 // 0 to enable per-gun impact aux crosshairs // Avarage gun impact point's -> aux cross @@ -367,9 +367,9 @@ float spiderbot_frame() ad = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(spider.angles), AnglesTransform_FromAngles(ad))) - spider.tur_head.angles; ad = AnglesTransform_Normalize(ad, TRUE); //UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload2) + ('0 1 0' * (1 - player.vehicle_reload2)), 2); - + // Rotate head - ftmp = autocvar_g_vehicle_spiderbot_head_turnspeed * sys_frametime; + ftmp = autocvar_g_vehicle_spiderbot_head_turnspeed * sys_frametime; ad_y = bound(-ftmp, ad_y, ftmp); spider.tur_head.angles_y = bound(autocvar_g_vehicle_spiderbot_head_turnlimit * -1, spider.tur_head.angles_y + ad_y, autocvar_g_vehicle_spiderbot_head_turnlimit); @@ -380,7 +380,7 @@ float spiderbot_frame() //fixedmakevectors(spider.angles); makevectors(spider.angles + '-2 0 0' * spider.angles_x); - + movelib_groundalign4point(autocvar_g_vehicle_spiderbot_springlength, autocvar_g_vehicle_spiderbot_springup, autocvar_g_vehicle_spiderbot_springblend, autocvar_g_vehicle_spiderbot_tiltlimit); if(spider.flags & FL_ONGROUND) @@ -388,11 +388,11 @@ float spiderbot_frame() if(spider.frame == 4 && self.tur_head.wait != 0) { sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_land.wav", VOL_VEHICLEENGINE, ATTEN_NORM); - spider.frame = 5; + spider.frame = 5; } - + if(player.BUTTON_JUMP && self.tur_head.wait < time) - { + { sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_jump.wav", VOL_VEHICLEENGINE, ATTEN_NORM); //dprint("spiderbot_jump:", ftos(soundlength("vehicles/spiderbot_jump.wav")), "\n"); self.delay = 0; @@ -407,12 +407,12 @@ float spiderbot_frame() if(vlen(player.movement) == 0) { if(self.sound_nexttime < time || self.delay != 3) - { + { self.delay = 3; self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_idle.wav"); //dprint("spiderbot_idle:", ftos(soundlength("vehicles/spiderbot_idle.wav")), "\n"); sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_idle.wav", VOL_VEHICLEENGINE, ATTEN_NORM); - } + } movelib_beak_simple(autocvar_g_vehicle_spiderbot_speed_stop); spider.frame = 5; } @@ -423,8 +423,8 @@ float spiderbot_frame() ftmp = autocvar_g_vehicle_spiderbot_turnspeed_strafe * sys_frametime; else ftmp = autocvar_g_vehicle_spiderbot_turnspeed * sys_frametime; - - ftmp = bound(-ftmp, spider.tur_head.angles_y, ftmp); + + ftmp = bound(-ftmp, spider.tur_head.angles_y, ftmp); spider.angles_y = anglemods(spider.angles_y + ftmp); spider.tur_head.angles_y -= ftmp; @@ -444,7 +444,7 @@ float spiderbot_frame() movelib_move_simple(normalize(v_forward * player.movement_x),autocvar_g_vehicle_spiderbot_speed_walk,autocvar_g_vehicle_spiderbot_movement_inertia); if(self.sound_nexttime < time || self.delay != 1) - { + { self.delay = 1; self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_walk.wav"); sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_walk.wav", VOL_VEHICLEENGINE, ATTEN_NORM); @@ -465,7 +465,7 @@ float spiderbot_frame() } movelib_move_simple(normalize(v_right * player.movement_y),autocvar_g_vehicle_spiderbot_speed_strafe,autocvar_g_vehicle_spiderbot_movement_inertia); if(self.sound_nexttime < time || self.delay != 2) - { + { self.delay = 2; self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_strafe.wav"); sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_strafe.wav", VOL_VEHICLEENGINE, ATTEN_NORM); @@ -527,7 +527,7 @@ float spiderbot_frame() vehicles_regen(spider.cnt, vehicle_ammo1, autocvar_g_vehicle_spiderbot_minigun_ammo_max, autocvar_g_vehicle_spiderbot_minigun_ammo_regen_pause, autocvar_g_vehicle_spiderbot_minigun_ammo_regen, frametime, FALSE); - + spiderbot_rocket_do(); @@ -554,7 +554,7 @@ float spiderbot_frame() VEHICLE_UPDATE_PLAYER(player, shield, spiderbot); self = player; - return 1; + return 1; } void spiderbot_think() { @@ -574,8 +574,8 @@ void spiderbot_enter() if(self.owner.flagcarried) { - setattachment(self.owner.flagcarried, self.tur_head, ""); - setorigin(self.owner.flagcarried, '-20 0 120'); + setattachment(self.owner.flagcarried, self.tur_head, ""); + setorigin(self.owner.flagcarried, '-20 0 120'); } } @@ -583,7 +583,7 @@ void spiderbot_exit(float eject) { entity e; vector spot; - + e = findchain(classname,"spiderbot_rocket"); while(e) { @@ -600,7 +600,7 @@ void spiderbot_exit(float eject) self.nextthink = time; self.frame = 5; self.movetype = MOVETYPE_WALK; - + if (!self.owner) return; @@ -632,7 +632,7 @@ void spiderbot_exit(float eject) self.owner.oldvelocity = self.owner.velocity; setorigin(self.owner , spot); } - + antilag_clear(self.owner); self.owner = world; } @@ -640,7 +640,7 @@ void spiderbot_exit(float eject) void spider_impact() { if(autocvar_g_vehicle_spiderbot_bouncepain_x) - vehilces_impact(autocvar_g_vehicle_spiderbot_bouncepain_x, autocvar_g_vehicle_spiderbot_bouncepain_y, autocvar_g_vehicle_spiderbot_bouncepain_z); + vehilces_impact(autocvar_g_vehicle_spiderbot_bouncepain_x, autocvar_g_vehicle_spiderbot_bouncepain_y, autocvar_g_vehicle_spiderbot_bouncepain_z); } void spiderbot_headfade() @@ -672,7 +672,7 @@ void spiderbot_blowup() self.nextthink = time + 0.1; return; } - + entity h, g1, g2, b; b = spawn(); h = spawn(); @@ -755,12 +755,12 @@ float spiderbot_impulse(float _imp) switch(_imp) { case 10: - case 15: + case 15: case 18: self.vehicle.vehicle_weapon2mode += 1; if(self.vehicle.vehicle_weapon2mode > SBRM_LAST) self.vehicle.vehicle_weapon2mode = SBRM_FIRST; - + //centerprint(self, strcat("Rocket mode is ", ftos(self.vehicle.vehicle_weapon2mode))); CSQCVehicleSetup(self, 0); return TRUE; @@ -770,28 +770,28 @@ float spiderbot_impulse(float _imp) self.vehicle.vehicle_weapon2mode -= 1; if(self.vehicle.vehicle_weapon2mode < SBRM_FIRST) self.vehicle.vehicle_weapon2mode = SBRM_LAST; - + //centerprint(self, strcat("Rocket mode is ", ftos(self.vehicle.vehicle_weapon2mode))); CSQCVehicleSetup(self, 0); return TRUE; - /* + /* case 17: // toss gun, could be used to exit? break; case 20: // Manual minigun reload? break; */ - } + } return FALSE; } void spiderbot_spawn(float _f) { if(!self.gun1) - { + { self.vehicles_impusle = spiderbot_impulse; self.gun1 = spawn(); - self.gun2 = spawn(); + self.gun2 = spawn(); setmodel(self.gun1, "models/vehicles/spiderbot_barrels.dpm"); setmodel(self.gun2, "models/vehicles/spiderbot_barrels.dpm"); setattachment(self.gun1, self.tur_head, "tag_hardpoint01"); @@ -809,7 +809,7 @@ void spiderbot_spawn(float _f) self.movetype = MOVETYPE_WALK; self.solid = SOLID_SLIDEBOX; self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = 1; - self.tur_head.angles = '0 0 0'; + self.tur_head.angles = '0 0 0'; setorigin(self, self.pos1 + '0 0 128'); self.angles = self.pos2; @@ -823,12 +823,12 @@ void spawnfunc_vehicle_spiderbot() { remove(self); return; - } + } self.vehicle_flags |= VHF_DMGSHAKE; //self.vehicle_flags |= VHF_DMGROLL; //self.vehicle_flags |= VHF_DMGHEADROLL; - + precache_model ( "models/vhshield.md3"); precache_model ( "models/vehicles/spiderbot.dpm"); precache_model ( "models/vehicles/spiderbot_top.dpm"); @@ -838,7 +838,7 @@ void spawnfunc_vehicle_spiderbot() precache_sound ( "weapons/uzi_fire.wav" ); precache_sound ( "weapons/rocket_impact.wav"); - + precache_sound ( "vehicles/spiderbot_die.wav"); precache_sound ( "vehicles/spiderbot_idle.wav"); precache_sound ( "vehicles/spiderbot_jump.wav"); @@ -854,7 +854,7 @@ void spawnfunc_vehicle_spiderbot() if(autocvar_g_vehicle_spiderbot_health_regen) self.vehicle_flags |= VHF_HEALTHREGEN; - + if(!vehicle_initialize( "Spiderbot", "models/vehicles/spiderbot.dpm", @@ -868,7 +868,7 @@ void spawnfunc_vehicle_spiderbot() spiderbot_frame, spiderbot_enter, spiderbot_exit, spiderbot_die, spiderbot_think, - FALSE, + FALSE, autocvar_g_vehicle_spiderbot_health, autocvar_g_vehicle_spiderbot_shield)) { diff --git a/qcsrc/server/vehicles/vehicles.qc b/qcsrc/server/vehicles/vehicles.qc index f1fca41eb..1e5537a25 100644 --- a/qcsrc/server/vehicles/vehicles.qc +++ b/qcsrc/server/vehicles/vehicles.qc @@ -103,13 +103,13 @@ void CSQCVehicleSetup(entity own, float vehicle_id) { if (!IS_REAL_CLIENT(own)) return; - + msg_entity = own; WriteByte(MSG_ONE, SVC_TEMPENTITY); WriteByte(MSG_ONE, TE_CSQC_VEHICLESETUP); if(vehicle_id != 0) - WriteByte(MSG_ONE, vehicle_id); + WriteByte(MSG_ONE, vehicle_id); else WriteByte(MSG_ONE, 1 + own.vehicle.vehicle_weapon2mode + HUD_VEHICLE_LAST); } @@ -492,10 +492,10 @@ void vehicles_spawn() setorigin(self, self.pos1 + '0 0 0'); // Show it pointparticles(particleeffectnum("teleport"), self.origin + '0 0 64', '0 0 0', 1); - + if(self.vehicle_controller) self.team = self.vehicle_controller.team; - + vehicles_reset_colors(); self.vehicle_spawn(VHSF_NORMAL); } @@ -539,7 +539,7 @@ void vehicles_touch() { if(MUTATOR_CALLHOOK(VehicleTouch)) return; - + // Vehicle currently in use if(self.owner) { @@ -574,8 +574,8 @@ var float autocvar_g_vehicles_allow_bots = 0; void vehicles_enter() { // Remove this when bots know how to use vehicles - - if (IS_BOT_CLIENT(other)) + + if (IS_BOT_CLIENT(other)) if (autocvar_g_vehicles_allow_bots) dprint("Bot enters vehicle\n"); // This is where we need to disconnect (some, all?) normal bot AI and hand over to vehicle's _aiframe() else @@ -636,13 +636,13 @@ void vehicles_enter() self.team = self.owner.team; self.flags -= FL_NOTARGET; - + if (IS_REAL_CLIENT(other)) { msg_entity = other; WriteByte (MSG_ONE, SVC_SETVIEWPORT); WriteEntity(MSG_ONE, self.vehicle_viewport); - + WriteByte (MSG_ONE, SVC_SETVIEWANGLES); if(self.tur_head) { @@ -661,7 +661,7 @@ void vehicles_enter() vehicles_clearrturn(); CSQCVehicleSetup(self.owner, self.hud); - + vh_player = other; vh_vehicle = self; MUTATOR_CALLHOOK(VehicleEnter); @@ -735,31 +735,31 @@ void vehicles_exit(float eject) entity _vehicle; entity _player; entity _oldself = self; - + if(vehicles_exit_running) { dprint("^1vehicles_exit allready running! this is not good..\n"); return; } - + vehicles_exit_running = TRUE; if(IS_CLIENT(self)) { _vehicle = self.vehicle; - + if (_vehicle.vehicle_flags & VHF_PLAYERSLOT) { _vehicle.vehicle_exit(eject); self = _oldself; vehicles_exit_running = FALSE; - return; + return; } } else _vehicle = self; - + _player = _vehicle.owner; - + self = _vehicle; if (_player) @@ -775,7 +775,7 @@ void vehicles_exit(float eject) WriteAngle(MSG_ONE, _vehicle.angles_y); WriteAngle(MSG_ONE, 0); } - + setsize(_player, PL_MIN,PL_MAX); _player.takedamage = DAMAGE_AIM; @@ -793,12 +793,12 @@ void vehicles_exit(float eject) CSQCVehicleSetup(_player, HUD_NORMAL); } _vehicle.flags |= FL_NOTARGET; - + if(_vehicle.deadflag == DEAD_NO) _vehicle.avelocity = '0 0 0'; - + _vehicle.tur_head.nodrawtoclient = world; - + if(!teamplay) _vehicle.team = 0; @@ -809,18 +809,18 @@ void vehicles_exit(float eject) _vehicle = vh_vehicle; _vehicle.team = _vehicle.tur_head.team; - + sound (_vehicle, CH_TRIGGER_SINGLE, "misc/null.wav", 1, ATTEN_NORM); - _vehicle.vehicle_hudmodel.viewmodelforclient = _vehicle; + _vehicle.vehicle_hudmodel.viewmodelforclient = _vehicle; _vehicle.phase = time + 1; - + _vehicle.vehicle_exit(eject); - + vehicles_setreturn(); - vehicles_reset_colors(); + vehicles_reset_colors(); _vehicle.owner = world; self = _oldself; - + vehicles_exit_running = FALSE; } @@ -832,7 +832,7 @@ void vehicles_regen(float timer, .float regen_field, float field_max, float rpau { if(_healthscale) regen = regen * (self.vehicle_health / self.tur_health); - + self.regen_field = min(self.regen_field + regen * delta_time, field_max); if(self.owner) @@ -880,24 +880,24 @@ void vehicles_painframe() void vehicles_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) { self.dmg_time = time; - + if(DEATH_ISWEAPON(deathtype, WEP_NEX)) damage *= autocvar_g_vehicles_nex_damagerate; - + if(DEATH_ISWEAPON(deathtype, WEP_UZI)) damage *= autocvar_g_vehicles_uzi_damagerate; - + if(DEATH_ISWEAPON(deathtype, WEP_RIFLE)) damage *= autocvar_g_vehicles_rifle_damagerate; - + if(DEATH_ISWEAPON(deathtype, WEP_MINSTANEX)) damage *= autocvar_g_vehicles_minstanex_damagerate; if(DEATH_ISWEAPON(deathtype, WEP_SEEKER)) damage *= autocvar_g_vehicles_tag_damagerate; - + self.enemy = attacker; - + if((self.vehicle_flags & VHF_HASSHIELD) && (self.vehicle_shield > 0)) { if (wasfreed(self.vehicle_shieldent) || self.vehicle_shieldent == world) @@ -942,7 +942,7 @@ void vehicles_damage(entity inflictor, entity attacker, float damage, float deat if(sound_allowed(MSG_BROADCAST, attacker)) spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTEN_NORM); // FIXME: PLACEHOLDER } - + if(self.damageforcescale < 1 && self.damageforcescale > 0) self.velocity += force * self.damageforcescale; else @@ -1133,7 +1133,7 @@ void vehicle_use() self.active = ACTIVE_NOT; else self.active = ACTIVE_ACTIVE; - + if(self.active == ACTIVE_ACTIVE && self.deadflag == DEAD_NO) { dprint("^3Eat shit yall!\n"); @@ -1142,15 +1142,15 @@ void vehicle_use() } else if(self.active == ACTIVE_NOT && self.deadflag != DEAD_NO) { - + } } -float vehicle_addplayerslot( entity _owner, - entity _slot, - float _hud, +float vehicle_addplayerslot( entity _owner, + entity _slot, + float _hud, string _hud_model, - float() _framefunc, + float() _framefunc, void(float) _exitfunc) { if (!(_owner.vehicle_flags & VHF_MULTISLOT)) @@ -1164,13 +1164,13 @@ float vehicle_addplayerslot( entity _owner, _slot.vehicle_hudmodel = spawn(); _slot.vehicle_hudmodel.viewmodelforclient = _slot; _slot.vehicle_viewport.effects = (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT); - + setmodel(_slot.vehicle_hudmodel, _hud_model); setmodel(_slot.vehicle_viewport, "null"); - + setattachment(_slot.vehicle_hudmodel, _slot, ""); setattachment(_slot.vehicle_viewport, _slot.vehicle_hudmodel, ""); - + return TRUE; } @@ -1198,7 +1198,7 @@ float vehicle_initialize(string net_name, { if(!autocvar_g_vehicles) return FALSE; - + if(self.targetname) { self.vehicle_controller = find(world, target, self.targetname); @@ -1208,19 +1208,19 @@ float vehicle_initialize(string net_name, } else { - self.team = self.vehicle_controller.team; + self.team = self.vehicle_controller.team; self.use = vehicle_use; - + if(teamplay) { if(self.vehicle_controller.team == 0) self.active = ACTIVE_NOT; else - self.active = ACTIVE_ACTIVE; + self.active = ACTIVE_ACTIVE; } } } - + precache_sound("onslaught/ons_hit2.wav"); precache_sound("onslaught/electricity_explode.wav"); @@ -1316,19 +1316,19 @@ float vehicle_initialize(string net_name, tracebox(self.origin + '0 0 100', min_s, max_s, self.origin - '0 0 10000', MOVE_WORLDONLY, self); setorigin(self, trace_endpos); } - + self.pos1 = self.origin; self.pos2 = self.angles; self.tur_head.team = self.team; - + if(MUTATOR_CALLHOOK(VehicleSpawn)) return FALSE; return TRUE; } -vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string _tagname, - float _pichlimit_min, float _pichlimit_max, +vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string _tagname, + float _pichlimit_min, float _pichlimit_max, float _rotlimit_min, float _rotlimit_max, float _aimspeed) { vector vtmp, vtag; @@ -1340,7 +1340,7 @@ vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string ftmp = _aimspeed * frametime; vtmp_y = bound(-ftmp, vtmp_y, ftmp); vtmp_x = bound(-ftmp, vtmp_x, ftmp); - _turrret.angles_y = bound(_rotlimit_min, _turrret.angles_y + vtmp_y, _rotlimit_max); + _turrret.angles_y = bound(_rotlimit_min, _turrret.angles_y + vtmp_y, _rotlimit_max); _turrret.angles_x = bound(_pichlimit_min, _turrret.angles_x + vtmp_x, _pichlimit_max); return vtag; } @@ -1370,23 +1370,23 @@ entity vehicle_tossgib(entity _template, vector _vel, string _tag, float _burn, _gib.movetype = MOVETYPE_TOSS; _gib.solid = SOLID_CORPSE; _gib.colormod = '-0.5 -0.5 -0.5'; - _gib.effects = EF_LOWPRECISION; + _gib.effects = EF_LOWPRECISION; _gib.avelocity = _rot; - + if(_burn) _gib.effects |= EF_FLAME; - + if(_explode) { - _gib.think = vehicles_gib_explode; + _gib.think = vehicles_gib_explode; _gib.nextthink = time + random() * _explode; _gib.touch = vehicles_gib_explode; } else { _gib.cnt = time + _maxtime; - _gib.think = vehicles_gib_think; - _gib.nextthink = time + _maxtime - 1; + _gib.think = vehicles_gib_think; + _gib.nextthink = time + _maxtime - 1; _gib.alpha = 1; } return _gib; diff --git a/qcsrc/server/w_common.qc b/qcsrc/server/w_common.qc index dd89ec2f8..0734a58db 100644 --- a/qcsrc/server/w_common.qc +++ b/qcsrc/server/w_common.qc @@ -192,7 +192,7 @@ void W_BallisticBullet_Hit (void) /*if(yoda && (time > (self.last_yoda + 5))) { Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA); - self.last_yoda = time; + self.last_yoda = time; }*/ // calculate hits for ballistic weapons @@ -247,7 +247,7 @@ float W_BallisticBullet_LeaveSolid(float eff) if(self.origin_x > world.maxs_x || self.origin_y > world.maxs_y || self.origin_z > world.maxs_z || self.origin_x < world.mins_x || self.origin_y < world.mins_y || self.origin_z < world.mins_z) return 0; - // special case for zero density and zero bullet constant: + // special case for zero density and zero bullet constant: if(self.dmg_radius == 0) { @@ -566,7 +566,7 @@ void fireBullet (vector start, vector dir, float spread, float damage, float for if (pointcontents (trace_endpos) != CONTENT_SKY) { if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)) - Damage_DamageInfo(trace_endpos, damage, 0, 0, dir * max(1, force), dtype, trace_ent.species, self); + Damage_DamageInfo(trace_endpos, damage, 0, 0, dir * max(1, force), dtype, trace_ent.species, self); Damage (trace_ent, self, self, damage, dtype, trace_endpos, dir * force); } @@ -578,7 +578,7 @@ float W_CheckProjectileDamage(entity inflictor, entity projowner, float deathtyp float is_from_contents = (deathtype == DEATH_SLIME || deathtype == DEATH_LAVA); float is_from_owner = (inflictor == projowner); float is_from_exception = (exception != -1); - + //dprint(strcat("W_CheckProjectileDamage: from_contents ", ftos(is_from_contents), " : from_owner ", ftos(is_from_owner), " : exception ", strcat(ftos(is_from_exception), " (", ftos(exception), "). \n"))); if(autocvar_g_projectiles_damage <= -2) @@ -598,7 +598,7 @@ float W_CheckProjectileDamage(entity inflictor, entity projowner, float deathtyp return (exception); // if exception is detected, allow it to override else if (!is_from_contents) return FALSE; // otherwise, only allow damage from contents - } + } else if(autocvar_g_projectiles_damage == 1) { if(is_from_exception) @@ -619,13 +619,13 @@ void W_PrepareExplosionByDamage(entity attacker, void() explode) { self.takedamage = DAMAGE_NO; self.event_damage = func_null; - + if(IS_CLIENT(attacker) && !autocvar_g_projectiles_keep_owner) { self.owner = attacker; self.realowner = attacker; } - + // do not explode NOW but in the NEXT FRAME! // because recursive calls to RadiusDamage are not allowed self.nextthink = time; diff --git a/qcsrc/server/w_crylink.qc b/qcsrc/server/w_crylink.qc index d447e2887..f7ad7583d 100644 --- a/qcsrc/server/w_crylink.qc +++ b/qcsrc/server/w_crylink.qc @@ -241,7 +241,7 @@ float W_Crylink_Touch_WouldHitFriendly(entity projectile, float rad) else ++hit_enemy; } - + head = head.chain; } @@ -267,7 +267,7 @@ void W_Crylink_Touch (void) f *= a; float totaldamage = RadiusDamage(self, self.realowner, autocvar_g_balance_crylink_primary_damage * f, autocvar_g_balance_crylink_primary_edgedamage * f, autocvar_g_balance_crylink_primary_radius, world, autocvar_g_balance_crylink_primary_force * f, self.projectiledeathtype, other); - + if(totaldamage && ((autocvar_g_balance_crylink_primary_linkexplode == 2) || ((autocvar_g_balance_crylink_primary_linkexplode == 1) && !W_Crylink_Touch_WouldHitFriendly(self, autocvar_g_balance_crylink_primary_radius)))) { if(self == self.realowner.crylink_lastgroup) @@ -311,7 +311,7 @@ void W_Crylink_Touch2 (void) f *= a; float totaldamage = RadiusDamage(self, self.realowner, autocvar_g_balance_crylink_secondary_damage * f, autocvar_g_balance_crylink_secondary_edgedamage * f, autocvar_g_balance_crylink_secondary_radius, world, autocvar_g_balance_crylink_secondary_force * f, self.projectiledeathtype, other); - + if(totaldamage && ((autocvar_g_balance_crylink_secondary_linkexplode == 2) || ((autocvar_g_balance_crylink_secondary_linkexplode == 1) && !W_Crylink_Touch_WouldHitFriendly(self, autocvar_g_balance_crylink_secondary_radius)))) { if(self == self.realowner.crylink_lastgroup) @@ -439,7 +439,7 @@ void W_Crylink_Attack (void) proj.flags = FL_PROJECTILE; proj.missile_flags = MIF_SPLASH; - + CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE); other = proj; MUTATOR_CALLHOOK(EditProjectile); @@ -555,7 +555,7 @@ void W_Crylink_Attack2 (void) proj.flags = FL_PROJECTILE; proj.missile_flags = MIF_SPLASH; - + CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE); other = proj; MUTATOR_CALLHOOK(EditProjectile); diff --git a/qcsrc/server/w_electro.qc b/qcsrc/server/w_electro.qc index 3762ac4d7..0ad23a137 100644 --- a/qcsrc/server/w_electro.qc +++ b/qcsrc/server/w_electro.qc @@ -96,10 +96,10 @@ void W_Plasma_Damage (entity inflictor, entity attacker, float damage, float dea // note: combos are usually triggered by W_Plasma_TriggerCombo, not damage float is_combo = (inflictor.classname == "plasma_chain" || inflictor.classname == "plasma_prim"); - + if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, (is_combo ? 1 : -1))) - return; // g_projectiles_damage says to halt - + return; // g_projectiles_damage says to halt + self.health = self.health - damage; if (self.health <= 0) { diff --git a/qcsrc/server/w_fireball.qc b/qcsrc/server/w_fireball.qc index b019bcc31..88e9d770f 100644 --- a/qcsrc/server/w_fireball.qc +++ b/qcsrc/server/w_fireball.qc @@ -125,10 +125,10 @@ void W_Fireball_Damage (entity inflictor, entity attacker, float damage, float d { if(self.health <= 0) return; - + if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions return; // g_projectiles_damage says to halt - + self.health = self.health - damage; if (self.health <= 0) { @@ -170,7 +170,7 @@ void W_Fireball_Attack1() setsize(proj, '-16 -16 -16', '16 16 16'); proj.flags = FL_PROJECTILE; proj.missile_flags = MIF_SPLASH | MIF_PROXY; - + CSQCProjectile(proj, TRUE, PROJECTILE_FIREBALL, TRUE); other = proj; MUTATOR_CALLHOOK(EditProjectile); @@ -301,7 +301,7 @@ void W_Fireball_Attack2() proj.angles = vectoangles(proj.velocity); proj.flags = FL_PROJECTILE; proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC; - + CSQCProjectile(proj, TRUE, PROJECTILE_FIREMINE, TRUE); other = proj; MUTATOR_CALLHOOK(EditProjectile); diff --git a/qcsrc/server/w_grenadelauncher.qc b/qcsrc/server/w_grenadelauncher.qc index db8913b35..17144d3a5 100644 --- a/qcsrc/server/w_grenadelauncher.qc +++ b/qcsrc/server/w_grenadelauncher.qc @@ -59,12 +59,12 @@ void W_Grenade_Damage (entity inflictor, entity attacker, float damage, float de { if (self.health <= 0) return; - + if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions return; // g_projectiles_damage says to halt - + self.health = self.health - damage; - + if (self.health <= 0) W_PrepareExplosionByDamage(attacker, self.use); } @@ -152,10 +152,10 @@ void W_Grenade_Touch2 (void) spamsound (self, CH_SHOTS, "weapons/grenade_bounce6.wav", VOL_BASE, ATTEN_NORM); self.projectiledeathtype |= HITTYPE_BOUNCE; self.gl_bouncecnt += 1; - + if (autocvar_g_balance_grenadelauncher_secondary_lifetime_bounce && self.gl_bouncecnt == 1) self.nextthink = time + autocvar_g_balance_grenadelauncher_secondary_lifetime_bounce; - + } else if(autocvar_g_balance_grenadelauncher_secondary_type == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick { diff --git a/qcsrc/server/w_hagar.qc b/qcsrc/server/w_hagar.qc index e32af7de5..05768fc50 100644 --- a/qcsrc/server/w_hagar.qc +++ b/qcsrc/server/w_hagar.qc @@ -34,11 +34,11 @@ void W_Hagar_Damage (entity inflictor, entity attacker, float damage, float deat { if (self.health <= 0) return; - + float is_linkexplode = ( ((inflictor.owner != world) ? (inflictor.owner == self.owner) : TRUE) - && (inflictor.projectiledeathtype & HITTYPE_SECONDARY) + && (inflictor.projectiledeathtype & HITTYPE_SECONDARY) && (self.projectiledeathtype & HITTYPE_SECONDARY)); - + if(is_linkexplode) is_linkexplode = (is_linkexplode && autocvar_g_balance_hagar_secondary_load_linkexplode); else @@ -49,7 +49,7 @@ void W_Hagar_Damage (entity inflictor, entity attacker, float damage, float deat self.health = self.health - damage; self.angles = vectoangles(self.velocity); - + if (self.health <= 0) W_PrepareExplosionByDamage(attacker, self.think); } @@ -90,13 +90,13 @@ void W_Hagar_Attack (void) missile.classname = "missile"; missile.bot_dodge = TRUE; missile.bot_dodgerating = autocvar_g_balance_hagar_primary_damage; - + missile.takedamage = DAMAGE_YES; missile.health = autocvar_g_balance_hagar_primary_health; missile.damageforcescale = autocvar_g_balance_hagar_primary_damageforcescale; missile.event_damage = W_Hagar_Damage; missile.damagedbycontents = TRUE; - + missile.touch = W_Hagar_Touch; missile.use = W_Hagar_Explode; missile.think = adaptor_think2use_hittype_splash; @@ -111,7 +111,7 @@ void W_Hagar_Attack (void) missile.angles = vectoangles (missile.velocity); missile.flags = FL_PROJECTILE; - missile.missile_flags = MIF_SPLASH; + missile.missile_flags = MIF_SPLASH; CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR, TRUE); @@ -133,7 +133,7 @@ void W_Hagar_Attack2 (void) missile.classname = "missile"; missile.bot_dodge = TRUE; missile.bot_dodgerating = autocvar_g_balance_hagar_secondary_damage; - + missile.takedamage = DAMAGE_YES; missile.health = autocvar_g_balance_hagar_secondary_health; missile.damageforcescale = autocvar_g_balance_hagar_secondary_damageforcescale; @@ -155,7 +155,7 @@ void W_Hagar_Attack2 (void) missile.angles = vectoangles (missile.velocity); missile.flags = FL_PROJECTILE; - missile.missile_flags = MIF_SPLASH; + missile.missile_flags = MIF_SPLASH; CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR_BOUNCING, TRUE); @@ -193,7 +193,7 @@ void W_Hagar_Attack2_Load_Release (void) missile.classname = "missile"; missile.bot_dodge = TRUE; missile.bot_dodgerating = autocvar_g_balance_hagar_secondary_damage; - + missile.takedamage = DAMAGE_YES; missile.health = autocvar_g_balance_hagar_secondary_health; missile.damageforcescale = autocvar_g_balance_hagar_secondary_damageforcescale; @@ -209,13 +209,13 @@ void W_Hagar_Attack2_Load_Release (void) setorigin (missile, w_shotorg); setsize(missile, '0 0 0', '0 0 0'); missile.movetype = MOVETYPE_FLY; - missile.missile_flags = MIF_SPLASH; - + missile.missile_flags = MIF_SPLASH; + // per-shot spread calculation: the more shots there are, the less spread is applied (based on the bias cvar) - spread_pershot = ((shots - 1) / (autocvar_g_balance_hagar_secondary_load_max - 1)); + spread_pershot = ((shots - 1) / (autocvar_g_balance_hagar_secondary_load_max - 1)); spread_pershot = (1 - (spread_pershot * autocvar_g_balance_hagar_secondary_load_spread_bias)); spread_pershot = (autocvar_g_balance_hagar_secondary_spread * spread_pershot * g_weaponspreadfactor); - + // pattern spread calculation s = '0 0 0'; if (counter == 0) @@ -227,7 +227,7 @@ void W_Hagar_Attack2_Load_Release (void) s_z = v_forward_y; } s = s * autocvar_g_balance_hagar_secondary_load_spread * g_weaponspreadfactor; - + W_SetupProjectileVelocityEx(missile, w_shotdir + right * s_y + up * s_z, v_up, autocvar_g_balance_hagar_secondary_speed, 0, 0, spread_pershot, FALSE); missile.angles = vectoangles (missile.velocity); @@ -246,7 +246,7 @@ void W_Hagar_Attack2_Load_Release (void) void W_Hagar_Attack2_Load (void) { // loadable hagar secondary attack, must always run each frame - + if(time < game_starttime) return; @@ -322,7 +322,7 @@ void W_Hagar_Attack2_Load (void) self.hagar_warning = TRUE; } } - + // release if player let go of button or if they've held it in too long if(!self.BUTTON_ATCK2 || ((loaded || !enough_ammo) && self.hagar_loadstep < time && autocvar_g_balance_hagar_secondary_load_hold >= 0)) { diff --git a/qcsrc/server/w_hlac.qc b/qcsrc/server/w_hlac.qc index 520c49261..5642ef057 100644 --- a/qcsrc/server/w_hlac.qc +++ b/qcsrc/server/w_hlac.qc @@ -18,7 +18,7 @@ void W_HLAC_Touch (void) PROJECTILE_TOUCH; self.event_damage = func_null; - + if(self.projectiledeathtype & HITTYPE_SECONDARY) RadiusDamage (self, self.realowner, autocvar_g_balance_hlac_secondary_damage, autocvar_g_balance_hlac_secondary_edgedamage, autocvar_g_balance_hlac_secondary_radius, world, autocvar_g_balance_hlac_secondary_force, self.projectiledeathtype, other); else @@ -112,7 +112,7 @@ void W_HLAC_Attack2f (void) missile.nextthink = time + autocvar_g_balance_hlac_secondary_lifetime; missile.flags = FL_PROJECTILE; - missile.missile_flags = MIF_SPLASH; + missile.missile_flags = MIF_SPLASH; missile.projectiledeathtype = WEP_HLAC | HITTYPE_SECONDARY; CSQCProjectile(missile, TRUE, PROJECTILE_HLAC, TRUE); diff --git a/qcsrc/server/w_hook.qc b/qcsrc/server/w_hook.qc index 4cef38441..f0310c702 100644 --- a/qcsrc/server/w_hook.qc +++ b/qcsrc/server/w_hook.qc @@ -66,12 +66,12 @@ void W_Hook_Damage (entity inflictor, entity attacker, float damage, float death { if (self.health <= 0) return; - + if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions - return; // g_projectiles_damage says to halt - + return; // g_projectiles_damage says to halt + self.health = self.health - damage; - + if (self.health <= 0) W_PrepareExplosionByDamage(self.realowner, W_Hook_Explode2); } @@ -104,7 +104,7 @@ void W_Hook_Attack2() gren.think = adaptor_think2use_hittype_splash; gren.use = W_Hook_Explode2; gren.touch = W_Hook_Touch2; - + gren.takedamage = DAMAGE_YES; gren.health = autocvar_g_balance_hook_secondary_health; gren.damageforcescale = autocvar_g_balance_hook_secondary_damageforcescale; @@ -141,7 +141,7 @@ void spawnfunc_weapon_hook (void) float w_hook(float req) { float hooked_time_max, hooked_fuel; - + if (req == WR_AIM) { // ... sorry ... @@ -158,7 +158,7 @@ float w_hook(float req) { W_DecreaseAmmo(ammo_fuel, autocvar_g_balance_hook_primary_fuel, FALSE); self.hook_state |= HOOK_FIRING; - weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hook_primary_animtime, w_ready); + weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hook_primary_animtime, w_ready); } } @@ -183,13 +183,13 @@ float w_hook(float req) if(self.hook && self.hook.state == 1) { - hooked_time_max = autocvar_g_balance_hook_primary_hooked_time_max; + hooked_time_max = autocvar_g_balance_hook_primary_hooked_time_max; if (hooked_time_max > 0) { if ( time > self.hook_time_hooked + hooked_time_max ) self.hook_state |= HOOK_REMOVING; } - + hooked_fuel = autocvar_g_balance_hook_primary_hooked_fuel; if (hooked_fuel > 0) { @@ -215,7 +215,7 @@ float w_hook(float req) } else { - self.hook_time_hooked = time; + self.hook_time_hooked = time; self.hook_time_fueldecrease = time + autocvar_g_balance_hook_primary_hooked_time_free; } diff --git a/qcsrc/server/w_laser.qc b/qcsrc/server/w_laser.qc index ac8cbf1c1..0a0704638 100644 --- a/qcsrc/server/w_laser.qc +++ b/qcsrc/server/w_laser.qc @@ -74,7 +74,7 @@ void W_Laser_Attack (float issecondary) missile.touch = W_Laser_Touch; missile.flags = FL_PROJECTILE; - missile.missile_flags = MIF_SPLASH; + missile.missile_flags = MIF_SPLASH; missile.think = W_Laser_Think; missile.nextthink = time + autocvar_g_balance_laser_primary_delay; diff --git a/qcsrc/server/w_minelayer.qc b/qcsrc/server/w_minelayer.qc index 0db02d74f..5d88df8b2 100644 --- a/qcsrc/server/w_minelayer.qc +++ b/qcsrc/server/w_minelayer.qc @@ -182,7 +182,7 @@ void W_Mine_Think (void) self.movetype = MOVETYPE_NONE; } } - + // our lifetime has expired, it's time to die - mine_time just allows us to play a sound for this // TODO: replace this mine_trigger.wav sound with a real countdown if ((time > self.cnt) && (!self.mine_time)) @@ -258,15 +258,15 @@ void W_Mine_Damage (entity inflictor, entity attacker, float damage, float death { if (self.health <= 0) return; - + float is_from_enemy = (inflictor.realowner != self.realowner); - + if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, (is_from_enemy ? 1 : -1))) return; // g_projectiles_damage says to halt - + self.health = self.health - damage; self.angles = vectoangles(self.velocity); - + if (self.health <= 0) W_PrepareExplosionByDamage(attacker, W_Mine_Explode); } @@ -337,7 +337,7 @@ void W_Mine_Attack (void) // common properties other = mine; MUTATOR_CALLHOOK(EditProjectile); - + self.minelayer_mines = W_Mine_Count(self); } diff --git a/qcsrc/server/w_minstanex.qc b/qcsrc/server/w_minstanex.qc index 1bd4e11bd..9fb80c6d5 100644 --- a/qcsrc/server/w_minstanex.qc +++ b/qcsrc/server/w_minstanex.qc @@ -74,7 +74,7 @@ void W_MinstaNex_Attack (void) WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3"), w_shotorg, v); break; } - + W_DecreaseAmmo(ammo_cells, ((g_minstagib) ? 1 : autocvar_g_balance_minstanex_ammo), autocvar_g_balance_minstanex_reload_ammo); } @@ -117,7 +117,7 @@ float w_minstanex(float req) { // handle refire manually, so that primary and secondary can be fired without conflictions (important for minstagib) self.jump_interval = time + autocvar_g_balance_minstanex_laser_refire * W_WeaponRateFactor(); - + // decrease ammo for the laser? if(autocvar_g_balance_minstanex_laser_ammo) W_DecreaseAmmo(ammo_cells, autocvar_g_balance_minstanex_laser_ammo, autocvar_g_balance_minstanex_reload_ammo); @@ -128,7 +128,7 @@ float w_minstanex(float req) self.weapon = WEP_LASER; W_Laser_Attack(2); self.weapon = w; - + // now do normal refire weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_minstanex_laser_animtime, w_ready); } diff --git a/qcsrc/server/w_nex.qc b/qcsrc/server/w_nex.qc index d6f737037..919e27e5a 100644 --- a/qcsrc/server/w_nex.qc +++ b/qcsrc/server/w_nex.qc @@ -76,7 +76,7 @@ void W_Nex_Attack (float issecondary) FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_NEX); if(yoda && flying) - Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA); + Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA); //beam and muzzle flash done on client SendCSQCNexBeamParticle(charge); @@ -231,7 +231,7 @@ float w_nex(float req) { // don't allow charging if we don't have enough ammo ammo_amount = self.ammo_cells >= autocvar_g_balance_nex_secondary_ammo; - ammo_amount += self.(weapon_load[WEP_NEX]) >= autocvar_g_balance_nex_secondary_ammo; + ammo_amount += self.(weapon_load[WEP_NEX]) >= autocvar_g_balance_nex_secondary_ammo; return ammo_amount; } else diff --git a/qcsrc/server/w_rocketlauncher.qc b/qcsrc/server/w_rocketlauncher.qc index fd851c207..6cd8929f6 100644 --- a/qcsrc/server/w_rocketlauncher.qc +++ b/qcsrc/server/w_rocketlauncher.qc @@ -207,13 +207,13 @@ void W_Rocket_Damage (entity inflictor, entity attacker, float damage, float dea { if (self.health <= 0) return; - + if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions return; // g_projectiles_damage says to halt - + self.health = self.health - damage; self.angles = vectoangles(self.velocity); - + if (self.health <= 0) W_PrepareExplosionByDamage(attacker, W_Rocket_Explode); } @@ -260,7 +260,7 @@ void W_Rocket_Attack (void) missile.nextthink = time; missile.cnt = time + autocvar_g_balance_rocketlauncher_lifetime; missile.flags = FL_PROJECTILE; - missile.missile_flags = MIF_SPLASH; + missile.missile_flags = MIF_SPLASH; CSQCProjectile(missile, autocvar_g_balance_rocketlauncher_guiderate == 0 && autocvar_g_balance_rocketlauncher_speedaccel == 0, PROJECTILE_ROCKET, FALSE); // because of fly sound diff --git a/qcsrc/server/w_seeker.qc b/qcsrc/server/w_seeker.qc index ba580e702..c870f0868 100644 --- a/qcsrc/server/w_seeker.qc +++ b/qcsrc/server/w_seeker.qc @@ -84,7 +84,7 @@ void Seeker_Missile_Think() // Calc how important it is that we turn and add this to the desierd (enemy) dir. desireddir = normalize(((trace_plane_normal * (1 - trace_fraction)) + (desireddir * trace_fraction)) * 0.5); } - + newdir = normalize(olddir + desireddir * turnrate); // take the average of the 2 directions; not the best method but simple & easy self.velocity = newdir * spd; // make me fly in the new direction at my flight speed } @@ -136,7 +136,7 @@ void Seeker_Missile_Damage (entity inflictor, entity attacker, float damage, flo { if (self.health <= 0) return; - + if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions return; // g_projectiles_damage says to halt @@ -144,7 +144,7 @@ void Seeker_Missile_Damage (entity inflictor, entity attacker, float damage, flo self.health = self.health - (damage * 0.25); else self.health = self.health - damage; - + if (self.health <= 0) W_PrepareExplosionByDamage(attacker, Seeker_Missile_Explode); } @@ -206,10 +206,10 @@ void Seeker_Fire_Missile(vector f_diff, entity m_target) missile.damageforcescale = autocvar_g_balance_seeker_missile_damageforcescale; missile.damagedbycontents = TRUE; //missile.think = Seeker_Missile_Animate; // csqc projectiles. - + if (missile.enemy != world) missile.projectiledeathtype = WEP_SEEKER | HITTYPE_SECONDARY; - else + else missile.projectiledeathtype = WEP_SEEKER; @@ -218,7 +218,7 @@ void Seeker_Fire_Missile(vector f_diff, entity m_target) missile.movetype = MOVETYPE_FLYMISSILE; missile.flags = FL_PROJECTILE; missile.missile_flags = MIF_SPLASH | MIF_GUIDED_TAG; - + W_SETUPPROJECTILEVELOCITY_UP(missile, g_balance_seeker_missile); missile.angles = vectoangles (missile.velocity); @@ -229,7 +229,7 @@ void Seeker_Fire_Missile(vector f_diff, entity m_target) } // ============================ -// Begin: FLAC, close range attack meant for defeating rockets which are coming at you. +// Begin: FLAC, close range attack meant for defeating rockets which are coming at you. // ============================ void Seeker_Flac_Explode () { @@ -283,23 +283,23 @@ void Seeker_Fire_Flac() missile.bot_dodge = TRUE; missile.bot_dodgerating = autocvar_g_balance_seeker_flac_damage; missile.touch = Seeker_Flac_Explode; - missile.use = Seeker_Flac_Explode; + missile.use = Seeker_Flac_Explode; missile.think = adaptor_think2use_hittype_splash; missile.nextthink = time + autocvar_g_balance_seeker_flac_lifetime + autocvar_g_balance_seeker_flac_lifetime_rand; missile.solid = SOLID_BBOX; - missile.movetype = MOVETYPE_FLY; + missile.movetype = MOVETYPE_FLY; missile.projectiledeathtype = WEP_SEEKER; missile.projectiledeathtype = WEP_SEEKER | HITTYPE_SECONDARY; missile.flags = FL_PROJECTILE; - missile.missile_flags = MIF_SPLASH; - + missile.missile_flags = MIF_SPLASH; + // csqc projectiles - //missile.angles = vectoangles (missile.velocity); - //missile.scale = 0.4; // BUG: the model is too big - + //missile.angles = vectoangles (missile.velocity); + //missile.scale = 0.4; // BUG: the model is too big + setorigin (missile, w_shotorg); setsize (missile, '-2 -2 -2', '2 2 2'); - + W_SETUPPROJECTILEVELOCITY_UP(missile, g_balance_seeker_flac); CSQCProjectile(missile, TRUE, PROJECTILE_FLAC, TRUE); @@ -307,22 +307,22 @@ void Seeker_Fire_Flac() } // ============================ -// Begin: Tag and rocket controllers +// Begin: Tag and rocket controllers // ============================ entity Seeker_Tagged_Info(entity isowner, entity istarget) { entity tag; - for(tag = world; (tag = find(tag, classname, "tag_tracker")); ) + for(tag = world; (tag = find(tag, classname, "tag_tracker")); ) if ((tag.realowner == isowner) && (tag.tag_target == istarget)) return tag; - + return world; } void Seeker_Attack() { entity tracker, closest_target; - + closest_target = world; for(tracker = world; (tracker = find(tracker, classname, "tag_tracker")); ) if (tracker.realowner == self) { @@ -331,14 +331,14 @@ void Seeker_Attack() if (vlen(self.origin - tracker.tag_target.origin) < vlen(self.origin - closest_target.origin)) closest_target = tracker.tag_target; } - else + else closest_target = tracker.tag_target; } - + traceline(self.origin + self.view_ofs, closest_target.origin, MOVE_NOMONSTERS, self); if ((!closest_target) || ((trace_fraction < 1) && (trace_ent != closest_target))) closest_target = world; - + Seeker_Fire_Missile('0 0 0', closest_target); } @@ -355,13 +355,13 @@ void Seeker_Vollycontroller_Think() // TODO: Merge this with Seeker_Attack } self.nextthink = time + autocvar_g_balance_seeker_missile_delay * W_WeaponRateFactor(); - + oldself = self; self = self.realowner; - + oldenemy = self.enemy; self.enemy = oldself.enemy; - + c = mod(self.cnt, 4); switch(c) { @@ -384,7 +384,7 @@ void Seeker_Vollycontroller_Think() // TODO: Merge this with Seeker_Attack self = oldself; } -void Seeker_Tracker_Think() +void Seeker_Tracker_Think() { // commit suicide if: You die OR target dies OR you switch away from the seeker OR commit suicide if lifetime is up if ((self.realowner.deadflag != DEAD_NO) || (self.tag_target.deadflag != DEAD_NO) || (self.realowner.switchweapon != WEP_SEEKER) @@ -397,13 +397,13 @@ void Seeker_Tracker_Think() } return; } - + // Update the think method information self.nextthink = time; } // ============================ -// Begin: Tag projectile +// Begin: Tag projectile // ============================ void Seeker_Tag_Explode () { @@ -428,7 +428,7 @@ void Seeker_Tag_Touch() vector dir; vector org2; entity e; - + PROJECTILE_TOUCH; dir = normalize (self.realowner.origin - self.origin); @@ -443,38 +443,38 @@ void Seeker_Tag_Touch() { // check to see if this person is already tagged by me entity tag = Seeker_Tagged_Info(self.realowner, other); - + if (tag != world) { if (other.wps_tag_tracker && (autocvar_g_balance_seeker_type == 1)) // don't attach another waypointsprite without killing the old one first WaypointSprite_Kill(other.wps_tag_tracker); - + tag.tag_time = time; } else - { + { //sprint(self.realowner, strcat("You just tagged ^2", other.netname, "^7 with a tracking device!\n")); e = spawn(); e.cnt = autocvar_g_balance_seeker_missile_count; e.classname = "tag_tracker"; e.owner = self.owner; e.realowner = self.realowner; - + if (autocvar_g_balance_seeker_type == 1) { e.tag_target = other; e.tag_time = time; e.think = Seeker_Tracker_Think; } - else + else { e.enemy = other; e.think = Seeker_Vollycontroller_Think; } - + e.nextthink = time; } - + if (autocvar_g_balance_seeker_type == 1) { WaypointSprite_Spawn("tagged-target", autocvar_g_balance_seeker_tag_tracker_lifetime, 0, other, '0 0 64', self.realowner, 0, other, wps_tag_tracker, TRUE, RADARICON_TAGGED, '0.5 1 0'); @@ -513,7 +513,7 @@ void Seeker_Fire_Tag() setsize (missile, '-2 -2 -2', '2 2 2'); missile.flags = FL_PROJECTILE; - //missile.missile_flags = MIF_..?; + //missile.missile_flags = MIF_..?; missile.movetype = MOVETYPE_FLY; W_SETUPPROJECTILEVELOCITY(missile, g_balance_seeker_tag); @@ -538,7 +538,7 @@ float w_seeker(float req) if (req == WR_AIM) { - if (autocvar_g_balance_seeker_type == 1) + if (autocvar_g_balance_seeker_type == 1) if (Seeker_Tagged_Info(self, self.enemy) != world) self.BUTTON_ATCK = bot_aim(autocvar_g_balance_seeker_missile_speed_max, 0, autocvar_g_balance_seeker_missile_lifetime, FALSE); else @@ -550,10 +550,10 @@ float w_seeker(float req) { if(autocvar_g_balance_seeker_reload_ammo && self.clip_load < min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo)) // forced reload weapon_action(self.weapon, WR_RELOAD); - + else if (self.BUTTON_ATCK) { - if (autocvar_g_balance_seeker_type == 1) + if (autocvar_g_balance_seeker_type == 1) { if (weapon_prepareattack(0, autocvar_g_balance_seeker_missile_refire)) { @@ -561,7 +561,7 @@ float w_seeker(float req) weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_seeker_missile_animtime, w_ready); } } - else + else { if (weapon_prepareattack(0, autocvar_g_balance_seeker_tag_refire)) { @@ -573,7 +573,7 @@ float w_seeker(float req) else if (self.BUTTON_ATCK2) { - if (autocvar_g_balance_seeker_type == 1) + if (autocvar_g_balance_seeker_type == 1) { if (weapon_prepareattack(0, autocvar_g_balance_seeker_tag_refire)) { @@ -581,7 +581,7 @@ float w_seeker(float req) weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_seeker_tag_animtime, w_ready); } } - else + else { if (weapon_prepareattack(0, autocvar_g_balance_seeker_flac_refire)) { @@ -608,7 +608,7 @@ float w_seeker(float req) } else if (req == WR_CHECKAMMO1) { - if (autocvar_g_balance_seeker_type == 1) + if (autocvar_g_balance_seeker_type == 1) { ammo_amount = self.ammo_rockets >= autocvar_g_balance_seeker_missile_ammo; ammo_amount += self.(weapon_load[WEP_SEEKER]) >= autocvar_g_balance_seeker_missile_ammo; @@ -618,12 +618,12 @@ float w_seeker(float req) ammo_amount = self.ammo_rockets >= autocvar_g_balance_seeker_tag_ammo; ammo_amount += self.(weapon_load[WEP_SEEKER]) >= autocvar_g_balance_seeker_tag_ammo; } - + return ammo_amount; } else if (req == WR_CHECKAMMO2) { - if (autocvar_g_balance_seeker_type == 1) + if (autocvar_g_balance_seeker_type == 1) { ammo_amount = self.ammo_rockets >= autocvar_g_balance_seeker_tag_ammo; ammo_amount += self.(weapon_load[WEP_SEEKER]) >= autocvar_g_balance_seeker_tag_ammo; @@ -633,7 +633,7 @@ float w_seeker(float req) ammo_amount = self.ammo_rockets >= autocvar_g_balance_seeker_flac_ammo; ammo_amount += self.(weapon_load[WEP_SEEKER]) >= autocvar_g_balance_seeker_flac_ammo; } - + return ammo_amount; } else if (req == WR_RELOAD) diff --git a/qcsrc/server/w_shotgun.qc b/qcsrc/server/w_shotgun.qc index 5b2672fec..a40a2da4b 100644 --- a/qcsrc/server/w_shotgun.qc +++ b/qcsrc/server/w_shotgun.qc @@ -67,66 +67,66 @@ void shotgun_meleethink (void) if(!self.cnt) // set start time of melee { - self.cnt = time; + self.cnt = time; W_PlayStrengthSound(self.realowner); } makevectors(self.realowner.v_angle); // update values for v_* vectors - + // calculate swing percentage based on time meleetime = autocvar_g_balance_shotgun_secondary_melee_time * W_WeaponRateFactor(); swing = bound(0, (self.cnt + meleetime - time) / meleetime, 10); f = ((1 - swing) * autocvar_g_balance_shotgun_secondary_melee_traces); - + // check to see if we can still continue, otherwise give up now if((self.realowner.deadflag != DEAD_NO) && autocvar_g_balance_shotgun_secondary_melee_no_doubleslap) { remove(self); return; } - - // if okay, perform the traces needed for this frame + + // if okay, perform the traces needed for this frame for(i=self.swing_prev; i < f; ++i) { swing_factor = ((1 - (i / autocvar_g_balance_shotgun_secondary_melee_traces)) * 2 - 1); - - targpos = (self.realowner.origin + self.realowner.view_ofs + + targpos = (self.realowner.origin + self.realowner.view_ofs + (v_forward * autocvar_g_balance_shotgun_secondary_melee_range) + (v_up * swing_factor * autocvar_g_balance_shotgun_secondary_melee_swing_up) + (v_right * swing_factor * autocvar_g_balance_shotgun_secondary_melee_swing_side)); WarpZone_traceline_antilag(self, self.realowner.origin + self.realowner.view_ofs, targpos, FALSE, self, ANTILAG_LATENCY(self.realowner)); - + // draw lightning beams for debugging - //te_lightning2(world, targpos, self.realowner.origin + self.realowner.view_ofs + v_forward * 5 - v_up * 5); + //te_lightning2(world, targpos, self.realowner.origin + self.realowner.view_ofs + v_forward * 5 - v_up * 5); //te_customflash(targpos, 40, 2, '1 1 1'); - + is_player = (IS_PLAYER(trace_ent) || trace_ent.classname == "body"); if((trace_fraction < 1) // if trace is good, apply the damage and remove self - && (trace_ent.takedamage == DAMAGE_AIM) + && (trace_ent.takedamage == DAMAGE_AIM) && (trace_ent != self.swing_alreadyhit) && (is_player || autocvar_g_balance_shotgun_secondary_melee_nonplayerdamage)) { target_victim = trace_ent; // so it persists through other calls - + if(is_player) // this allows us to be able to nerf the non-player damage done in e.g. assault or onslaught. swing_damage = (autocvar_g_balance_shotgun_secondary_damage * min(1, swing_factor + 1)); else swing_damage = (autocvar_g_balance_shotgun_secondary_melee_nonplayerdamage * min(1, swing_factor + 1)); - + //print(strcat(self.realowner.netname, " hitting ", target_victim.netname, " with ", strcat(ftos(swing_damage), " damage (factor: ", ftos(swing_factor), ") at "), ftos(time), " seconds.\n")); - - Damage(target_victim, self.realowner, self.realowner, - swing_damage, WEP_SHOTGUN | HITTYPE_SECONDARY, - self.realowner.origin + self.realowner.view_ofs, + + Damage(target_victim, self.realowner, self.realowner, + swing_damage, WEP_SHOTGUN | HITTYPE_SECONDARY, + self.realowner.origin + self.realowner.view_ofs, v_forward * autocvar_g_balance_shotgun_secondary_force); - + if(accuracy_isgooddamage(self.realowner, target_victim)) { accuracy_add(self.realowner, WEP_SHOTGUN, 0, swing_damage); } - + // draw large red flash for debugging //te_customflash(targpos, 200, 2, '15 0 0'); - + if(autocvar_g_balance_shotgun_secondary_melee_multihit) // allow multiple hits with one swing, but not against the same player twice. { self.swing_alreadyhit = target_victim; @@ -139,7 +139,7 @@ void shotgun_meleethink (void) } } } - + if(time >= self.cnt + meleetime) { // melee is finished @@ -148,7 +148,7 @@ void shotgun_meleethink (void) } else { - // set up next frame + // set up next frame self.swing_prev = i; self.nextthink = time; } diff --git a/qcsrc/server/w_tuba.qc b/qcsrc/server/w_tuba.qc index dee2e15cf..f70aa0443 100644 --- a/qcsrc/server/w_tuba.qc +++ b/qcsrc/server/w_tuba.qc @@ -190,7 +190,7 @@ float Tuba_GetNote(entity pl, float hittype) note += 12; if(hittype & HITTYPE_SECONDARY) note += 7; - + // we support two kinds of tubas, those tuned in Eb and those tuned in C // kind of tuba currently is player slot number, or team number if in // teamplay @@ -205,7 +205,7 @@ float Tuba_GetNote(entity pl, float hittype) if(pl.clientcolors & 1) note += 3; } - + // total range of notes: // 0 // *** ** **** diff --git a/qcsrc/server/waypointsprites.qc b/qcsrc/server/waypointsprites.qc index 8332171ae..736cc564c 100644 --- a/qcsrc/server/waypointsprites.qc +++ b/qcsrc/server/waypointsprites.qc @@ -251,7 +251,7 @@ float WaypointSprite_SendEntity(entity to, float sendflags) WriteByte(MSG_ENTITY, ENT_CLIENT_WAYPOINT); sendflags = sendflags & 0x7F; - + if(g_nexball) sendflags &= ~0x80; else if(self.max_health || (self.pain_finished && (time < self.pain_finished + 0.25))) diff --git a/qcsrc/uncrusticracy.sh b/qcsrc/uncrusticracy.sh new file mode 100644 index 000000000..1bdd69024 --- /dev/null +++ b/qcsrc/uncrusticracy.sh @@ -0,0 +1,168 @@ +FILES=`find client common menu server warpzonelib -name \*.c -o -name \*.h -o -name \*.qc -o -name \*.qh` +out_raw() +{ + printf "%s\n" "$LINE" +} +out() +{ + printf "%-40s = %-8s # %s\n" "$KEY" "$VAL" "$COMMENT" +} +decide() +{ + verybestchoice= + verybestscore=2147483647 + bestchoice= + bestscore=2147483647 + secondbestchoice= + secondbestscore=2147483647 + worstscore=0 + haveignore=false + havefalse=false + have0=false + seen= + for choice in "$VAL" "$@"; do + case " $seen " in + *" $choice "*) + continue + ;; + *) + seen=$seen" $VAL" + ;; + esac + if [ x"$choice" = x"force" ]; then + continue + fi + if [ x"$choice" = x"ignore" ]; then + haveignore=true + fi + if [ x"$choice" = x"false" ]; then + havefalse=true + fi + if [ x"$choice" = x"0" ]; then + have0=true + fi + if [ x"$MODE" = x"initialize" ]; then + if [ x"$choice" = x"ignore" ]; then + score=0 + else + score=2147483647 + fi + else + { + cat uncrustify.cfg + printf "%s = %s\n" "$KEY" "$choice" + } > uncrustify.cfg.test + uncrustify -c uncrustify.cfg.test --replace --no-backup $FILES >/dev/null 2>&1 + score=0 + git diff --numstat > diffstat.tmp + while read -r add del rest; do + if [ x"$add" != x"-" ]; then + score=$(($score + $add)) + fi + if [ x"$del" != x"-" ]; then + score=$(($score + $del)) + fi + done < diffstat.tmp + git reset --hard >/dev/null 2>&1 + fi + echo >&2 "$KEY = $choice: $score" + if [ x"$choice" != x"ignore" ]; then + if [ $score -lt $bestscore ]; then + secondbestscore=$bestscore + secondbestchoice=$bestchoice + bestscore=$score + bestchoice=$choice + elif [ $score -lt $secondbestscore ]; then + secondbestscore=$score + secondbestchoice=$choice + fi + fi + if [ $score -lt $verybestscore ]; then + verybestscore=$score + verybestchoice=$choice + fi + if [ $score -gt $worstscore ]; then + worstscore=$score + worstchoice=$choice + fi + done + if [ -z "$bestchoice" ]; then + echo "# WARNING: No best choice identified" + elif [ $verybestscore -ge $worstscore ]; then + echo "# WARNING: Code doesn't seem to use this feature - delete from the config?" + if $haveignore; then + VAL=ignore + elif $havefalse; then + VAL=false + elif $have0; then + VAL=0 + fi + elif [ $bestscore -ge $worstscore ]; then + echo "# WARNING: Indifferent... please decide manually." + elif [ $bestscore -ge $secondbestscore ]; then + echo "# WARNING: Best is not unique ($bestchoice $secondbestchoice)" + elif [ $bestscore -gt $verybestscore ]; then + echo "# NOTE: is $(($bestscore - $verybestscore)) worse than $verybestchoice" + VAL=$bestchoice + else + VAL=$bestchoice + fi +} +while read -r LINE; do + case "$LINE" in + "# NOTE: "*) + continue + ;; + "# WARNING: "*) + continue + ;; + "# ERROR: "*) + continue + ;; + "#"*) + out_raw + continue + ;; + *"#force"*) + out_raw + continue + ;; + esac + printf "%s\n" "$LINE" | while read KEY EQ VAL DELIM COMMENT; do + if \ + [ x"$EQ" != x"=" ] || \ + [ x"$DELIM" != x"#" ]; then + out_raw + continue + fi + case "$COMMENT" in + number) + case "$KEY" in + indent_columns|*tab*) + decide 1 2 4 8 + ;; + *) + decide 0 1 2 3 4 indent_columns + ;; + esac + out + ;; + string) + printf "# WARNING: unsupported %s\n" "$COMMENT" + out_raw + ;; + *[!a-z/_]*) + printf "# ERROR: invalid characters %s\n" "$COMMENT" + out_raw + ;; + */*) + decide `echo "$COMMENT" | tr / ' '` + out + ;; + *) + printf "# ERROR: only once choice %s\n" "$COMMENT" + out_raw + ;; + esac + done +done < uncrustify.cfg diff --git a/qcsrc/uncrustify.cfg b/qcsrc/uncrustify.cfg index a184c9607..3590202cc 100644 --- a/qcsrc/uncrustify.cfg +++ b/qcsrc/uncrustify.cfg @@ -5,6 +5,7 @@ # # The type of line endings +# WARNING: Best is not unique (auto lf) newlines = auto # auto/lf/crlf/cr # The original size of tabs in the input @@ -17,6 +18,7 @@ output_tab_size = 8 # number string_escape_char = 92 # number # Alternate string escape char for Pawn. Only works right before the quote char. +# WARNING: Code doesn't seem to use this feature - delete from the config? string_escape_char2 = 0 # number # @@ -35,17 +37,19 @@ indent_continue = 0 # number # 0=spaces only # 1=indent with tabs to brace level, align with spaces # 2=indent and align with tabs, using spaces when not on a tabstop -indent_with_tabs = 1 # number +indent_with_tabs = 1 # number #force # Comments that are not a brace level are indented with tabs on a tabstop. # Requires indent_with_tabs=2. If false, will use spaces. indent_cmt_with_tabs = false # false/true # Whether to indent strings broken by '\' so that they line up +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_align_string = false # false/true # The number of spaces to indent multi-line XML strings. # Requires indent_align_string=True +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_xml_string = 0 # number # Spaces to indent '{' from level @@ -55,76 +59,95 @@ indent_brace = 0 # number indent_braces = false # false/true # Disabled indenting function braces if indent_braces is true +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_braces_no_func = false # false/true # Disabled indenting class braces if indent_braces is true +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_braces_no_class = false # false/true # Disabled indenting struct braces if indent_braces is true +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_braces_no_struct = false # false/true # Indent based on the size of the brace parent, i.e. 'if' => 3 spaces, 'for' => 4 spaces, etc. indent_brace_parent = false # false/true # Whether the 'namespace' body is indented +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_namespace = false # false/true # The number of spaces to indent a namespace block +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_namespace_level = 0 # number # If the body of the namespace is longer than this number, it won't be indented. # Requires indent_namespace=true. Default=0 (no limit) +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_namespace_limit = 0 # number # Whether the 'extern "C"' body is indented +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_extern = false # false/true # Whether the 'class' body is indented +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_class = false # false/true # Whether to indent the stuff after a leading class colon +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_class_colon = false # false/true # False=treat 'else\nif' as 'else if' for indenting purposes # True=indent the 'if' one level +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_else_if = false # false/true # Amount to indent variable declarations after a open brace. neg=relative, pos=absolute indent_var_def_blk = 0 # number # Indent continued variable declarations instead of aligning. +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_var_def_cont = false # false/true # True: indent continued function call parameters one indent level # False: align parameters under the open paren -indent_func_call_param = false # false/true +indent_func_call_param = true # false/true # Same as indent_func_call_param, but for function defs +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_func_def_param = false # false/true # Same as indent_func_call_param, but for function protos +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_func_proto_param = false # false/true # Same as indent_func_call_param, but for class declarations +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_func_class_param = false # false/true # Same as indent_func_call_param, but for class variable constructors +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_func_ctor_var_param = false # false/true # Same as indent_func_call_param, but for templates +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_template_param = false # false/true # Double the indent for indent_func_xxx_param options indent_func_param_double = false # false/true # Indentation column for standalone 'const' function decl/proto qualifier +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_func_const = 0 # number # Indentation column for standalone 'throw' function decl/proto qualifier +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_func_throw = 0 # number # The number of spaces to indent a continued '->' or '.' # Usually set to 0, 1, or indent_columns. +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_member = 0 # number # Spaces to indent single line ('//') comments on lines before code @@ -132,11 +155,11 @@ indent_sing_line_comments = 0 # number # If set, will indent trailing single line ('//') comments relative # to the code instead of trying to keep the same absolute column -indent_relative_single_line_comments = false # false/true +indent_relative_single_line_comments = true # false/true #force # Spaces to indent 'case' from 'switch' # Usually 0 or indent_columns. -indent_switch_case = indent_columns # number +indent_switch_case = indent_columns # number # Spaces to shift the 'case' line, without affecting any other lines # Usually 0. @@ -153,37 +176,46 @@ indent_col1_comment = false # false/true # How to indent goto labels # >0 : absolute column where 1 is the leftmost column # <=0 : subtract from brace indent -indent_label = 1 # number +# WARNING: Code doesn't seem to use this feature - delete from the config? +indent_label = 0 # number # Same as indent_label, but for access specifiers that are followed by a colon -indent_access_spec = 1 # number +# WARNING: Code doesn't seem to use this feature - delete from the config? +indent_access_spec = 0 # number # Indent the code after an access specifier by one level. # If set, this option forces 'indent_access_spec=0' +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_access_spec_body = false # false/true # If an open paren is followed by a newline, indent the next line so that it lines up after the open paren (not recommended) +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_paren_nl = false # false/true # Controls the indent of a close paren after a newline. # 0: Indent to body level # 1: Align under the open paren # 2: Indent to the brace level -indent_paren_close = 0 # number +indent_paren_close = 1 # number #force # Controls the indent of a comma when inside a paren.If TRUE, aligns under the open paren +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_comma_paren = false # false/true # Controls the indent of a BOOL operator when inside a paren.If TRUE, aligns under the open paren +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_bool_paren = false # false/true # If 'indent_bool_paren' is true, controls the indent of the first expression. If TRUE, aligns the first expression to the following ones +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_first_bool_expr = false # false/true # If an open square is followed by a newline, indent the next line so that it lines up after the open square (not recommended) +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_square_nl = false # false/true # Don't change the relative indent of ESQL/C 'EXEC SQL' bodies +# WARNING: Code doesn't seem to use this feature - delete from the config? indent_preserve_sql = false # false/true # Align continued statements at the '='. Default=True @@ -195,30 +227,35 @@ indent_align_assign = true # false/true # # Add or remove space around arithmetic operator '+', '-', '/', '*', etc -sp_arith = ignore # ignore/add/remove/force +# NOTE: is 518 worse than ignore +sp_arith = add # ignore/add/remove/force # Add or remove space around assignment operator '=', '+=', etc +# NOTE: is 4 worse than ignore sp_assign = add # ignore/add/remove/force # Add or remove space around assignment operator '=' in a prototype -sp_assign_default = add # ignore/add/remove/force +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_assign_default = ignore # ignore/add/remove/force -# Add or remove space before assignment operator '=', '+=', etc. Overrides sp_assign. -sp_before_assign = ignore # ignore/add/remove/force - -# Add or remove space after assignment operator '=', '+=', etc. Overrides sp_assign. -sp_after_assign = ignore # ignore/add/remove/force +# # Add or remove space before assignment operator '=', '+=', etc. Overrides sp_assign. +# sp_before_assign = ignore # ignore/add/remove/force +# +# # Add or remove space after assignment operator '=', '+=', etc. Overrides sp_assign. +# sp_after_assign = ignore # ignore/add/remove/force # Add or remove space around assignment '=' in enum -sp_enum_assign = add # ignore/add/remove/force +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_enum_assign = ignore # ignore/add/remove/force -# Add or remove space before assignment '=' in enum. Overrides sp_enum_assign. -sp_enum_before_assign = ignore # ignore/add/remove/force - -# Add or remove space after assignment '=' in enum. Overrides sp_enum_assign. -sp_enum_after_assign = ignore # ignore/add/remove/force +# # Add or remove space before assignment '=' in enum. Overrides sp_enum_assign. +# sp_enum_before_assign = ignore # ignore/add/remove/force +# +# # Add or remove space after assignment '=' in enum. Overrides sp_enum_assign. +# sp_enum_after_assign = ignore # ignore/add/remove/force # Add or remove space around preprocessor '##' concatenation operator. Default=Add +# NOTE: is 2 worse than ignore sp_pp_concat = remove # ignore/add/remove/force # Add or remove space after preprocessor '#' stringify operator. Also affects the '#@' charizing operator. Default=Add @@ -228,9 +265,11 @@ sp_pp_stringify = remove # ignore/add/remove/force sp_bool = add # ignore/add/remove/force # Add or remove space around compare operator '<', '>', '==', etc +# NOTE: is 4 worse than ignore sp_compare = add # ignore/add/remove/force # Add or remove space inside '(' and ')' +# NOTE: is 2 worse than ignore sp_inside_paren = remove # ignore/add/remove/force # Add or remove space between nested parens @@ -240,261 +279,322 @@ sp_paren_paren = remove # ignore/add/remove/force sp_balance_nested_parens = false # false/true # Add or remove space between ')' and '{' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_paren_brace = ignore # ignore/add/remove/force # Add or remove space before pointer star '*' -sp_before_ptr_star = ignore # ignore/add/remove/force +sp_before_ptr_star = add # ignore/add/remove/force # Add or remove space before pointer star '*' that isn't followed by a variable name # If set to 'ignore', sp_before_ptr_star is used instead. -sp_before_unnamed_ptr_star = ignore # ignore/add/remove/force +sp_before_unnamed_ptr_star = add # ignore/add/remove/force # Add or remove space between pointer stars '*' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_between_ptr_star = ignore # ignore/add/remove/force # Add or remove space after pointer star '*', if followed by a word. -sp_after_ptr_star = ignore # ignore/add/remove/force +sp_after_ptr_star = add # ignore/add/remove/force # Add or remove space after a pointer star '*', if followed by a func proto/def. -sp_after_ptr_star_func = ignore # ignore/add/remove/force +sp_after_ptr_star_func = add # ignore/add/remove/force # Add or remove space before a pointer star '*', if followed by a func proto/def. -sp_before_ptr_star_func = ignore # ignore/add/remove/force +sp_before_ptr_star_func = add # ignore/add/remove/force # Add or remove space before a reference sign '&' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_before_byref = ignore # ignore/add/remove/force # Add or remove space before a reference sign '&' that isn't followed by a variable name # If set to 'ignore', sp_before_byref is used instead. +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_before_unnamed_byref = ignore # ignore/add/remove/force # Add or remove space after reference sign '&', if followed by a word. +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_after_byref = ignore # ignore/add/remove/force # Add or remove space after a reference sign '&', if followed by a func proto/def. +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_after_byref_func = ignore # ignore/add/remove/force # Add or remove space before a reference sign '&', if followed by a func proto/def. +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_before_byref_func = ignore # ignore/add/remove/force # Add or remove space between type and word. Default=Force -sp_after_type = force # ignore/add/remove/force +sp_after_type = add # ignore/add/remove/force # Add or remove space in 'template <' vs 'template<'. # If set to ignore, sp_before_angle is used. +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_template_angle = ignore # ignore/add/remove/force # Add or remove space before '<>' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_before_angle = ignore # ignore/add/remove/force # Add or remove space inside '<' and '>' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_inside_angle = ignore # ignore/add/remove/force # Add or remove space after '<>' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_after_angle = ignore # ignore/add/remove/force # Add or remove space between '<>' and '(' as found in 'new List();' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_angle_paren = ignore # ignore/add/remove/force # Add or remove space between '<>' and a word as in 'List m;' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_angle_word = ignore # ignore/add/remove/force # Add or remove space between '>' and '>' in '>>' (template stuff C++/C# only). Default=Add -sp_angle_shift = add # ignore/add/remove/force +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_angle_shift = ignore # ignore/add/remove/force # Add or remove space before '(' of 'if', 'for', 'switch', and 'while' -sp_before_sparen = ignore # ignore/add/remove/force +# NOTE: is 734 worse than ignore +sp_before_sparen = remove # ignore/add/remove/force # Add or remove space inside if-condition '(' and ')' -sp_inside_sparen = ignore # ignore/add/remove/force +# NOTE: is 14 worse than ignore +sp_inside_sparen = remove # ignore/add/remove/force -# Add or remove space before if-condition ')'. Overrides sp_inside_sparen. -sp_inside_sparen_close = ignore # ignore/add/remove/force +# # Add or remove space before if-condition ')'. Overrides sp_inside_sparen. +# sp_inside_sparen_close = ignore # ignore/add/remove/force # Add or remove space after ')' of 'if', 'for', 'switch', and 'while' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_after_sparen = ignore # ignore/add/remove/force # Add or remove space between ')' and '{' of 'if', 'for', 'switch', and 'while' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_sparen_brace = ignore # ignore/add/remove/force # Add or remove space between 'invariant' and '(' in the D language. +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_invariant_paren = ignore # ignore/add/remove/force # Add or remove space after the ')' in 'invariant (C) c' in the D language. +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_after_invariant_paren = ignore # ignore/add/remove/force # Add or remove space before empty statement ';' on 'if', 'for' and 'while' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_special_semi = ignore # ignore/add/remove/force # Add or remove space before ';'. Default=Remove sp_before_semi = remove # ignore/add/remove/force # Add or remove space before ';' in non-empty 'for' statements -sp_before_semi_for = ignore # ignore/add/remove/force +sp_before_semi_for = remove # ignore/add/remove/force # Add or remove space before a semicolon of an empty part of a for statement. -sp_before_semi_for_empty = ignore # ignore/add/remove/force +sp_before_semi_for_empty = add # ignore/add/remove/force # Add or remove space after ';', except when followed by a comment. Default=Add +# NOTE: is 60 worse than ignore sp_after_semi = add # ignore/add/remove/force # Add or remove space after ';' in non-empty 'for' statements. Default=Force -sp_after_semi_for = force # ignore/add/remove/force +sp_after_semi_for = add # ignore/add/remove/force # Add or remove space after the final semicolon of an empty part of a for statement: for ( ; ; ). -sp_after_semi_for_empty = ignore # ignore/add/remove/force +sp_after_semi_for_empty = add # ignore/add/remove/force # Add or remove space before '[' (except '[]') -sp_before_square = ignore # ignore/add/remove/force +sp_before_square = remove # ignore/add/remove/force # Add or remove space before '[]' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_before_squares = ignore # ignore/add/remove/force # Add or remove space inside '[' and ']' -sp_inside_square = ignore # ignore/add/remove/force +sp_inside_square = remove # ignore/add/remove/force # Add or remove space after ',' -sp_after_comma = ignore # ignore/add/remove/force +# NOTE: is 48 worse than ignore +sp_after_comma = add # ignore/add/remove/force # Add or remove space before ',' sp_before_comma = remove # ignore/add/remove/force # Add or remove space between an open paren and comma: '(,' vs '( ,' -sp_paren_comma = force # ignore/add/remove/force +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_paren_comma = ignore # ignore/add/remove/force # Add or remove space before the variadic '...' when preceded by a non-punctuator +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_before_ellipsis = ignore # ignore/add/remove/force # Add or remove space after class ':' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_after_class_colon = ignore # ignore/add/remove/force # Add or remove space before class ':' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_before_class_colon = ignore # ignore/add/remove/force # Add or remove space before case ':'. Default=Remove sp_before_case_colon = remove # ignore/add/remove/force # Add or remove space between 'operator' and operator sign +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_after_operator = ignore # ignore/add/remove/force # Add or remove space between the operator symbol and the open paren, as in 'operator ++(' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_after_operator_sym = ignore # ignore/add/remove/force # Add or remove space after C/D cast, i.e. 'cast(int)a' vs 'cast(int) a' or '(int)a' vs '(int) a' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_after_cast = ignore # ignore/add/remove/force # Add or remove spaces inside cast parens +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_inside_paren_cast = ignore # ignore/add/remove/force # Add or remove space between the type and open paren in a C++ cast, i.e. 'int(exp)' vs 'int (exp)' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_cpp_cast_paren = ignore # ignore/add/remove/force # Add or remove space between 'sizeof' and '(' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_sizeof_paren = ignore # ignore/add/remove/force # Add or remove space after the tag keyword (Pawn) +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_after_tag = ignore # ignore/add/remove/force # Add or remove space inside enum '{' and '}' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_inside_braces_enum = ignore # ignore/add/remove/force # Add or remove space inside struct/union '{' and '}' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_inside_braces_struct = ignore # ignore/add/remove/force # Add or remove space inside '{' and '}' -sp_inside_braces = ignore # ignore/add/remove/force +sp_inside_braces = add # ignore/add/remove/force # Add or remove space inside '{}' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_inside_braces_empty = ignore # ignore/add/remove/force # Add or remove space between return type and function name # A minimum of 1 is forced except for pointer return types. +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_type_func = ignore # ignore/add/remove/force # Add or remove space between function name and '(' on function declaration -sp_func_proto_paren = ignore # ignore/add/remove/force +sp_func_proto_paren = remove # ignore/add/remove/force # Add or remove space between function name and '(' on function definition -sp_func_def_paren = ignore # ignore/add/remove/force +# NOTE: is 14 worse than ignore +sp_func_def_paren = remove # ignore/add/remove/force # Add or remove space inside empty function '()' -sp_inside_fparens = ignore # ignore/add/remove/force +sp_inside_fparens = remove # ignore/add/remove/force # Add or remove space inside function '(' and ')' -sp_inside_fparen = ignore # ignore/add/remove/force +# NOTE: is 8 worse than ignore +sp_inside_fparen = remove # ignore/add/remove/force # Add or remove space between ']' and '(' when part of a function call. +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_square_fparen = ignore # ignore/add/remove/force # Add or remove space between ')' and '{' of function +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_fparen_brace = ignore # ignore/add/remove/force # Add or remove space between function name and '(' on function calls -sp_func_call_paren = add # ignore/add/remove/force +# NOTE: is 28 worse than ignore +sp_func_call_paren = remove # ignore/add/remove/force # Add or remove space between function name and '()' on function calls without parameters. # If set to 'ignore' (the default), sp_func_call_paren is used. -sp_func_call_paren_empty = ignore # ignore/add/remove/force +sp_func_call_paren_empty = remove # ignore/add/remove/force # Add or remove space between the user function name and '(' on function calls # You need to set a keyword to be a user function, like this: 'set func_call_user _' in the config file. -sp_func_call_user_paren = ignore # ignore/add/remove/force +sp_func_call_user_paren = remove # ignore/add/remove/force # Add or remove space between a constructor/destructor and the open paren +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_func_class_paren = ignore # ignore/add/remove/force # Add or remove space between 'return' and '(' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_return_paren = ignore # ignore/add/remove/force # Add or remove space between '__attribute__' and '(' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_attribute_paren = ignore # ignore/add/remove/force # Add or remove space between 'defined' and '(' in '#if defined (FOO)' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_defined_paren = ignore # ignore/add/remove/force # Add or remove space between 'throw' and '(' in 'throw (something)' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_throw_paren = ignore # ignore/add/remove/force # Add or remove space between macro and value -sp_macro = ignore # ignore/add/remove/force +sp_macro = remove # ignore/add/remove/force #force # Add or remove space between macro function ')' and value +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_macro_func = ignore # ignore/add/remove/force # Add or remove space between 'else' and '{' if on the same line -sp_else_brace = ignore # ignore/add/remove/force +sp_else_brace = add # ignore/add/remove/force # Add or remove space between '}' and 'else' if on the same line +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_brace_else = ignore # ignore/add/remove/force # Add or remove space between '}' and the name of a typedef on the same line +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_brace_typedef = ignore # ignore/add/remove/force # Add or remove space between 'catch' and '{' if on the same line +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_catch_brace = ignore # ignore/add/remove/force # Add or remove space between '}' and 'catch' if on the same line +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_brace_catch = ignore # ignore/add/remove/force # Add or remove space between 'finally' and '{' if on the same line +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_finally_brace = ignore # ignore/add/remove/force # Add or remove space between '}' and 'finally' if on the same line +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_brace_finally = ignore # ignore/add/remove/force # Add or remove space between 'try' and '{' if on the same line +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_try_brace = ignore # ignore/add/remove/force # Add or remove space between get/set and '{' if on the same line +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_getset_brace = ignore # ignore/add/remove/force # Add or remove space before the '::' operator +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_before_dc = ignore # ignore/add/remove/force # Add or remove space after the '::' operator +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_after_dc = ignore # ignore/add/remove/force # Add or remove around the D named array initializer ':' operator +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_d_array_colon = ignore # ignore/add/remove/force # Add or remove space after the '!' (not) operator. Default=Remove @@ -505,89 +605,109 @@ sp_inv = remove # ignore/add/remove/force # Add or remove space after the '&' (address-of) operator. Default=Remove # This does not affect the spacing after a '&' that is part of a type. -sp_addr = remove # ignore/add/remove/force +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_addr = ignore # ignore/add/remove/force # Add or remove space around the '.' or '->' operators. Default=Remove +# NOTE: is 4 worse than ignore sp_member = remove # ignore/add/remove/force # Add or remove space after the '*' (dereference) operator. Default=Remove # This does not affect the spacing after a '*' that is part of a type. -sp_deref = remove # ignore/add/remove/force +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_deref = ignore # ignore/add/remove/force # Add or remove space after '+' or '-', as in 'x = -5' or 'y = +7'. Default=Remove +# NOTE: is 2 worse than ignore sp_sign = remove # ignore/add/remove/force # Add or remove space before or after '++' and '--', as in '(--x)' or 'y++;'. Default=Remove sp_incdec = remove # ignore/add/remove/force # Add or remove space before a backslash-newline at the end of a line. Default=Add -sp_before_nl_cont = add # ignore/add/remove/force +sp_before_nl_cont = add # ignore/add/remove/force #force # Add or remove space after the scope '+' or '-', as in '-(void) foo;' or '+(int) bar;' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_after_oc_scope = ignore # ignore/add/remove/force # Add or remove space after the colon in message specs # '-(int) f:(int) x;' vs '-(int) f: (int) x;' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_after_oc_colon = ignore # ignore/add/remove/force # Add or remove space before the colon in message specs # '-(int) f: (int) x;' vs '-(int) f : (int) x;' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_before_oc_colon = ignore # ignore/add/remove/force # Add or remove space after the colon in message specs # '[object setValue:1];' vs '[object setValue: 1];' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_after_send_oc_colon = ignore # ignore/add/remove/force # Add or remove space before the colon in message specs # '[object setValue:1];' vs '[object setValue :1];' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_before_send_oc_colon = ignore # ignore/add/remove/force # Add or remove space after the (type) in message specs # '-(int)f: (int) x;' vs '-(int)f: (int)x;' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_after_oc_type = ignore # ignore/add/remove/force # Add or remove space after the first (type) in message specs # '-(int) f:(int)x;' vs '-(int)f:(int)x;' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_after_oc_return_type = ignore # ignore/add/remove/force # Add or remove space between '@selector' and '(' # '@selector(msgName)' vs '@selector (msgName)' # Also applies to @protocol() constructs +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_after_oc_at_sel = ignore # ignore/add/remove/force # Add or remove space between '@selector(x)' and the following word # '@selector(foo) a:' vs '@selector(foo)a:' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_after_oc_at_sel_parens = ignore # ignore/add/remove/force # Add or remove space inside '@selector' parens # '@selector(foo)' vs '@selector( foo )' # Also applies to @protocol() constructs +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_inside_oc_at_sel_parens = ignore # ignore/add/remove/force # Add or remove space before a block pointer caret # '^int (int arg){...}' vs. ' ^int (int arg){...}' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_before_oc_block_caret = ignore # ignore/add/remove/force # Add or remove space after a block pointer caret # '^int (int arg){...}' vs. '^ int (int arg){...}' +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_after_oc_block_caret = ignore # ignore/add/remove/force # Add or remove space around the ':' in 'b ? t : f' -sp_cond_colon = ignore # ignore/add/remove/force +sp_cond_colon = add # ignore/add/remove/force # Add or remove space around the '?' in 'b ? t : f' -sp_cond_question = ignore # ignore/add/remove/force +sp_cond_question = add # ignore/add/remove/force # Fix the spacing between 'case' and the label. Only 'ignore' and 'force' make sense here. +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_case_label = ignore # ignore/add/remove/force # Control the space around the D '..' operator. +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_range = ignore # ignore/add/remove/force # Control the space after the opening of a C++ comment '// A' vs '//A' -sp_cmt_cpp_start = ignore # ignore/add/remove/force +# NOTE: is 246 worse than ignore +sp_cmt_cpp_start = add # ignore/add/remove/force # Controls the spaces between #else or #endif and a trailing comment +# WARNING: Code doesn't seem to use this feature - delete from the config? sp_endif_cmt = ignore # ignore/add/remove/force # @@ -595,18 +715,22 @@ sp_endif_cmt = ignore # ignore/add/remove/force # # Whether to keep non-indenting tabs -align_keep_tabs = false # false/true +align_keep_tabs = false # false/true #force # Whether to use tabs for aligning +# WARNING: Code doesn't seem to use this feature - delete from the config? align_with_tabs = false # false/true # Whether to bump out to the next tab when aligning +# WARNING: Code doesn't seem to use this feature - delete from the config? align_on_tabstop = false # false/true # Whether to left-align numbers +# WARNING: Code doesn't seem to use this feature - delete from the config? align_number_left = false # false/true # Align variable definitions in prototypes and functions +# WARNING: Code doesn't seem to use this feature - delete from the config? align_func_params = false # false/true # Align parameters in single-line functions that have the same name. @@ -620,114 +744,142 @@ align_var_def_span = 0 # number # 0=Part of the type 'void * foo;' # 1=Part of the variable 'void *foo;' # 2=Dangling 'void *foo;' +# WARNING: Code doesn't seem to use this feature - delete from the config? align_var_def_star_style = 0 # number # How to align the '&' in variable definitions. # 0=Part of the type # 1=Part of the variable # 2=Dangling +# WARNING: Code doesn't seem to use this feature - delete from the config? align_var_def_amp_style = 0 # number # The threshold for aligning variable definitions (0=no limit) +# WARNING: Code doesn't seem to use this feature - delete from the config? align_var_def_thresh = 0 # number # The gap for aligning variable definitions +# WARNING: Code doesn't seem to use this feature - delete from the config? align_var_def_gap = 0 # number # Whether to align the colon in struct bit fields +# WARNING: Code doesn't seem to use this feature - delete from the config? align_var_def_colon = false # false/true # Whether to align any attribute after the variable name +# WARNING: Code doesn't seem to use this feature - delete from the config? align_var_def_attribute = false # false/true # Whether to align inline struct/enum/union variable definitions +# WARNING: Code doesn't seem to use this feature - delete from the config? align_var_def_inline = false # false/true # The span for aligning on '=' in assignments (0=don't align) align_assign_span = 0 # number # The threshold for aligning on '=' in assignments (0=no limit) +# WARNING: Code doesn't seem to use this feature - delete from the config? align_assign_thresh = 0 # number # The span for aligning on '=' in enums (0=don't align) +# WARNING: Code doesn't seem to use this feature - delete from the config? align_enum_equ_span = 0 # number # The threshold for aligning on '=' in enums (0=no limit) +# WARNING: Code doesn't seem to use this feature - delete from the config? align_enum_equ_thresh = 0 # number # The span for aligning struct/union (0=don't align) align_var_struct_span = 0 # number # The threshold for aligning struct/union member definitions (0=no limit) +# WARNING: Code doesn't seem to use this feature - delete from the config? align_var_struct_thresh = 0 # number # The gap for aligning struct/union member definitions +# WARNING: Code doesn't seem to use this feature - delete from the config? align_var_struct_gap = 0 # number # The span for aligning struct initializer values (0=don't align) +# WARNING: Code doesn't seem to use this feature - delete from the config? align_struct_init_span = 0 # number # The minimum space between the type and the synonym of a typedef +# WARNING: Code doesn't seem to use this feature - delete from the config? align_typedef_gap = 0 # number # The span for aligning single-line typedefs (0=don't align) +# WARNING: Code doesn't seem to use this feature - delete from the config? align_typedef_span = 0 # number # How to align typedef'd functions with other typedefs # 0: Don't mix them at all # 1: align the open paren with the types # 2: align the function type name with the other type names +# WARNING: Code doesn't seem to use this feature - delete from the config? align_typedef_func = 0 # number # Controls the positioning of the '*' in typedefs. Just try it. # 0: Align on typedef type, ignore '*' # 1: The '*' is part of type name: typedef int *pint; # 2: The '*' is part of the type, but dangling: typedef int *pint; +# WARNING: Code doesn't seem to use this feature - delete from the config? align_typedef_star_style = 0 # number # Controls the positioning of the '&' in typedefs. Just try it. # 0: Align on typedef type, ignore '&' # 1: The '&' is part of type name: typedef int &pint; # 2: The '&' is part of the type, but dangling: typedef int &pint; +# WARNING: Code doesn't seem to use this feature - delete from the config? align_typedef_amp_style = 0 # number # The span for aligning comments that end lines (0=don't align) align_right_cmt_span = 0 # number # If aligning comments, mix with comments after '}' and #endif with less than 3 spaces before the comment +# WARNING: Code doesn't seem to use this feature - delete from the config? align_right_cmt_mix = false # false/true # If a trailing comment is more than this number of columns away from the text it follows, # it will qualify for being aligned. This has to be > 0 to do anything. +# WARNING: Code doesn't seem to use this feature - delete from the config? align_right_cmt_gap = 0 # number # Align trailing comment at or beyond column N; 'pulls in' comments as a bonus side effect (0=ignore) +# WARNING: Code doesn't seem to use this feature - delete from the config? align_right_cmt_at_col = 0 # number # The span for aligning function prototypes (0=don't align) align_func_proto_span = 0 # number # Minimum gap between the return type and the function name. +# WARNING: Code doesn't seem to use this feature - delete from the config? align_func_proto_gap = 0 # number # Align function protos on the 'operator' keyword instead of what follows +# WARNING: Code doesn't seem to use this feature - delete from the config? align_on_operator = false # false/true # Whether to mix aligning prototype and variable declarations. # If true, align_var_def_XXX options are used instead of align_func_proto_XXX options. +# WARNING: Code doesn't seem to use this feature - delete from the config? align_mix_var_proto = false # false/true # Align single-line functions with function prototypes, uses align_func_proto_span +# WARNING: Code doesn't seem to use this feature - delete from the config? align_single_line_func = false # false/true # Aligning the open brace of single-line functions. # Requires align_single_line_func=true, uses align_func_proto_span +# WARNING: Code doesn't seem to use this feature - delete from the config? align_single_line_brace = false # false/true # Gap for align_single_line_brace. +# WARNING: Code doesn't seem to use this feature - delete from the config? align_single_line_brace_gap = 0 # number # The span for aligning ObjC msg spec (0=don't align) +# WARNING: Code doesn't seem to use this feature - delete from the config? align_oc_msg_spec_span = 0 # number # Whether to align macros wrapped with a backslash and a newline. @@ -735,18 +887,22 @@ align_oc_msg_spec_span = 0 # number align_nl_cont = false # false/true # The minimum space between label and value of a preprocessor define +# WARNING: Code doesn't seem to use this feature - delete from the config? align_pp_define_gap = 0 # number # The span for aligning on '#define' bodies (0=don't align) align_pp_define_span = 0 # number # Align lines that start with '<<' with previous '<<'. Default=true -align_left_shift = true # false/true +# WARNING: Code doesn't seem to use this feature - delete from the config? +align_left_shift = false # false/true # Span for aligning parameters in an Obj-C message call on the ':' (0=don't align) +# WARNING: Code doesn't seem to use this feature - delete from the config? align_oc_msg_colon_span = 0 # number # Aligning parameters in an Obj-C '+' or '-' declaration on the ':' +# WARNING: Code doesn't seem to use this feature - delete from the config? align_oc_decl_colon = false # false/true # @@ -757,118 +913,142 @@ align_oc_decl_colon = false # false/true nl_collapse_empty_body = false # false/true # Don't split one-line braced assignments - 'foo_t f = { 1, 2 };' +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_assign_leave_one_liners = false # false/true # Don't split one-line braced statements inside a class xx { } body +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_class_leave_one_liners = false # false/true # Don't split one-line enums: 'enum foo { BAR = 15 };' +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_enum_leave_one_liners = false # false/true # Don't split one-line get or set functions +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_getset_leave_one_liners = false # false/true # Don't split one-line function definitions - 'int foo() { return 0; }' -nl_func_leave_one_liners = false # false/true +nl_func_leave_one_liners = true # false/true # Don't split one-line if/else statements - 'if(a) b++;' nl_if_leave_one_liners = true # false/true # Add or remove newlines at the start of the file -nl_start_of_file = ignore # ignore/add/remove/force +nl_start_of_file = remove # ignore/add/remove/force #force # The number of newlines at the start of the file (only used if nl_start_of_file is 'add' or 'force' +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_start_of_file_min = 0 # number # Add or remove newline at the end of the file -nl_end_of_file = ignore # ignore/add/remove/force +nl_end_of_file = add # ignore/add/remove/force # The number of newlines at the end of the file (only used if nl_end_of_file is 'add' or 'force') nl_end_of_file_min = 0 # number # Add or remove newline between '=' and '{' +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_assign_brace = ignore # ignore/add/remove/force # Add or remove newline between '=' and '[' (D only) +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_assign_square = ignore # ignore/add/remove/force # Add or remove newline after '= [' (D only). Will also affect the newline before the ']' +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_after_square_assign = ignore # ignore/add/remove/force # The number of blank lines after a block of variable definitions -nl_func_var_def_blk = 0 # number +nl_func_var_def_blk = 0 # number #force # Add or remove newline between a function call's ')' and '{', as in: # list_for_each(item, &list) { } -nl_fcall_brace = ignore # ignore/add/remove/force +nl_fcall_brace = add # ignore/add/remove/force # Add or remove newline between 'enum' and '{' +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_enum_brace = ignore # ignore/add/remove/force # Add or remove newline between 'struct and '{' +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_struct_brace = ignore # ignore/add/remove/force # Add or remove newline between 'union' and '{' +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_union_brace = ignore # ignore/add/remove/force # Add or remove newline between 'if' and '{' -nl_if_brace = ignore # ignore/add/remove/force +# NOTE: is 120 worse than ignore +nl_if_brace = add # ignore/add/remove/force # Add or remove newline between '}' and 'else' -nl_brace_else = ignore # ignore/add/remove/force +nl_brace_else = add # ignore/add/remove/force # Add or remove newline between 'else if' and '{' # If set to ignore, nl_if_brace is used instead -nl_elseif_brace = ignore # ignore/add/remove/force +nl_elseif_brace = add # ignore/add/remove/force # Add or remove newline between 'else' and '{' -nl_else_brace = ignore # ignore/add/remove/force +nl_else_brace = add # ignore/add/remove/force # Add or remove newline between 'else' and 'if' -nl_else_if = ignore # ignore/add/remove/force +nl_else_if = remove # ignore/add/remove/force # Add or remove newline between '}' and 'finally' +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_brace_finally = ignore # ignore/add/remove/force # Add or remove newline between 'finally' and '{' +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_finally_brace = ignore # ignore/add/remove/force # Add or remove newline between 'try' and '{' +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_try_brace = ignore # ignore/add/remove/force # Add or remove newline between get/set and '{' +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_getset_brace = ignore # ignore/add/remove/force # Add or remove newline between 'for' and '{' -nl_for_brace = ignore # ignore/add/remove/force +# NOTE: is 23 worse than ignore +nl_for_brace = add # ignore/add/remove/force # Add or remove newline between 'catch' and '{' +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_catch_brace = ignore # ignore/add/remove/force # Add or remove newline between '}' and 'catch' +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_brace_catch = ignore # ignore/add/remove/force # Add or remove newline between 'while' and '{' -nl_while_brace = ignore # ignore/add/remove/force +# NOTE: is 8 worse than ignore +nl_while_brace = add # ignore/add/remove/force # Add or remove newline between 'using' and '{' +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_using_brace = ignore # ignore/add/remove/force # Add or remove newline between two open or close braces. # Due to general newline/brace handling, REMOVE may not work. +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_brace_brace = ignore # ignore/add/remove/force # Add or remove newline between 'do' and '{' -nl_do_brace = ignore # ignore/add/remove/force +nl_do_brace = add # ignore/add/remove/force # Add or remove newline between '}' and 'while' of 'do' statement -nl_brace_while = ignore # ignore/add/remove/force +nl_brace_while = add # ignore/add/remove/force #force # Add or remove newline between 'switch' and '{' -nl_switch_brace = ignore # ignore/add/remove/force +# NOTE: is 20 worse than ignore +nl_switch_brace = add # ignore/add/remove/force # Add a newline between ')' and '{' if the ')' is on a different line than the if/for/etc. # Overrides nl_for_brace, nl_if_brace, nl_switch_brace, nl_while_switch, and nl_catch_brace. +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_multi_line_cond = false # false/true # Force a newline in a define after the macro name for multi-line defines. @@ -878,160 +1058,178 @@ nl_multi_line_define = false # false/true nl_before_case = false # false/true # Add or remove newline between ')' and 'throw' +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_before_throw = ignore # ignore/add/remove/force # Whether to put a newline after 'case' statement nl_after_case = false # false/true # Newline between namespace and { +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_namespace_brace = ignore # ignore/add/remove/force # Add or remove newline between 'template<>' and whatever follows. +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_template_class = ignore # ignore/add/remove/force # Add or remove newline between 'class' and '{' +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_class_brace = ignore # ignore/add/remove/force # Add or remove newline after each ',' in the constructor member initialization +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_class_init_args = ignore # ignore/add/remove/force # Add or remove newline between return type and function name in a function definition -nl_func_type_name = ignore # ignore/add/remove/force +nl_func_type_name = remove # ignore/add/remove/force # Add or remove newline between return type and function name inside a class {} # Uses nl_func_type_name or nl_func_proto_type_name if set to ignore. +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_func_type_name_class = ignore # ignore/add/remove/force # Add or remove newline between function scope and name in a definition # Controls the newline after '::' in 'void A::f() { }' +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_func_scope_name = ignore # ignore/add/remove/force # Add or remove newline between return type and function name in a prototype -nl_func_proto_type_name = ignore # ignore/add/remove/force +# NOTE: is 1 worse than ignore +nl_func_proto_type_name = remove # ignore/add/remove/force # Add or remove newline between a function name and the opening '(' -nl_func_paren = ignore # ignore/add/remove/force +nl_func_paren = remove # ignore/add/remove/force # Add or remove newline between a function name and the opening '(' in the definition -nl_func_def_paren = ignore # ignore/add/remove/force +nl_func_def_paren = remove # ignore/add/remove/force # Add or remove newline after '(' in a function declaration -nl_func_decl_start = ignore # ignore/add/remove/force +nl_func_decl_start = remove # ignore/add/remove/force # Add or remove newline after '(' in a function definition -nl_func_def_start = ignore # ignore/add/remove/force +nl_func_def_start = remove # ignore/add/remove/force -# Overrides nl_func_decl_start when there is only one parameter. -nl_func_decl_start_single = ignore # ignore/add/remove/force - -# Overrides nl_func_def_start when there is only one parameter. -nl_func_def_start_single = ignore # ignore/add/remove/force +# # Overrides nl_func_decl_start when there is only one parameter. +# nl_func_decl_start_single = ignore # ignore/add/remove/force +# +# # Overrides nl_func_def_start when there is only one parameter. +# nl_func_def_start_single = ignore # ignore/add/remove/force # Add or remove newline after each ',' in a function declaration -nl_func_decl_args = ignore # ignore/add/remove/force +nl_func_decl_args = remove # ignore/add/remove/force # Add or remove newline after each ',' in a function definition -nl_func_def_args = ignore # ignore/add/remove/force +nl_func_def_args = remove # ignore/add/remove/force # Add or remove newline before the ')' in a function declaration -nl_func_decl_end = ignore # ignore/add/remove/force +nl_func_decl_end = remove # ignore/add/remove/force # Add or remove newline before the ')' in a function definition -nl_func_def_end = ignore # ignore/add/remove/force +nl_func_def_end = remove # ignore/add/remove/force -# Overrides nl_func_decl_end when there is only one parameter. -nl_func_decl_end_single = ignore # ignore/add/remove/force - -# Overrides nl_func_def_end when there is only one parameter. -nl_func_def_end_single = ignore # ignore/add/remove/force +# # Overrides nl_func_decl_end when there is only one parameter. +# nl_func_decl_end_single = ignore # ignore/add/remove/force +# +# # Overrides nl_func_def_end when there is only one parameter. +# nl_func_def_end_single = ignore # ignore/add/remove/force # Add or remove newline between '()' in a function declaration. -nl_func_decl_empty = ignore # ignore/add/remove/force +nl_func_decl_empty = remove # ignore/add/remove/force # Add or remove newline between '()' in a function definition. -nl_func_def_empty = ignore # ignore/add/remove/force +nl_func_def_empty = remove # ignore/add/remove/force # Add or remove newline between function signature and '{' -nl_fdef_brace = ignore # ignore/add/remove/force +# NOTE: is 27 worse than ignore +nl_fdef_brace = add # ignore/add/remove/force # Whether to put a newline after 'return' statement nl_after_return = false # false/true # Add or remove a newline between the return keyword and return expression. -nl_return_expr = ignore # ignore/add/remove/force +# NOTE: is 2 worse than ignore +nl_return_expr = remove # ignore/add/remove/force # Whether to put a newline after semicolons, except in 'for' statements nl_after_semicolon = false # false/true # Whether to put a newline after brace open. # This also adds a newline before the matching brace close. -nl_after_brace_open = true # false/true +# WARNING: Code doesn't seem to use this feature - delete from the config? +nl_after_brace_open = false # false/true # If nl_after_brace_open and nl_after_brace_open_cmt are true, a newline is # placed between the open brace and a trailing single-line comment. +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_after_brace_open_cmt = false # false/true # Whether to put a newline after a virtual brace open with a non-empty body. # These occur in un-braced if/while/do/for statement bodies. -nl_after_vbrace_open = true # false/true +# WARNING: Code doesn't seem to use this feature - delete from the config? +nl_after_vbrace_open = false # false/true # Whether to put a newline after a virtual brace open with an empty body. # These occur in un-braced if/while/do/for statement bodies. +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_after_vbrace_open_empty = false # false/true # Whether to put a newline after a brace close. # Does not apply if followed by a necessary ';'. -nl_after_brace_close = true # false/true +nl_after_brace_close = false # false/true # Whether to put a newline after a virtual brace close. # Would add a newline before return in: 'if (foo) a++; return;' -nl_after_vbrace_close = true # false/true +nl_after_vbrace_close = false # false/true # Whether to alter newlines in '#define' macros -nl_define_macro = false # false/true +nl_define_macro = true # false/true # Whether to not put blanks after '#ifxx', '#elxx', or before '#endif' +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_squeeze_ifdef = false # false/true # Add or remove blank line before 'if' -nl_before_if = ignore # ignore/add/remove/force +nl_before_if = ignore # ignore/add/remove/force #force # Add or remove blank line after 'if' statement -nl_after_if = ignore # ignore/add/remove/force +nl_after_if = ignore # ignore/add/remove/force #force # Add or remove blank line before 'for' -nl_before_for = ignore # ignore/add/remove/force +nl_before_for = ignore # ignore/add/remove/force #force # Add or remove blank line after 'for' statement -nl_after_for = ignore # ignore/add/remove/force +nl_after_for = ignore # ignore/add/remove/force #force # Add or remove blank line before 'while' -nl_before_while = ignore # ignore/add/remove/force +nl_before_while = ignore # ignore/add/remove/force #force # Add or remove blank line after 'while' statement -nl_after_while = ignore # ignore/add/remove/force +nl_after_while = ignore # ignore/add/remove/force #force # Add or remove blank line before 'switch' -nl_before_switch = ignore # ignore/add/remove/force +nl_before_switch = ignore # ignore/add/remove/force #force # Add or remove blank line after 'switch' statement -nl_after_switch = ignore # ignore/add/remove/force +nl_after_switch = ignore # ignore/add/remove/force #force # Add or remove blank line before 'do' -nl_before_do = ignore # ignore/add/remove/force +nl_before_do = ignore # ignore/add/remove/force #force # Add or remove blank line after 'do/while' statement -nl_after_do = ignore # ignore/add/remove/force +nl_after_do = ignore # ignore/add/remove/force #force # Whether to double-space commented-entries in struct/enum +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_ds_struct_enum_cmt = false # false/true # Whether to double-space before the close brace of a struct/union/enum # (lower priority than 'eat_blanks_before_close_brace') +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_ds_struct_enum_close_brace = false # false/true # Add or remove a newline around a class colon. # Related to pos_class_colon, nl_class_init_args, and pos_comma. +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_class_colon = ignore # ignore/add/remove/force # Change simple unbraced if statements into a one-liner @@ -1051,28 +1249,31 @@ nl_create_while_one_liner = false # false/true # # The position of arithmetic operators in wrapped expressions -pos_arith = ignore # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force +pos_arith = lead # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of assignment in wrapped expressions. # Do not affect '=' followed by '{' -pos_assign = ignore # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force +pos_assign = trail # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of boolean operators in wrapped expressions -pos_bool = ignore # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force +pos_bool = lead # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of comparison operators in wrapped expressions +# WARNING: Best is not unique (lead trail) pos_compare = ignore # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of conditional (b ? t : f) operators in wrapped expressions -pos_conditional = ignore # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force +pos_conditional = trail # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of the comma in wrapped expressions -pos_comma = ignore # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force +pos_comma = trail # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of the comma in the constructor initialization list +# WARNING: Code doesn't seem to use this feature - delete from the config? pos_class_comma = ignore # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of colons between constructor and member initialization +# WARNING: Code doesn't seem to use this feature - delete from the config? pos_class_colon = ignore # ignore/lead/lead_break/lead_force/trail/trail_break/trail_force # @@ -1083,9 +1284,11 @@ pos_class_colon = ignore # ignore/lead/lead_break/lea code_width = 0 # number # Whether to fully split long 'for' statements at semi-colons +# WARNING: Code doesn't seem to use this feature - delete from the config? ls_for_split_full = false # false/true # Whether to fully split long function protos/calls at commas +# WARNING: Code doesn't seem to use this feature - delete from the config? ls_func_split_full = false # false/true # @@ -1093,105 +1296,124 @@ ls_func_split_full = false # false/true # # The maximum consecutive newlines -nl_max = 3 # number +nl_max = 3 # number #force # The number of newlines after a function prototype, if followed by another function prototype +# WARNING: Best is not unique (0 1) nl_after_func_proto = 0 # number # The number of newlines after a function prototype, if not followed by another function prototype +# WARNING: Best is not unique (0 1) nl_after_func_proto_group = 0 # number # The number of newlines after '}' of a multi-line function body nl_after_func_body = 0 # number # The number of newlines after '}' of a single line function body +# WARNING: Best is not unique (0 1) nl_after_func_body_one_liner = 0 # number # The minimum number of newlines before a multi-line comment. # Doesn't apply if after a brace open or another multi-line comment. +# WARNING: Best is not unique (0 1) nl_before_block_comment = 0 # number # The minimum number of newlines before a single-line C comment. # Doesn't apply if after a brace open or other single-line C comments. +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_before_c_comment = 0 # number # The minimum number of newlines before a CPP comment. # Doesn't apply if after a brace open or other CPP comments. +# WARNING: Best is not unique (0 1) nl_before_cpp_comment = 0 # number # Whether to force a newline after a multi-line comment. +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_after_multiline_comment = false # false/true # The number of newlines before a 'private:', 'public:', 'protected:', 'signals:', or 'slots:' label. # Will not change the newline count if after a brace open. # 0 = No change. +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_before_access_spec = 0 # number # The number of newlines after a 'private:', 'public:', 'protected:', 'signals:', or 'slots:' label. # 0 = No change. +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_after_access_spec = 0 # number # The number of newlines between a function def and the function comment. # 0 = No change. +# WARNING: Best is not unique (0 2) nl_comment_func_def = 0 # number # The number of newlines after a try-catch-finally block that isn't followed by a brace close. # 0 = No change. +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_after_try_catch_finally = 0 # number # The number of newlines before and after a property, indexer or event decl. # 0 = No change. +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_around_cs_property = 0 # number # The number of newlines between the get/set/add/remove handlers in C#. # 0 = No change. +# WARNING: Code doesn't seem to use this feature - delete from the config? nl_between_get_set = 0 # number # Whether to remove blank lines after '{' -eat_blanks_after_open_brace = false # false/true +eat_blanks_after_open_brace = true # false/true #force # Whether to remove blank lines before '}' -eat_blanks_before_close_brace = false # false/true +eat_blanks_before_close_brace = true # false/true #force # # Code modifying options (non-whitespace) # # Add or remove braces on single-line 'do' statement -mod_full_brace_do = ignore # ignore/add/remove/force +mod_full_brace_do = add # ignore/add/remove/force # Add or remove braces on single-line 'for' statement -mod_full_brace_for = ignore # ignore/add/remove/force +# NOTE: is 16 worse than ignore +mod_full_brace_for = remove # ignore/add/remove/force # Add or remove braces on single-line function definitions. (Pawn) +# WARNING: Code doesn't seem to use this feature - delete from the config? mod_full_brace_function = ignore # ignore/add/remove/force # Add or remove braces on single-line 'if' statement. Will not remove the braces if they contain an 'else'. -mod_full_brace_if = ignore # ignore/add/remove/force +# NOTE: is 35 worse than ignore +mod_full_brace_if = remove # ignore/add/remove/force # Make all if/elseif/else statements in a chain be braced or not. Overrides mod_full_brace_if. # If any must be braced, they are all braced. If all can be unbraced, then the braces are removed. -mod_full_brace_if_chain = false # false/true +mod_full_brace_if_chain = true # false/true #force # Don't remove braces around statements that span N newlines -mod_full_brace_nl = 0 # number +mod_full_brace_nl = 2 # number #force # Add or remove braces on single-line 'while' statement -mod_full_brace_while = ignore # ignore/add/remove/force +mod_full_brace_while = remove # ignore/add/remove/force # Add or remove braces on single-line 'using ()' statement +# WARNING: Code doesn't seem to use this feature - delete from the config? mod_full_brace_using = ignore # ignore/add/remove/force # Add or remove unnecessary paren on 'return' statement -mod_paren_on_return = ignore # ignore/add/remove/force +mod_paren_on_return = remove # ignore/add/remove/force # Whether to change optional semicolons to real semicolons +# WARNING: Code doesn't seem to use this feature - delete from the config? mod_pawn_semicolon = false # false/true # Add parens on 'while' and 'if' statement around bools mod_full_paren_if_bool = false # false/true # Whether to remove superfluous semicolons +# WARNING: Code doesn't seem to use this feature - delete from the config? mod_remove_extra_semicolon = false # false/true # If a function body exceeds the specified number of newlines and doesn't have a comment after @@ -1211,24 +1433,29 @@ mod_add_long_ifdef_endif_comment = 0 # number mod_add_long_ifdef_else_comment = 0 # number # If TRUE, will sort consecutive single-line 'import' statements [Java, D] +# WARNING: Code doesn't seem to use this feature - delete from the config? mod_sort_import = false # false/true # If TRUE, will sort consecutive single-line 'using' statements [C#] +# WARNING: Code doesn't seem to use this feature - delete from the config? mod_sort_using = false # false/true # If TRUE, will sort consecutive single-line '#include' statements [C/C++] and '#import' statements [Obj-C] # This is generally a bad idea, as it may break your code. +# WARNING: Code doesn't seem to use this feature - delete from the config? mod_sort_include = false # false/true # If TRUE, it will move a 'break' that appears after a fully braced 'case' before the close brace. -mod_move_case_break = true # false/true +# WARNING: Code doesn't seem to use this feature - delete from the config? +mod_move_case_break = false # false/true # Will add or remove the braces around a fully braced case statement. # Will only remove the braces if there are no variable declarations in the block. -mod_case_brace = ignore # ignore/add/remove/force +# NOTE: is 41 worse than ignore +mod_case_brace = remove # ignore/add/remove/force # If TRUE, it will remove a void 'return;' that appears as the last statement in a function. -mod_remove_empty_return = true # false/true +mod_remove_empty_return = true # false/true #force # # Comment modifications @@ -1241,66 +1468,82 @@ cmt_width = 0 # number # 0: no reflowing (apart from the line wrapping due to cmt_width) # 1: no touching at all # 2: full reflow -cmt_reflow_mode = 1 # number +# WARNING: Code doesn't seem to use this feature - delete from the config? +cmt_reflow_mode = 0 # number # If false, disable all multi-line comment changes, including cmt_width. keyword substitution, and leading chars. # Default is true. -cmt_indent_multi = true # false/true +cmt_indent_multi = false # false/true # Whether to group c-comments that look like they are in a block +# WARNING: Code doesn't seem to use this feature - delete from the config? cmt_c_group = false # false/true # Whether to put an empty '/*' on the first line of the combined c-comment +# WARNING: Code doesn't seem to use this feature - delete from the config? cmt_c_nl_start = false # false/true # Whether to put a newline before the closing '*/' of the combined c-comment +# WARNING: Code doesn't seem to use this feature - delete from the config? cmt_c_nl_end = false # false/true # Whether to group cpp-comments that look like they are in a block +# WARNING: Code doesn't seem to use this feature - delete from the config? cmt_cpp_group = false # false/true # Whether to put an empty '/*' on the first line of the combined cpp-comment +# WARNING: Code doesn't seem to use this feature - delete from the config? cmt_cpp_nl_start = false # false/true # Whether to put a newline before the closing '*/' of the combined cpp-comment +# WARNING: Code doesn't seem to use this feature - delete from the config? cmt_cpp_nl_end = false # false/true # Whether to change cpp-comments into c-comments cmt_cpp_to_c = false # false/true # Whether to put a star on subsequent comment lines +# WARNING: Code doesn't seem to use this feature - delete from the config? cmt_star_cont = false # false/true # The number of spaces to insert at the start of subsequent comment lines +# WARNING: Code doesn't seem to use this feature - delete from the config? cmt_sp_before_star_cont = 0 # number # The number of spaces to insert after the star on subsequent comment lines +# WARNING: Code doesn't seem to use this feature - delete from the config? cmt_sp_after_star_cont = 0 # number # For multi-line comments with a '*' lead, remove leading spaces if the first and last lines of # the comment are the same length. Default=True -cmt_multi_check_last = true # false/true +# WARNING: Code doesn't seem to use this feature - delete from the config? +cmt_multi_check_last = false # false/true # The filename that contains text to insert at the head of a file if the file doesn't start with a C/C++ comment. # Will substitute $(filename) with the current file's name. +# WARNING: unsupported string cmt_insert_file_header = "" # string # The filename that contains text to insert at the end of a file if the file doesn't end with a C/C++ comment. # Will substitute $(filename) with the current file's name. +# WARNING: unsupported string cmt_insert_file_footer = "" # string # The filename that contains text to insert before a function implementation if the function isn't preceded with a C/C++ comment. # Will substitute $(function) with the function name and $(javaparam) with the javadoc @param and @return stuff. # Will also substitute $(fclass) with the class name: void CFoo::Bar() { ... } +# WARNING: unsupported string cmt_insert_func_header = "" # string # The filename that contains text to insert before a class if the class isn't preceded with a C/C++ comment. # Will substitute $(class) with the class name. +# WARNING: unsupported string cmt_insert_class_header = "" # string # If a preprocessor is encountered when stepping backwards from a function name, then # this option decides whether the comment should be inserted. # Affects cmt_insert_func_header and cmt_insert_class_header. +# WARNING: Code doesn't seem to use this feature - delete from the config? cmt_insert_before_preproc = false # false/true # @@ -1308,27 +1551,33 @@ cmt_insert_before_preproc = false # false/true # # Control indent of preprocessors inside #if blocks at brace level 0 +# WARNING: Indifferent... please decide manually. pp_indent = ignore # ignore/add/remove/force # Whether to indent #if/#else/#endif at the brace level (true) or from column 1 (false) pp_indent_at_level = false # false/true # If pp_indent_at_level=false, specifies the number of columns to indent per level. Default=1. -pp_indent_count = 1 # number +# WARNING: Code doesn't seem to use this feature - delete from the config? +pp_indent_count = 0 # number # Add or remove space after # based on pp_level of #if blocks -pp_space = ignore # ignore/add/remove/force +pp_space = remove # ignore/add/remove/force # Sets the number of spaces added with pp_space +# WARNING: Code doesn't seem to use this feature - delete from the config? pp_space_count = 0 # number # The indent for #region and #endregion in C# and '#pragma region' in C/C++ +# WARNING: Code doesn't seem to use this feature - delete from the config? pp_indent_region = 0 # number # Whether to indent the code between #region and #endregion +# WARNING: Code doesn't seem to use this feature - delete from the config? pp_region_indent_code = false # false/true # If pp_indent_at_level=true, sets the indent for #if, #else, and #endif when not at file-level +# WARNING: Code doesn't seem to use this feature - delete from the config? pp_indent_if = 0 # number # Control whether to indent the code between #if, #else and #endif when not at file-level diff --git a/qcsrc/warpzonelib/server.qc b/qcsrc/warpzonelib/server.qc index 0075bc849..d25c769b0 100644 --- a/qcsrc/warpzonelib/server.qc +++ b/qcsrc/warpzonelib/server.qc @@ -809,22 +809,22 @@ void WarpZone_StartFrame() for(e = world; (e = nextent(e)); ) { if(warpzone_warpzones_exist) { WarpZone_StoreProjectileData(e); } - + if(IS_REAL_CLIENT(e)) { if(e.solid == SOLID_NOT) // not spectating? if(e.movetype == MOVETYPE_NOCLIP || e.movetype == MOVETYPE_FLY || e.movetype == MOVETYPE_FLY_WORLDONLY) // not spectating? (this is to catch observers) { other = e; // player - + // warpzones - if(warpzone_warpzones_exist) { - self = WarpZone_Find(e.origin + e.mins, e.origin + e.maxs); + if(warpzone_warpzones_exist) { + self = WarpZone_Find(e.origin + e.mins, e.origin + e.maxs); if(self) if(!WarpZoneLib_ExactTrigger_Touch()) if(WarpZone_PlaneDist(self, e.origin + e.view_ofs) <= 0) WarpZone_Teleport(self, e, -1, 0); } // NOT triggering targets by this! - + // teleporters self = Teleport_Find(e.origin + e.mins, e.origin + e.maxs); if(self) @@ -832,7 +832,7 @@ void WarpZone_StartFrame() Simple_TeleportPlayer(self, other); // NOT triggering targets by this! } } - + if(IS_NOT_A_CLIENT(e)) { if(warpzone_warpzones_exist)