From: Samual Lenks Date: Sun, 24 Nov 2013 04:55:13 +0000 (-0500) Subject: Merge remote-tracking branch 'origin/samual/serverlist' X-Git-Tag: xonotic-v0.8.0~256 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=e0ac5f9f14e169a1e19d0e36b85cab061a74ed93;hp=bc20da5a3271b337049a25f68ddecad472b8db98 Merge remote-tracking branch 'origin/samual/serverlist' * origin/samual/serverlist: (63 commits) Use new cvar check URL; kill CVAR_POPCON. Show recommended servers when categories are disabled too Add a compatibility stop date to the update notification info. Fix my breaking of emergency pk3's :D ARGH, that really was a STUPID bug. Make APPEND_STRING behave "sane". Some cleanup Properly handle the cvars for serverlist categories now Support promoted servers in the recommendations Switch to new format for updatenotification Switch to recommendation mode 3 Rename "Bookmark" button to "Favorite" button (it's called favorites...) Adjustments to category rendering- left align with colon over servername Simplify a LOT. Refactor item position code. Should be easier to adapt to new category handling. ONE BYTE. Fix bug in begin handling. Bottom align the headings. Give the headings 1.5 rows height. use a proper binary search ... Conflicts: qcsrc/menu/xonotic/serverlist.c qcsrc/menu/xonotic/util.qc --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 64a542c863..dd16de9bc6 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -400,7 +400,6 @@ pausable 0 set g_spawnshieldtime 1 "number of seconds you are invincible after you spawned, this shield is lost after you fire" set g_antilag 2 "AntiLag (0 = no AntiLag, 1 = verified client side hit scan, 2 = server side hit scan in the past, 3 = unverified client side hit scan)" set g_antilag_nudge 0 "don't touch" -set g_antilag_bullets 1 "Bullets AntiLag (0 = no AntiLag, 1 = server side hit scan in the past) - DO NOT TOUCH (severely changes weapon balance)" set g_shootfromclient 2 "let client decide if it has the gun left or right; if set to 2, center handedness is allowed; see also cl_gunalign" set g_shootfromeye 0 "shots are fired from your eye/crosshair; visual gun position can still be influenced by cl_gunalign 1 and 2" set g_shootfromcenter 0 "weapon gets moved to the center, shots still come from the barrel of your weapon; visual gun position can still be influenced by cl_gunalign 1 and 2" @@ -465,6 +464,7 @@ set g_spawn_furthest 1 "this amount of the spawns shall be far away from any pla set g_spawn_useallspawns 0 "use all spawns, e.g. also team spawns in non-teamplay, and all spawns, even enemy spawns, in teamplay" // respawn delay set g_respawn_delay 2 "number of seconds you have to wait before you can respawn again" +set g_respawn_delay_max 0 "number of seconds you can wait before you're forced to respawn (only effective with g_forced_respawn 1)" set g_respawn_waves 0 "respawn in waves (every n seconds), intended to decrease overwhelming base attacks" // overtime @@ -1436,7 +1436,7 @@ sv_cullentities_trace 1 r_cullentities_trace 0 // less "lagging" of other players, but also less PL tolerant... let's try this -sv_clmovement_inputtimeout 0.04 // more than 1, less than 2 server frames +sv_clmovement_inputtimeout 0.066 // slightly less than 2 frames, so only one frame can be compensated // exact gloss looks better, e.g. on g-23 r_shadow_glossexact 1 diff --git a/gamemodes.cfg b/gamemodes.cfg index 665fa55849..feed7488b5 100644 --- a/gamemodes.cfg +++ b/gamemodes.cfg @@ -27,7 +27,6 @@ alias cl_hook_gamestart_tdm alias cl_hook_gamestart_dom alias cl_hook_gamestart_ctf alias cl_hook_gamestart_lms -alias cl_hook_gamestart_arena alias cl_hook_gamestart_ca alias cl_hook_gamestart_kh alias cl_hook_gamestart_ons @@ -48,7 +47,6 @@ alias sv_hook_gamestart_tdm alias sv_hook_gamestart_dom alias sv_hook_gamestart_ctf alias sv_hook_gamestart_lms -alias sv_hook_gamestart_arena alias sv_hook_gamestart_ca alias sv_hook_gamestart_kh alias sv_hook_gamestart_ons @@ -73,8 +71,6 @@ seta fraglimit_override -1 "Frag limit overriding the mapinfo specified one (use seta leadlimit_override -1 "Lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" seta capturelimit_override -1 "Capture limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" seta captureleadlimit_override -1 "Capture llead imit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" -seta g_arena_point_limit -1 "Arena point limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" -seta g_arena_point_leadlimit -1 "Arena point lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" seta g_domination_point_limit -1 "Domination point limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" seta g_domination_point_leadlimit -1 "Domination point lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" seta g_keyhunt_point_limit -1 "Keyhunt point limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" @@ -110,9 +106,6 @@ set g_ka_weapon_stay 0 set g_kh_respawn_delay 0 set g_kh_respawn_waves 0 set g_kh_weapon_stay 0 -set g_arena_respawn_delay 0 -set g_arena_respawn_waves 0 -set g_arena_weapon_stay 0 set g_ca_respawn_delay 0 set g_ca_respawn_waves 0 set g_ca_weapon_stay 0 @@ -136,16 +129,6 @@ set g_ft_respawn_delay 0 set g_ft_weapon_stay 0 -// ======= -// arena -// ======= -set g_arena 0 "Arena: many one-on-one rounds are played to find the winner" -set g_arena_maxspawned 2 "maximum number of players to spawn at once (the rest is spectating, waiting for their turn)" -set g_arena_roundbased 1 "if disabled, the next player will spawn as soon as someone dies" -set g_arena_round_timelimit 180 -set g_arena_warmup 5 "time, newly spawned players have to prepare themselves in round based matches" - - // ========= // assault // ========= @@ -166,7 +149,6 @@ seta g_ca_teams_override 0 set g_ca_teams 0 - // ================== // capture the flag // ================== diff --git a/gfx/menu/luminos/gametype_arena.tga b/gfx/menu/luminos/gametype_arena.tga deleted file mode 100644 index f49fa28ff9..0000000000 Binary files a/gfx/menu/luminos/gametype_arena.tga and /dev/null differ diff --git a/gfx/menu/wickedx/gametype_arena.tga b/gfx/menu/wickedx/gametype_arena.tga deleted file mode 100644 index f49fa28ff9..0000000000 Binary files a/gfx/menu/wickedx/gametype_arena.tga and /dev/null differ diff --git a/gfx/menu/xaw/gametype_arena.tga b/gfx/menu/xaw/gametype_arena.tga deleted file mode 100644 index ca720bc723..0000000000 Binary files a/gfx/menu/xaw/gametype_arena.tga and /dev/null differ diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 8e36cc9b54..a06eb5e658 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -5,7 +5,7 @@ entity clearentity_ent; void clearentity(entity e) { - if not(clearentity_ent) + if (!clearentity_ent) { clearentity_ent = spawn(); clearentity_ent.classname = "clearentity"; @@ -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; @@ -187,11 +187,11 @@ void Shutdown(void) if(autocvar_chase_active < 0) cvar_set("chase_active", "0"); - if not(isdemo()) + if (!isdemo()) { - if not(calledhooks & HOOK_START) + if (!(calledhooks & HOOK_START)) localcmd("\n_cl_hook_gamestart nop\n"); - if not(calledhooks & HOOK_END) + if (!(calledhooks & HOOK_END)) localcmd("\ncl_hook_gameend\n"); } } @@ -247,7 +247,7 @@ float SetTeam(entity o, float Team) } else { - if not(o.has_team) + if (!o.has_team) { o.team = Team; tm = GetTeam(Team, true); @@ -288,10 +288,10 @@ void Playerchecker_Think() } else { - if not(e.sort_prev) + if (!e.sort_prev) { // player connected - if not(e) + if (!e) playerslots[i] = e = spawn(); e.sv_entnum = i; e.ping = 0; @@ -433,13 +433,13 @@ void Ent_ReadPlayerScore() self.sv_entnum = n; - if not(playerslots[self.sv_entnum]) + if (!(playerslots[self.sv_entnum])) playerslots[self.sv_entnum] = spawn(); o = self.owner = playerslots[self.sv_entnum]; o.sv_entnum = self.sv_entnum; o.gotscores = 1; - //if not(o.sort_prev) + //if (!o.sort_prev) // RegisterPlayer(o); //playerchecker will do this for us later, if it has not already done so @@ -588,7 +588,7 @@ void Ent_Nagger() { f = ReadByte(); for(j = i-1, b = 1; b < 256; b *= 2, ++j) - if not(f & b) + if (!(f & b)) if(playerslots[j]) playerslots[j].ready = 0; } @@ -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; @@ -882,7 +882,7 @@ void CSQC_Ent_Remove() void Gamemode_Init() { - if not(isdemo()) + if (!isdemo()) { if(!(calledhooks & HOOK_START)) localcmd("\n_cl_hook_gamestart ", MapInfo_Type_ToString(gametype), "\n"); @@ -1159,7 +1159,7 @@ void Net_ReadPingPLReport() pi = ReadShort(); pl = ReadByte(); ml = ReadByte(); - if not(playerslots[e]) + if (!(playerslots[e])) return; playerslots[e].ping = pi; playerslots[e].ping_packetloss = pl / 255.0; diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 46920a4174..8c9d59dd91 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 @@ -745,7 +745,7 @@ void CSQC_UpdateView(float w, float h) drawstring('0 0 0', "", '1 1 0', '1 1 1', 0, 0); if(autocvar_r_fakelight >= 2 || autocvar_r_fullbright) - if not(serverflags & SERVERFLAG_ALLOW_FULLBRIGHT) + if (!(serverflags & SERVERFLAG_ALLOW_FULLBRIGHT)) { // apply night vision effect vector tc_00, tc_01, tc_10, tc_11; @@ -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 not(autocvar_crosshair_enabled) // main toggle for crosshair rendering + 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; @@ -1431,11 +1431,11 @@ void CSQC_UpdateView(float w, float h) if(autocvar_crosshair_effect_time > 0) { f = (time - wcross_name_changestarttime) / autocvar_crosshair_effect_time; - if not(f < 1) + if (!(f < 1)) { 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 b53c04da05..3507749691 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,22 +50,22 @@ 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 not(e) + if (!e) { e = spawn(); e.classname = "announcer_countdown"; @@ -74,39 +74,39 @@ 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 - if not(autocvar_g_warmup_limit == -1 && warmup_stage) + if(!(autocvar_g_warmup_limit == -1 && warmup_stage)) { announcer_5min = TRUE; Local_Notification(MSG_ANNCE, ANNCE_REMAINING_MIN_5); @@ -120,15 +120,15 @@ 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 - if not(autocvar_g_warmup_limit == -1 && warmup_stage) + if(!(autocvar_g_warmup_limit == -1 && warmup_stage)) { announcer_1min = TRUE; Local_Notification(MSG_ANNCE, ANNCE_REMAINING_MIN_1); diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 8175695abb..403792020a 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 694bc0cc6f..fda38b125c 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 cbf294fa8a..9aae77dde6 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 0016196bac..3889603aa8 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 3837ed4c97..848c632773 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) { @@ -121,7 +121,7 @@ void CSQCPlayer_ModelAppearance_Apply(float islocalplayer) { // FORCEMODEL // which one is ALWAYS good? - if not(forceplayermodels_goodmodel) + if (!forceplayermodels_goodmodel) { entity e; e = spawn(); @@ -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 cd7ac7bfa4..cc3653db4d 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) @@ -133,7 +133,7 @@ void Ent_DamageInfo(float isNew) force = decompressShortVector(ReadShort()); species = ReadByte(); - if not(isNew) + if (!isNew) return; if(rad < 0) @@ -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,17 +326,17 @@ 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 not(hitplayer && !rad) // don't show ground impacts for hitscan weapons if a player was hit + if(!hitplayer || rad) // don't show ground impacts for hitscan weapons if a player was hit { float hitwep; diff --git a/qcsrc/client/gibs.qc b/qcsrc/client/gibs.qc index afd61edab2..835d14a1ee 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) @@ -185,7 +185,7 @@ void Ent_GibSplash(float isNew) gentle_prefix = "particlegibs_"; } - if not(cl_gentle_gibs || autocvar_cl_gentle) + if (!(cl_gentle_gibs || autocvar_cl_gentle)) amount *= 1 - autocvar_cl_nogibs; if(autocvar_ekg) diff --git a/qcsrc/client/hook.qc b/qcsrc/client/hook.qc index ab48915301..196730a72d 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 398078acec..a78177b199 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -142,16 +142,16 @@ float stringwidth_nocolors(string s, vector theSize) return stringwidth(s, FALSE, theSize); } -void drawstringright(vector position, string text, vector scale, vector rgb, float theAlpha, float flag) +void drawstringright(vector position, string text, vector theScale, vector rgb, float theAlpha, float flag) { - position_x -= 2 / 3 * strlen(text) * scale_x; - drawstring(position, text, scale, rgb, theAlpha, flag); + position_x -= 2 / 3 * strlen(text) * theScale_x; + drawstring(position, text, theScale, rgb, theAlpha, flag); } -void drawstringcenter(vector position, string text, vector scale, vector rgb, float theAlpha, float flag) +void drawstringcenter(vector position, string text, vector theScale, vector rgb, float theAlpha, float flag) { - position_x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * scale_x); - drawstring(position, text, scale, rgb, theAlpha, flag); + position_x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * theScale_x); + drawstring(position, text, theScale, rgb, theAlpha, flag); } // return the string of the onscreen race timer @@ -242,7 +242,7 @@ float GetPlayerColorForce(float i) float GetPlayerColor(float i) { - if not(playerslots[i].gotscores) // unconnected + if(!playerslots[i].gotscores) // unconnected return NUM_SPECTATOR; else if(stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR) return NUM_SPECTATOR; @@ -734,12 +734,12 @@ void HUD_Weapons(void) // skip this weapon if we don't own it (and onlyowned is enabled)-- or if weapons_complainbubble is showing for this weapon if(autocvar_hud_panel_weapons_onlyowned) - if not((weapons_stat & WepSet_FromWeapon(self.weapon)) || (self.weapon == complain_weapon)) + if (!((weapons_stat & WepSet_FromWeapon(self.weapon)) || (self.weapon == complain_weapon))) 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 @@ -1133,7 +1133,7 @@ void HUD_Powerups(void) { if(!autocvar_hud_panel_powerups) return; if(spectatee_status == -1) return; - if not(getstati(STAT_ITEMS, 0, 24) & (IT_STRENGTH | IT_INVINCIBLE | IT_SUPERWEAPON)) return; + if(!(getstati(STAT_ITEMS, 0, 24) & (IT_STRENGTH | IT_INVINCIBLE | IT_SUPERWEAPON))) return; if (getstati(STAT_HEALTH) <= 0) return; strength_time = bound(0, getstatf(STAT_STRENGTH_FINISHED) - time, 99); @@ -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); } @@ -3123,7 +3123,7 @@ void HUD_Mod_Race(vector pos, vector mySize) float f; // yet another function has this score = me.(scores[ps_primary]); - if not((scores_flags[ps_primary] & SFL_TIME) && !teamplay) // race/cts record display on HUD + if(!(scores_flags[ps_primary] & SFL_TIME) || teamplay) // race/cts record display on HUD return; // no records in the actual race // clientside personal record @@ -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; @@ -3704,9 +3704,7 @@ void HUD_InfoMessages(void) s = sprintf(_("^1Press ^3%s^1 for gamemode info"), getcommandkey("server info", "+show_info")); drawInfoMessage(s) - if(gametype == MAPINFO_TYPE_ARENA) - s = _("^1Wait for your turn to join"); - else if(gametype == MAPINFO_TYPE_LMS) + if(gametype == MAPINFO_TYPE_LMS) { entity sk; sk = playerslots[player_localnum]; @@ -3795,7 +3793,7 @@ void HUD_InfoMessages(void) } } } - else + else { s = _("^7Press ^3ESC ^7to show HUD options."); drawInfoMessage(s) @@ -3871,7 +3869,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 +3892,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 +4227,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 +4286,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 +4295,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 +4352,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 +4372,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 ca8ec19c1a..869e30dda0 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) @@ -1087,10 +1087,10 @@ void HUD_Panel_Mouse() if(autocvar__menu_alpha == 1) return; - if not(autocvar_hud_cursormode) + 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/laser.qc b/qcsrc/client/laser.qc index 49aa033c17..f6b3fc4cbe 100644 --- a/qcsrc/client/laser.qc +++ b/qcsrc/client/laser.qc @@ -52,7 +52,7 @@ void Draw_Laser() Draw_CylindricLine(self.origin, trace_endpos, self.scale, "particles/laserbeam", 0, time * 3, self.colormod, 0.5, DRAWFLAG_ADDITIVE, view_origin); } } - if not(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT)) + if (!(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT))) { if(self.cnt >= 0) pointparticles(self.cnt, trace_endpos, trace_plane_normal, drawframetime * 1000); diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index 107b25d712..8caeb01d52 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); } @@ -176,10 +176,10 @@ void MapVote_Draw() if(!mv_active) return; - if not(autocvar_hud_cursormode) + 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)); @@ -470,7 +470,7 @@ void MapVote_UpdateMask() // remove votes that no longer apply for(i = 0, power = 1; i < mv_num_maps; ++i, power *= 2) - if not(mv_maps_mask & power) + if (!(mv_maps_mask & power)) mv_votes[i] = -1; mv_top2_time = time; diff --git a/qcsrc/client/miscfunctions.qc b/qcsrc/client/miscfunctions.qc index 926e11399d..2c2fc56df0 100644 --- a/qcsrc/client/miscfunctions.qc +++ b/qcsrc/client/miscfunctions.qc @@ -111,7 +111,7 @@ entity GetTeam(float Team, float add) num = (Team == NUM_SPECTATOR) ? 16 : Team; if(teamslots[num]) return teamslots[num]; - if not(add) + if (!add) return world; tm = spawn(); tm.team = Team; @@ -302,18 +302,18 @@ var string _drawpic_picpath; _drawpic_picpath = string_null;\ } while(0) -void drawpic_aspect_skin_expanding(vector position, string pic, vector scale, vector rgb, float theAlpha, float flag, float fadelerp) +void drawpic_aspect_skin_expanding(vector position, string pic, vector theScale, vector rgb, float theAlpha, float flag, float fadelerp) { float sz; sz = expandingbox_sizefactor_from_fadelerp(fadelerp); - drawpic_aspect_skin(position + expandingbox_resize_centered_box_offset(sz, scale, 1), pic, scale * sz, rgb, theAlpha * (1 - fadelerp), flag); + drawpic_aspect_skin(position + expandingbox_resize_centered_box_offset(sz, theScale, 1), pic, theScale * sz, rgb, theAlpha * (1 - fadelerp), flag); } -void drawpic_aspect_skin_expanding_two(vector position, string pic, vector scale, vector rgb, float theAlpha, float flag, float fadelerp) +void drawpic_aspect_skin_expanding_two(vector position, string pic, vector theScale, vector rgb, float theAlpha, float flag, float fadelerp) { - drawpic_aspect_skin_expanding(position, pic, scale, rgb, theAlpha, flag, fadelerp); - drawpic_skin(position, pic, scale, rgb, theAlpha * fadelerp, flag); + drawpic_aspect_skin_expanding(position, pic, theScale, rgb, theAlpha, flag, fadelerp); + drawpic_skin(position, pic, theScale, rgb, theAlpha * fadelerp, flag); } #define SET_POS_AND_SZ_Y_ASPECT(allow_colors)\ float textaspect, oldsz;\ @@ -341,14 +341,14 @@ void drawcolorcodedstring_aspect(vector pos, string text, vector sz, float theAl } vector drawfontscale; -void drawstring_expanding(vector position, string text, vector scale, vector rgb, float theAlpha, float flag, float fadelerp) +void drawstring_expanding(vector position, string text, vector theScale, vector rgb, float theAlpha, float flag, float fadelerp) { float sz; sz = expandingbox_sizefactor_from_fadelerp(fadelerp); drawfontscale = sz * '1 1 0'; dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); - drawstring(position + expandingbox_resize_centered_box_offset(sz, scale, stringwidth(text, FALSE, scale * (sz / drawfontscale_x)) / (scale_x * sz)), text, scale * (sz / drawfontscale_x), rgb, theAlpha * (1 - fadelerp), flag); + drawstring(position + expandingbox_resize_centered_box_offset(sz, theScale, stringwidth(text, FALSE, theScale * (sz / drawfontscale_x)) / (theScale_x * sz)), text, theScale * (sz / drawfontscale_x), rgb, theAlpha * (1 - fadelerp), flag); // width parameter: // (scale_x * sz / drawfontscale_x) * drawfontscale_x * SIZE1 / (scale_x * sz) // SIZE1 @@ -361,14 +361,14 @@ void drawstring_aspect_expanding(vector pos, string text, vector sz, vector colo drawstring_expanding(pos, text, '1 1 0' * sz_y, color, theAlpha, drawflag, fadelerp); } -void drawcolorcodedstring_expanding(vector position, string text, vector scale, float theAlpha, float flag, float fadelerp) +void drawcolorcodedstring_expanding(vector position, string text, vector theScale, float theAlpha, float flag, float fadelerp) { float sz; sz = expandingbox_sizefactor_from_fadelerp(fadelerp); drawfontscale = sz * '1 1 0'; dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); - drawcolorcodedstring(position + expandingbox_resize_centered_box_offset(sz, scale, stringwidth(text, TRUE, scale * (sz / drawfontscale_x)) / (scale_x * sz)), text, scale * (sz / drawfontscale_x), theAlpha * (1 - fadelerp), flag); + drawcolorcodedstring(position + expandingbox_resize_centered_box_offset(sz, theScale, stringwidth(text, TRUE, theScale * (sz / drawfontscale_x)) / (theScale_x * sz)), text, theScale * (sz / drawfontscale_x), theAlpha * (1 - fadelerp), flag); drawfontscale = '1 1 0'; } @@ -385,7 +385,7 @@ float PolyDrawModelSurface(entity e, float i_s) vector tri; string tex; tex = getsurfacetexture(e, i_s); - if not(tex) + if (!tex) return 0; // this is beyond the last one n_t = getsurfacenumtriangles(e, i_s); for(i_t = 0; i_t < n_t; ++i_t) @@ -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 0622aafe31..22bbd142f9 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 00343a432d..ce8b6dd7f9 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 b86c234bdb..52f6e2324b 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 @@ -167,10 +167,7 @@ void Projectile_Draw() switch(self.cnt) { - case PROJECTILE_BULLET_GLOWING: - case PROJECTILE_BULLET_GLOWING_TRACER: - adddynamiclight(self.origin, 50 * a, '1 1 0'); - break; + // Possibly add dlights here. default: break; } @@ -292,9 +289,6 @@ void Ent_Projectile() { case PROJECTILE_ELECTRO: setmodel(self, "models/ebomb.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break; case PROJECTILE_ROCKET: setmodel(self, "models/rocket.md3");self.traileffect = particleeffectnum("TR_ROCKET"); self.scale = 2; break; - case PROJECTILE_BULLET: setmodel(self, "models/tracer.mdl");self.traileffect = particleeffectnum("tr_bullet"); break; - case PROJECTILE_BULLET_GLOWING: setmodel(self, "models/tracer.mdl");self.traileffect = particleeffectnum("tr_rifle_weak"); break; - case PROJECTILE_BULLET_GLOWING_TRACER: setmodel(self, "models/tracer.mdl");self.traileffect = particleeffectnum("tr_rifle"); break; case PROJECTILE_CRYLINK: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum("TR_CRYLINKPLASMA"); break; case PROJECTILE_CRYLINK_BOUNCING: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum("TR_CRYLINKPLASMA"); break; case PROJECTILE_ELECTRO_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break; @@ -324,7 +318,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 +461,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 +517,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 339c8b29bc..b037d03d20 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -375,7 +375,7 @@ void Cmd_HUD_SetFields(float argc) pattern = substring(str, 0, slash); str = substring(str, slash + 1, strlen(str) - (slash + 1)); - if not(isGametypeInFilter(gametype, teamplay, FALSE, pattern)) + if (!isGametypeInFilter(gametype, teamplay, FALSE, pattern)) continue; } @@ -409,7 +409,7 @@ void Cmd_HUD_SetFields(float argc) } else { - if not(nocomplain) + if (!nocomplain) print(sprintf("^1Error:^7 Unknown score field: '%s'\n", str)); continue; } @@ -526,7 +526,7 @@ string HUD_GetField(entity pl, float field) switch(field) { case SP_PING: - if not(pl.gotscores) + if (!pl.gotscores) return "\xEE\x82\x8D\xEE\x82\x8D\xEE\x82\x8D"; // >>> sign //str = getplayerkeyvalue(pl.sv_entnum, "ping"); f = pl.ping; @@ -537,7 +537,7 @@ string HUD_GetField(entity pl, float field) return ftos(f); case SP_PL: - if not(pl.gotscores) + if (!pl.gotscores) return _("N/A"); f = pl.ping_packetloss; tmp = pl.ping_movementloss; @@ -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]); @@ -1024,7 +1024,7 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size) for(i = WEP_FIRST; i <= WEP_LAST; ++i) { self = get_weaponinfo(i); - if not(self.weapon) + if (!self.weapon) continue; if ((i == WEP_NEX && g_minstagib) || i == WEP_PORTO || (i == WEP_MINSTANEX && !g_minstagib) || i == WEP_TUBA) // skip port-o-launch, nex || minstanex and tuba continue; @@ -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; } @@ -1098,14 +1098,14 @@ vector HUD_DrawMapStats(vector pos, vector rgb, vector bg_size) { rows = (stat_secrets_total ? 1 : 0); // if no rows, return - if not(rows) + if (!rows) return pos; // 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; @@ -1207,7 +1207,7 @@ void HUD_DrawScoreboard() scoreboard_fade_alpha = 0; } - if not(scoreboard_fade_alpha) + if (!scoreboard_fade_alpha) return; HUD_UpdatePlayerTeams(); @@ -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 f20f143b03..c581fba428 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -13,13 +13,13 @@ 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 if(ent.sv_entnum == player_localentnum) // ent is me or person i'm spectating #endif - if not (autocvar_hud_shownames_self && autocvar_chase_active) + if(!(autocvar_hud_shownames_self && autocvar_chase_active)) return; makevectors(view_angles); @@ -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 @@ -57,7 +57,7 @@ void Draw_ShowNames(entity ent) if(e == ent) continue; eo = project_3d_to_2d(e.origin); - if not(eo_z < 0 || eo_x < 0 || eo_y < 0 || eo_x > vid_conwidth || eo_y > vid_conheight) + if (!(eo_z < 0 || eo_x < 0 || eo_y < 0 || eo_x > vid_conwidth || eo_y > vid_conheight)) { eo_z = 0; if(vlen((eX * o_x + eY * o_y) - eo) < autocvar_hud_shownames_antioverlap_distance && vlen(ent.origin - view_origin) > vlen(e.origin - view_origin)) @@ -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 not(ent.pointtime + autocvar_hud_shownames_crosshairdistance_time > 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 161bfa385a..2088348b17 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 c95185d74c..d8727e1760 100644 --- a/qcsrc/client/vehicles/vehicles.qc +++ b/qcsrc/client/vehicles/vehicles.qc @@ -75,7 +75,7 @@ void AuxiliaryXhair_Draw2D() psize = self.axh_scale * draw_getimagesize(self.axh_image); loc = project_3d_to_2d(self.move_origin) - 0.5 * psize; - if not (loc_z < 0 || loc_x < 0 || loc_y < 0 || loc_x > vid_conwidth || loc_y > vid_conheight) + if (!(loc_z < 0 || loc_x < 0 || loc_y < 0 || loc_x > vid_conwidth || loc_y > vid_conheight)) { loc_z = 0; psize_z = 0; @@ -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) { @@ -808,7 +808,7 @@ void CSQC_RAPTOR_HUD() setorigin(dropmark, trace_endpos); picsize = draw_getimagesize(raptor_drop) * 0.2; - if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight) + if (!(where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)) { where_x -= picsize_x * 0.5; where_y -= picsize_y * 0.5; @@ -825,7 +825,7 @@ void CSQC_RAPTOR_HUD() where = project_3d_to_2d(dropmark.origin); picsize = draw_getimagesize(raptor_drop) * 0.25; - if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight) + if (!(where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)) { where_x -= picsize_x * 0.5; where_y -= picsize_y * 0.5; @@ -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 a2ace4f46a..a3e856d143 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 5ab3da67cf..d9864f4da7 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 4ca8b3780c..5e8accbd29 100644 --- a/qcsrc/common/command/generic.qc +++ b/qcsrc/common/command/generic.qc @@ -41,7 +41,7 @@ void Curl_URI_Get_Callback(float id, float status, string data) strunzone(do_cvar); } if(!do_exec) - if not(do_cvar) + if (!do_cvar) print(data); } @@ -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 7ee3d50649..a61986a8fb 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 374d07df17..223d3264d3 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/constants.qh b/qcsrc/common/constants.qh index b3dafaaf7b..55d16953f6 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -327,7 +327,6 @@ const float ATTEN_MAX = 3.984375; const float PROJECTILE_ELECTRO = 1; const float PROJECTILE_ROCKET = 2; const float PROJECTILE_TAG = 3; -const float PROJECTILE_BULLET = 4; const float PROJECTILE_CRYLINK = 5; const float PROJECTILE_ELECTRO_BEAM = 6; const float PROJECTILE_GRENADE = 7; @@ -342,11 +341,9 @@ const float PROJECTILE_PORTO_BLUE = 15; const float PROJECTILE_HOOKBOMB = 16; const float PROJECTILE_HAGAR = 17; const float PROJECTILE_HAGAR_BOUNCING = 18; -const float PROJECTILE_BULLET_GLOWING = 19; const float PROJECTILE_CRYLINK_BOUNCING = 20; const float PROJECTILE_FIREBALL = 21; const float PROJECTILE_FIREMINE = 22; -const float PROJECTILE_BULLET_GLOWING_TRACER = 23; const float PROJECTILE_RAPTORCANNON = 24; const float PROJECTILE_RAPTORBOMB = 25; diff --git a/qcsrc/common/counting.qh b/qcsrc/common/counting.qh index a74f74e980..2559bf3acd 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/csqcmodel_settings.qh b/qcsrc/common/csqcmodel_settings.qh index a9ed986dee..141bc673f7 100644 --- a/qcsrc/common/csqcmodel_settings.qh +++ b/qcsrc/common/csqcmodel_settings.qh @@ -34,6 +34,9 @@ CSQCMODEL_PROPERTY_SCALED(256, float, ReadByte, WriteByte, glowmod_x, 255, 0, 255) \ CSQCMODEL_PROPERTY_SCALED(256, float, ReadByte, WriteByte, glowmod_y, 255, 0, 255) \ CSQCMODEL_PROPERTY_SCALED(256, float, ReadByte, WriteByte, glowmod_z, 255, 0, 255) \ + CSQCMODEL_PROPERTY_SCALED(256, float, ReadByte, WriteByte, colormod_x, 255, 0, 255) \ + CSQCMODEL_PROPERTY_SCALED(256, float, ReadByte, WriteByte, colormod_y, 255, 0, 255) \ + CSQCMODEL_PROPERTY_SCALED(256, float, ReadByte, WriteByte, colormod_z, 255, 0, 255) \ CSQCMODEL_ENDIF \ CSQCMODEL_IF(isplayer) \ CSQCMODEL_PROPERTY(128, float, ReadByte, WriteByte, anim_state) \ @@ -45,7 +48,8 @@ CSQCMODEL_PROPERTY(512, float, ReadChar, WriteChar, anim_upper_action) \ CSQCMODEL_PROPERTY(512, float, ReadApproxPastTime, WriteApproxPastTime, anim_upper_time) \ CSQCMODEL_PROPERTY(1024, float, ReadAngle, WriteAngle, v_angle_x) \ - CSQCMODEL_ENDIF + CSQCMODEL_ENDIF \ + CSQCMODEL_PROPERTY_SCALED(4096, float, ReadByte, WriteByte, scale, 16, 0, 99999999) // TODO get rid of colormod/glowmod here, find good solution for nex charge glowmod hack; also get rid of some useless properties on non-players that only exist for CopyBody // add hook function calls here diff --git a/qcsrc/common/deathtypes.qh b/qcsrc/common/deathtypes.qh index cc7154d4b6..4f96f7500e 100644 --- a/qcsrc/common/deathtypes.qh +++ b/qcsrc/common/deathtypes.qh @@ -96,7 +96,7 @@ string Deathtype_Name(float deathtype) if(DEATH_ISSPECIAL(deathtype)) { entity deathent = deathtypes[(deathtype - DT_FIRST)]; - if not(deathent) { backtrace("Deathtype_Name: Could not find deathtype entity!\n"); return ""; } + if (!deathent) { backtrace("Deathtype_Name: Could not find deathtype entity!\n"); return ""; } return deathent.nent_name; } else { return ftos(deathtype); } diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index aa906d6841..21263719b3 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) { @@ -141,7 +141,7 @@ float _MapInfo_FilterList_cmp(float i, float j, entity pass) float MapInfo_FilterGametype(float pGametype, float pFeatures, float pFlagsRequired, float pFlagsForbidden, float pAbortOnGenerate) { float i, j; - if not(_MapInfo_filtered_allocated) + if (!_MapInfo_filtered_allocated) { _MapInfo_filtered_allocated = 1; _MapInfo_filtered = buf_create(); @@ -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); @@ -257,7 +257,7 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp for(;;) { - if not((s = fgets(fh))) + if (!((s = fgets(fh)))) break; if(inWorldspawn == 1) if(startsWith(s, "}")) @@ -370,8 +370,6 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_FREEZETAG; MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_CA; } - if( diameter < 4096) - MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_ARENA; if(spawnpoints >= 12 && diameter > 5120) MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_KEYHUNT; } @@ -416,7 +414,6 @@ string _MapInfo_GetDefault(float t) case MAPINFO_TYPE_DOMINATION: return "200 20 0"; case MAPINFO_TYPE_CTF: return "300 20 10 0"; case MAPINFO_TYPE_LMS: return "9 20 0"; - case MAPINFO_TYPE_ARENA: return "10 20 0"; case MAPINFO_TYPE_CA: return "10 20 0"; case MAPINFO_TYPE_KEYHUNT: return "1000 20 3 0"; case MAPINFO_TYPE_ASSAULT: return "20 0"; @@ -442,7 +439,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 +506,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 +691,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 +732,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); @@ -756,7 +753,7 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s, { for(;;) { - if not((s = fgets(fh))) + if (!((s = fgets(fh)))) break; // catch different sorts of comments @@ -784,9 +781,9 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s, } else if(t == "") print("Map ", pFilename, " contains a potentially harmful setting, ignored\n"); - else if not(cvar_value_issafe(t)) + else if (!cvar_value_issafe(t)) print("Map ", pFilename, " contains a potentially harmful setting, ignored\n"); - else if not (cvar_value_issafe(s)) + else if (!cvar_value_issafe(s)) print("Map ", pFilename, " contains a potentially harmful setting, ignored\n"); else if(matchacl(MAPINFO_SETTEMP_ACL_SYSTEM, t) <= 0) print("Map ", pFilename, " contains a potentially harmful setting, ignored\n"); @@ -946,7 +943,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, float pAllowGenerate, flo _MapInfo_Map_Reset(); for(;;) { - if not((s = fgets(fh))) + if (!((s = fgets(fh)))) break; // catch different sorts of comments @@ -1078,7 +1075,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, float pAllowGenerate, flo } else if(t == "fog") { - if not(cvar_value_issafe(s)) + if (!cvar_value_issafe(s)) print("Map ", pFilename, " contains a potentially harmful fog setting, ignored\n"); else MapInfo_Map_fog = s; @@ -1088,7 +1085,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, float pAllowGenerate, flo t = car(s); s = cdr(s); if(pGametypeToSet) // FIXME is this check right here? { - if not(cvar_value_issafe(t)) + if (!cvar_value_issafe(t)) print("Map ", pFilename, " contains a potentially harmful cdtrack, ignored\n"); else MapInfo_Map_clientstuff = strcat( @@ -1121,7 +1118,7 @@ float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, float pGametype if(cvar("g_tdm_on_dm_maps")) { // if this is set, all DM maps support TDM too - if not(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_TEAM_DEATHMATCH) + if (!(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_TEAM_DEATHMATCH)) if(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH) _MapInfo_Map_ApplyGametypeEx ("", pGametypeToSet, MAPINFO_TYPE_TEAM_DEATHMATCH); } @@ -1251,7 +1248,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")); @@ -1369,11 +1366,11 @@ float MapInfo_ForbiddenFlags() f = MAPINFO_FLAG_FORBIDDEN; #ifndef MENUQC - if not(cvar("g_maplist_allow_hidden")) + if (!cvar("g_maplist_allow_hidden")) #endif f |= MAPINFO_FLAG_HIDDEN; - if not(cvar("g_maplist_allow_frustrating")) + if (!cvar("g_maplist_allow_frustrating")) f |= MAPINFO_FLAG_FRUSTRATING; return f; diff --git a/qcsrc/common/mapinfo.qh b/qcsrc/common/mapinfo.qh index 40fea4fc28..eb93b8de81 100644 --- a/qcsrc/common/mapinfo.qh +++ b/qcsrc/common/mapinfo.qh @@ -39,9 +39,6 @@ REGISTER_GAMETYPE(_("Deathmatch"),dm,g_dm,DEATHMATCH,"timelimit=20 pointlimit=30 REGISTER_GAMETYPE(_("Last Man Standing"),lms,g_lms,LMS,"timelimit=20 lives=9 leadlimit=0"); #define g_lms IS_GAMETYPE(LMS) -REGISTER_GAMETYPE(_("Arena"),arena,g_arena,ARENA,"timelimit=20 pointlimit=10 leadlimit=0"); -#define g_arena IS_GAMETYPE(ARENA) - REGISTER_GAMETYPE(_("Race"),rc,g_race,RACE,"timelimit=20 qualifying_timelimit=5 laplimit=7 teamlaplimit=15 leadlimit=0"); #define g_race IS_GAMETYPE(RACE) diff --git a/qcsrc/common/net_notice.qc b/qcsrc/common/net_notice.qc index 625e091dcc..caaae8b496 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 09c0496818..8c297513e7 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -88,38 +88,38 @@ 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 not(teamplay) + if (!teamplay) { checkargs = sprintf("%sTeamplay not active!", checkargs); } - //else if not(client.team) { checkargs = sprintf("%sNo team provided!", checkargs); } + //else if (!client.team) { checkargs = sprintf("%sNo team provided!", checkargs); } break; } - + case NOTIF_TEAM_EXCEPT: { - if not(teamplay) + if (!teamplay) { checkargs = sprintf("%sTeamplay not active!", checkargs); } else if(IS_NOT_A_CLIENT(client)) { checkargs = sprintf("%sException can't be a non-client!", checkargs); } break; } - + default: { checkargs = sprintf("%sImproper broadcast: %d!", checkargs, broadcast); break; } } return checkargs; @@ -225,12 +225,12 @@ void Destroy_All_Notifications(void) { entity notif; float i; - + #define DESTROY_LOOP(type,count) \ for(i = 1; i <= count; ++i) \ { \ notif = Get_Notif_Ent(type, i); \ - if not(notif) { backtrace("Destroy_All_Notifications(): Missing notification entity!\n"); return; } \ + if (!notif) { backtrace("Destroy_All_Notifications(): Missing notification entity!\n"); return; } \ Destroy_Notification_Entity(notif); \ } @@ -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 @@ -576,7 +576,7 @@ void Create_Notification_Entity( { // Set MSG_ANNCE information and handle precaching #ifdef CSQC - if not(GENTLE && (var_cvar == 1)) + if (!(GENTLE && (var_cvar == 1))) { if(snd != "") { @@ -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 @@ -1004,8 +1004,8 @@ void Dump_Notifications(float fh, float alsoprint) for(i = 1; i <= NOTIF_ANNCE_COUNT; ++i) { e = Get_Notif_Ent(MSG_ANNCE, i); - if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; } - + 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)" ); @@ -1015,8 +1015,8 @@ void Dump_Notifications(float fh, float alsoprint) for(i = 1; i <= NOTIF_INFO_COUNT; ++i) { e = Get_Notif_Ent(MSG_INFO, i); - if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; } - + 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)" @@ -1027,8 +1027,8 @@ void Dump_Notifications(float fh, float alsoprint) for(i = 1; i <= NOTIF_CENTER_COUNT; ++i) { e = Get_Notif_Ent(MSG_CENTER, i); - if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; } - + if (!e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; } + NOTIF_WRITE_ENTITY( "Notification control cvar: 0 = off, 1 = centerprint" ); @@ -1038,8 +1038,8 @@ void Dump_Notifications(float fh, float alsoprint) for(i = 1; i <= NOTIF_MULTI_COUNT; ++i) { e = Get_Notif_Ent(MSG_MULTI, i); - if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; } - + if (!e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; } + NOTIF_WRITE_ENTITY( "Notification control cvar: 0 = off, 1 = trigger subcalls" ); @@ -1049,8 +1049,8 @@ void Dump_Notifications(float fh, float alsoprint) for(i = 1; i <= NOTIF_CHOICE_COUNT; ++i) { e = Get_Notif_Ent(MSG_CHOICE, i); - if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; } - + 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 != "") @@ -1437,7 +1437,7 @@ void Local_Notification(float net_type, float net_name, ...count) // retreive entity of this notification entity notif = Get_Notif_Ent(net_type, net_name); - if not(notif) + if (!notif) { #ifdef NOTIFICATIONS_DEBUG Debug_Notification(sprintf( @@ -1451,7 +1451,7 @@ void Local_Notification(float net_type, float net_name, ...count) } // check if the notification is enabled - if not(notif.nent_enabled) + if (!notif.nent_enabled) { #ifdef NOTIFICATIONS_DEBUG Debug_Notification(sprintf( @@ -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,13 +1689,13 @@ void Read_Notification(float is_new) is_new, time )); - } + } } } else { notif = Get_Notif_Ent(net_type, net_name); - if not(notif) { backtrace("Read_Notification: Could not find notification entity!\n"); return; } + if (!notif) { backtrace("Read_Notification: Could not find notification entity!\n"); return; } #ifdef NOTIFICATIONS_DEBUG Debug_Notification(sprintf( @@ -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( @@ -1732,8 +1732,8 @@ void Read_Notification(float is_new) #ifdef SVQC void Net_Notification_Remove() { - if not(self) { backtrace(sprintf("Net_Notification_Remove() at %f: Missing self!?\n", time)); return; } - + 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 not(notif) { backtrace("Kill_Notification: Could not find notification entity!\n"); return; } - + 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 != "") @@ -1896,7 +1896,7 @@ void Send_Notification( // retreive entity of this notification entity notif = Get_Notif_Ent(net_type, net_name); - if not(notif) + if (!notif) { #ifdef NOTIFICATIONS_DEBUG Debug_Notification(sprintf( @@ -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 e8e92f0183..6c602219ba 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 @@ -990,7 +990,7 @@ string notif_arg_frag_ping(float newline, float fping) string notif_arg_frag_stats(float fhealth, float farmor, float fping) { - if not(fhealth < 1) + if (!(fhealth < 1)) return sprintf(CCR(_("\n(Health ^1%d^BG / Armor ^2%d^BG)%s")), fhealth, farmor, notif_arg_frag_ping(FALSE, fping)); else return sprintf(CCR(_("\n(^F4Dead^BG)%s")), notif_arg_frag_ping(FALSE, fping)); @@ -1025,19 +1025,19 @@ 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 default: { - if not(autocvar_notification_show_sprees_center_specialonly) + if (!autocvar_notification_show_sprees_center_specialonly) { return sprintf( @@ -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,18 +1084,18 @@ 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 default: { - if not(autocvar_notification_show_sprees_info_specialonly) + if (!autocvar_notification_show_sprees_info_specialonly) { return sprintf( @@ -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 ade219a245..069904290b 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 85efe4144a..d1503a7b6b 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; @@ -241,7 +241,7 @@ vector colormapPaletteColor(float c, float isPants) string fstrunzone(string s) { string sc; - if not(s) + if (!s) return s; sc = strcat(s, ""); strunzone(s); @@ -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; } @@ -866,7 +866,7 @@ float cvar_settemp(string tmp_cvar, string tmp_value) created_saved_value = 0; - if not(tmp_cvar || tmp_value) + if (!(tmp_cvar || tmp_value)) { dprint("Error: Invalid usage of cvar_settemp(string, string); !\n"); return 0; @@ -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; @@ -1476,7 +1476,7 @@ float isGametypeInFilter(float gt, float tp, float ts, string pattern) if(strstrofs(strcat(",", pattern, ","), subpattern2, 0) < 0) if(strstrofs(strcat(",", pattern, ","), subpattern3, 0) < 0) { - if not(subpattern4) + if (!subpattern4) return 0; if(strstrofs(strcat(",", pattern, ","), subpattern4, 0) < 0) return 0; @@ -1712,7 +1712,7 @@ void check_unacceptable_compiler_bugs() error("fteqcc bug introduced with revision 3178 detected. Please upgrade fteqcc to a later revision, downgrade fteqcc to revision 3177, or pester Spike until he fixes it. You can set _allow_unacceptable_compiler_bugs 1 to skip this check, but expect stuff to be horribly broken then."); string s = ""; - if not(s) + if (!s) error("The empty string counts as false. We do not want that!"); } @@ -2052,7 +2052,7 @@ float get_model_parameters(string m, float sk) } get_model_parameters_fixbone = 0; - if not(m) + if (!m) return 1; if(substring(m, -9, 5) == "_lod1" || substring(m, -9, 5) == "_lod2") @@ -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 effdb3cf78..a9f9095c7a 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 2c7bc2d925..3029285220 100644 --- a/qcsrc/csqcmodellib/cl_model.qc +++ b/qcsrc/csqcmodellib/cl_model.qc @@ -236,15 +236,18 @@ void CSQCModel_Read(float isnew) #undef CSQCMODEL_IF if(sf & CSQCMODEL_PROPERTY_MODELINDEX) + { + vector pmin = self.mins, pmax = self.maxs; setmodelindex(self, self.modelindex); // this retrieves the .model key and sets mins/maxs/absmin/absmax - // FIXME do we WANT this to override mins/maxs? + setsize(self, pmin, pmax); + } if(sf & CSQCMODEL_PROPERTY_TELEPORTED) { self.iflags |= IFLAG_TELEPORTED; self.csqcmodel_teleported = 1; } - + CSQCModel_InterpolateAnimation_Note(sf); InterpolateOrigin_Note(); CSQCPlayer_PostUpdate(); diff --git a/qcsrc/csqcmodellib/common.qh b/qcsrc/csqcmodellib/common.qh index f6044cb283..4cf60174de 100644 --- a/qcsrc/csqcmodellib/common.qh +++ b/qcsrc/csqcmodellib/common.qh @@ -58,6 +58,7 @@ IN THE SOFTWARE.\ #define CSQCMODEL_PROPERTY_PITCHROLL 1024 #define CSQCMODEL_PROPERTY_FRAME2 512 #define CSQCMODEL_PROPERTY_LERPFRAC 256 +#define CSQCMODEL_PROPERTY_SIZE 128 #define ALLPROPERTIES_COMMON \ CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_FRAME, float, ReadByte, WriteByte, frame) \ @@ -65,6 +66,12 @@ IN THE SOFTWARE.\ CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_ORIGIN, float, ReadCoord, WriteCoord, origin_x) \ CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_ORIGIN, float, ReadCoord, WriteCoord, origin_y) \ CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_ORIGIN, float, ReadCoord, WriteCoord, origin_z) \ + CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, float, ReadShort, WriteShort, mins_x) \ + CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, float, ReadShort, WriteShort, mins_y) \ + CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, float, ReadShort, WriteShort, mins_z) \ + CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, float, ReadShort, WriteShort, maxs_x) \ + CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, float, ReadShort, WriteShort, maxs_y) \ + CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, float, ReadShort, WriteShort, maxs_z) \ CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_PITCHROLL, float, ReadAngle, WriteAngle, angles_x) \ CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_YAW, float, ReadAngle, WriteAngle, angles_y) \ CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_PITCHROLL, float, ReadAngle, WriteAngle, angles_z) \ diff --git a/qcsrc/dpdefs/csprogsdefs.qc b/qcsrc/dpdefs/csprogsdefs.qc index 324f8082f7..8f4ec8b414 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 39a2f593a1..ef86a02b3e 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 d976973253..0d6c253709 100644 --- a/qcsrc/dpdefs/menudefs.qc +++ b/qcsrc/dpdefs/menudefs.qc @@ -304,7 +304,7 @@ float drawstring(vector position, string text, vector scale, vector rgb, float a float drawcolorcodedstring(vector position, string text, vector scale, float alpha, float flag) = #467; vector drawcolorcodedstring2(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #467; - + float drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #456; float drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #457; diff --git a/qcsrc/menu/item/button.c b/qcsrc/menu/item/button.c index 6b32bae270..8bbdfa7040 100644 --- a/qcsrc/menu/item/button.c +++ b/qcsrc/menu/item/button.c @@ -77,7 +77,7 @@ float Button_mouseRelease(entity me, vector pos) me.mouseDrag(me, pos); // verify coordinates if(me.pressed) { - if not(me.disabled) + if (!me.disabled) { if(cvar("menu_sounds")) localsound("sound/misc/menu2.wav"); @@ -162,7 +162,7 @@ void Button_draw(entity me) if(me.clickTime > 0 && me.clickTime <= frametime) { // keyboard click timer expired? Fire the event then. - if not(me.disabled) + if (!me.disabled) if(me.onClick) me.onClick(me, me.onClickEntity); } diff --git a/qcsrc/menu/item/container.c b/qcsrc/menu/item/container.c index 6241cee039..f14a4ceb7c 100644 --- a/qcsrc/menu/item/container.c +++ b/qcsrc/menu/item/container.c @@ -85,7 +85,7 @@ void Container_showNotify(entity me) void Container_hideNotify(entity me) { entity e; - if not(me.shown) + if (!me.shown) return; me.shown = 0; for(e = me.firstChild; e; e = e.nextSibling) @@ -347,7 +347,7 @@ void Container_removeItem(entity me, entity other) void Container_setFocus(entity me, entity other) { if(other) - if not(me.focused) + if (!me.focused) error("Trying to set focus in a non-focused control!"); if(me.focusedChild == other) return; @@ -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 5fa0103532..3835787815 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) @@ -135,7 +135,7 @@ void Dialog_configureDialog(entity me) me.frame.alpha = me.alpha; me.addItem(me, me.frame, '0 0 0', '1 1 0', 1); - if not(me.titleFontSize) + if (!me.titleFontSize) me.titleHeight = 0; // no title bar absWidth = me.intendedWidth * conwidth; diff --git a/qcsrc/menu/item/inputbox.c b/qcsrc/menu/item/inputbox.c index 614f6d5576..1c1bf5189b 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/inputcontainer.c b/qcsrc/menu/item/inputcontainer.c index 4531a1f4e1..0f80c2b503 100644 --- a/qcsrc/menu/item/inputcontainer.c +++ b/qcsrc/menu/item/inputcontainer.c @@ -56,7 +56,7 @@ float InputContainer_keyDown(entity me, float scan, float ascii, float shift) { for(ff = f.prevSibling; ff; ff = ff.prevSibling) { - if not(ff.focusable) + if (!ff.focusable) continue; me.setFocus(me, ff); return 1; @@ -66,7 +66,7 @@ float InputContainer_keyDown(entity me, float scan, float ascii, float shift) { for(ff = me.lastChild; ff; ff = ff.prevSibling) { - if not(ff.focusable) + if (!ff.focusable) continue; me.setFocus(me, ff); return 1; @@ -80,7 +80,7 @@ float InputContainer_keyDown(entity me, float scan, float ascii, float shift) { for(ff = f.nextSibling; ff; ff = ff.nextSibling) { - if not(ff.focusable) + if (!ff.focusable) continue; me.setFocus(me, ff); return 1; @@ -90,7 +90,7 @@ float InputContainer_keyDown(entity me, float scan, float ascii, float shift) { for(ff = me.firstChild; ff; ff = ff.nextSibling) { - if not(ff.focusable) + if (!ff.focusable) continue; me.setFocus(me, ff); return 1; @@ -108,7 +108,7 @@ float InputContainer__changeFocusXY(entity me, vector pos) e = me.mouseFocusedChild; ne = me.itemFromPoint(me, pos); if(ne) - if not(ne.focusable) + if (!ne.focusable) ne = NULL; me.mouseFocusedChild = ne; if(ne) diff --git a/qcsrc/menu/item/nexposee.c b/qcsrc/menu/item/nexposee.c index 97eabd7d66..ca7ab8fc37 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); @@ -228,7 +228,7 @@ float Nexposee_mousePress(entity me, vector pos) } else if(me.animationState == 2) { - if not(SUPER(Nexposee).mousePress(me, pos)) + if (!(SUPER(Nexposee).mousePress(me, pos))) { me.animationState = 3; SUPER(Nexposee).setFocus(me, NULL); @@ -291,14 +291,14 @@ float Nexposee_keyDown(entity me, float scan, float ascii, float shift) { if(me.selectedChild) me.selectedChild = me.selectedChild.prevSibling; - if not(me.selectedChild) + if (!me.selectedChild) me.selectedChild = me.lastChild; } else { if(me.selectedChild) me.selectedChild = me.selectedChild.nextSibling; - if not(me.selectedChild) + if (!me.selectedChild) me.selectedChild = me.firstChild; } } @@ -331,7 +331,7 @@ float Nexposee_keyDown(entity me, float scan, float ascii, float shift) } if(me.focusedChild) me.selectedChild = me.focusedChild; - if not(me.selectedChild) + if (!me.selectedChild) me.animationState = 0; SUPER(Nexposee).setFocus(me, NULL); return 1; diff --git a/qcsrc/menu/item/tab.c b/qcsrc/menu/item/tab.c index 7f3a2873fa..8cd72ba9c7 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 1e4caf78a0..1398e5757e 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -67,7 +67,7 @@ void m_init() for(i = 0; ; ++i) { s = getgamedirinfo(i, GETGAMEDIRINFO_NAME); - if not(s) + if (!s) break; dprint(s, ": ", getgamedirinfo(i, GETGAMEDIRINFO_DESCRIPTION)); } @@ -443,7 +443,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)) @@ -463,12 +463,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) @@ -992,7 +992,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 85bc6c2afa..1e122066c5 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.c b/qcsrc/menu/xonotic/checkbox.c index c28edcc070..b1a1af1966 100644 --- a/qcsrc/menu/xonotic/checkbox.c +++ b/qcsrc/menu/xonotic/checkbox.c @@ -81,7 +81,7 @@ void XonoticCheckBox_loadCvars(entity me) { float m, d; - if not(me.cvarName) + if (!me.cvarName) return; m = (me.yesValue + me.noValue) * 0.5; @@ -90,7 +90,7 @@ void XonoticCheckBox_loadCvars(entity me) } void XonoticCheckBox_saveCvars(entity me) { - if not(me.cvarName) + if (!me.cvarName) return; if(me.checked) diff --git a/qcsrc/menu/xonotic/checkbox_slider_invalid.c b/qcsrc/menu/xonotic/checkbox_slider_invalid.c index c5500394bd..e3043184a4 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/checkbox_string.c b/qcsrc/menu/xonotic/checkbox_string.c index 3b6b36f4e2..ecafefed64 100644 --- a/qcsrc/menu/xonotic/checkbox_string.c +++ b/qcsrc/menu/xonotic/checkbox_string.c @@ -50,7 +50,7 @@ void XonoticCheckBoxString_setChecked(entity me, float foo) } void XonoticCheckBoxString_loadCvars(entity me) { - if not(me.cvarName) + if (!me.cvarName) return; if(cvar_string(me.cvarName) == me.yesString) @@ -58,7 +58,7 @@ void XonoticCheckBoxString_loadCvars(entity me) } void XonoticCheckBoxString_saveCvars(entity me) { - if not(me.cvarName) + if (!me.cvarName) return; if(me.checked) diff --git a/qcsrc/menu/xonotic/colorbutton.c b/qcsrc/menu/xonotic/colorbutton.c index fd19f280a4..772c9e452c 100644 --- a/qcsrc/menu/xonotic/colorbutton.c +++ b/qcsrc/menu/xonotic/colorbutton.c @@ -67,7 +67,7 @@ void XonoticColorButton_setChecked(entity me, float val) } void XonoticColorButton_loadCvars(entity me) { - if not(me.cvarName) + if (!me.cvarName) return; if(cvar_string(me.cvarName) == cvar_defstring(me.cvarName)) @@ -80,7 +80,7 @@ void XonoticColorButton_loadCvars(entity me) } void XonoticColorButton_saveCvars(entity me) { - if not(me.cvarName) + if (!me.cvarName) return; if(me.checked) diff --git a/qcsrc/menu/xonotic/colorpicker.c b/qcsrc/menu/xonotic/colorpicker.c index eb9590827d..eca6df5f35 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/colorpicker_string.c b/qcsrc/menu/xonotic/colorpicker_string.c index c3593056c2..5d53135e9c 100644 --- a/qcsrc/menu/xonotic/colorpicker_string.c +++ b/qcsrc/menu/xonotic/colorpicker_string.c @@ -40,7 +40,7 @@ void XonoticColorpickerString_configureXonoticColorpickerString(entity me, strin void XonoticColorPickerString_loadCvars(entity me) { - if not(me.cvarName) + if (!me.cvarName) return; if(substring(me.cvarName, -1, 1) == "_") @@ -57,7 +57,7 @@ void XonoticColorPickerString_loadCvars(entity me) void XonoticColorPickerString_saveCvars(entity me) { - if not(me.cvarName) + if (!me.cvarName) return; if(substring(me.cvarName, -1, 1) == "_") diff --git a/qcsrc/menu/xonotic/crosshairbutton.c b/qcsrc/menu/xonotic/crosshairbutton.c index 0b501f5b64..7fe3a600f2 100644 --- a/qcsrc/menu/xonotic/crosshairbutton.c +++ b/qcsrc/menu/xonotic/crosshairbutton.c @@ -50,14 +50,14 @@ void XonoticCrosshairButton_setChecked(entity me, float val) } void XonoticCrosshairButton_loadCvars(entity me) { - if not(me.cvarName) + if (!me.cvarName) return; me.checked = (cvar(me.cvarName) == me.cvarValueFloat); } void XonoticCrosshairButton_saveCvars(entity me) { - if not(me.cvarName) + if (!me.cvarName) return; if(me.checked) @@ -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 52f1a1f26e..722917f553 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 2daed8bcbc..ee8cf6a4f6 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 39a7d2c701..01ce7ba434 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 25eddc8a13..09e6c5339f 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 3fc6f31fe3..60f52e1fa4 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 84115f1ed6..da85975de9 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 4e6d6f5909..5ecb77dd79 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,14 +230,14 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i) break; } me.encryptLabel.setText(me.encryptLabel, me.currentServerEncrypt); - + s = crypto_getidfp(me.currentServerCName); - if not(s) { s = _("N/A"); } + if (!s) { s = _("N/A"); } me.currentServerID = strzone(s); me.idLabel.setText(me.idLabel, me.currentServerID); s = crypto_getkeyfp(me.currentServerCName); - if not(s) { s = _("N/A"); } + if (!s) { s = _("N/A"); } me.currentServerKey = strzone(s); me.keyLabel.setText(me.keyLabel, me.currentServerKey); } @@ -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 482a60510e..f4bd359ece 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 a18fec1c4d..c4cdc3e705 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 e53f99bc1f..8d969fd7a3 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_hud.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_hud.c @@ -15,7 +15,7 @@ void HUDSetup_Start(entity me, entity btn); #ifdef IMPLEMENTATION void HUDSetup_Check_Gamestatus(entity me, entity btn) { - if not(gamestatus & (GAME_CONNECTED | GAME_ISSERVER)) // we're not in a match, ask the player if they want to start one anyway + if(!(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))) // we're not in a match, ask the player if they want to start one anyway { DialogOpenButton_Click(me, main.hudconfirmDialog); } @@ -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,11 +93,11 @@ 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; e.onClickEntity = me; } -#endif \ No newline at end of file +#endif diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_hudconfirm.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_hudconfirm.c index b06dc92078..7749a148d9 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_hudconfirm.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_hudconfirm.c @@ -12,11 +12,11 @@ ENDCLASS(XonoticHUDConfirmDialog) #ifdef IMPLEMENTATION void HUDSetup_Start(entity me, entity btn) { - if not(gamestatus & (GAME_CONNECTED | GAME_ISSERVER)) + if (!(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))) 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 c55d4d488b..d1cdade772 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 59a7e6e795..b2b440a1c4 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 fa3549154b..cfdaf8fdfc 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 108b984a1e..f3c27915e7 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 bea650eba4..a963d1e309 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 daa8f3ff10..d8554be4f7 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 5db6d35c62..724c868fd7 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 a3b89744b9..5d6a32d563 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 076dd23374..db728d6014 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/gametypebutton.c b/qcsrc/menu/xonotic/gametypebutton.c index c1dc04c730..cc10f3da9e 100644 --- a/qcsrc/menu/xonotic/gametypebutton.c +++ b/qcsrc/menu/xonotic/gametypebutton.c @@ -53,14 +53,14 @@ void XonoticGametypeButton_setChecked(entity me, float val) } void XonoticGametypeButton_loadCvars(entity me) { - if not(me.cvarName) + if (!me.cvarName) return; me.checked = cvar(me.cvarName); } void XonoticGametypeButton_saveCvars(entity me) { - if not(me.cvarName) + if (!me.cvarName) return; cvar_set(me.cvarName, ftos(me.checked)); diff --git a/qcsrc/menu/xonotic/gametypelist.c b/qcsrc/menu/xonotic/gametypelist.c index 531c761f63..56c25314da 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/inputbox.c b/qcsrc/menu/xonotic/inputbox.c index 56aa9702c6..78bab2bccb 100644 --- a/qcsrc/menu/xonotic/inputbox.c +++ b/qcsrc/menu/xonotic/inputbox.c @@ -72,13 +72,13 @@ void XonoticInputBox_setText(entity me, string new) } void XonoticInputBox_loadCvars(entity me) { - if not(me.cvarName) + if (!me.cvarName) return; SUPER(XonoticInputBox).setText(me, cvar_string(me.cvarName)); } void XonoticInputBox_saveCvars(entity me) { - if not(me.cvarName) + if (!me.cvarName) return; cvar_set(me.cvarName, me.text); } diff --git a/qcsrc/menu/xonotic/mainwindow.c b/qcsrc/menu/xonotic/mainwindow.c index f9d86c2dd2..0af90bbe27 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/maplist.c b/qcsrc/menu/xonotic/maplist.c index b5af66126f..ce937e4add 100644 --- a/qcsrc/menu/xonotic/maplist.c +++ b/qcsrc/menu/xonotic/maplist.c @@ -84,7 +84,7 @@ void XonoticMapList_g_maplistCacheToggle(entity me, float i) string a, b, c, s, bspname; float n; s = me.g_maplistCache; - if not(s) + if (!s) return; b = substring(s, i, 1); if(b == "0") @@ -98,7 +98,7 @@ void XonoticMapList_g_maplistCacheToggle(entity me, float i) strunzone(s); me.g_maplistCache = strzone(strcat(a, b, c)); // TODO also update the actual cvar - if not((bspname = MapInfo_BSPName_ByID(i))) + if (!((bspname = MapInfo_BSPName_ByID(i)))) return; if(b == "1") cvar_set("g_maplist", strcat(bspname, " ", cvar_string("g_maplist"))); @@ -275,7 +275,7 @@ void MapList_LoadMap(entity btn, entity me) return; m = MapInfo_BSPName_ByID(i); - if not(m) + if (!m) { print(_("Huh? Can't play this (m is NULL). Refiltering so this won't happen again.\n")); me.refilter(me); @@ -313,7 +313,7 @@ float XonoticMapList_keyDown(entity me, float scan, float ascii, float shift) } else if(ascii == 43) // + { - if not(me.g_maplistCacheQuery(me, me.selectedItem)) + if (!me.g_maplistCacheQuery(me, me.selectedItem)) me.g_maplistCacheToggle(me, me.selectedItem); } else if(ascii == 45) // - diff --git a/qcsrc/menu/xonotic/playerlist.c b/qcsrc/menu/xonotic/playerlist.c index 4c1c62af26..a0f64ca39e 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/radiobutton.c b/qcsrc/menu/xonotic/radiobutton.c index 4ac5aa7b18..85cc4fc5c5 100644 --- a/qcsrc/menu/xonotic/radiobutton.c +++ b/qcsrc/menu/xonotic/radiobutton.c @@ -75,8 +75,8 @@ void XonoticRadioButton_loadCvars(entity me) } void XonoticRadioButton_draw(entity me) { - if not(me.cvarValue) - if not(me.cvarName) + if (!me.cvarValue) + if (!me.cvarName) { // this is the "other" option // always select this if none other is diff --git a/qcsrc/menu/xonotic/serverlist.c b/qcsrc/menu/xonotic/serverlist.c index e656b963e2..e2a0e6c124 100644 --- a/qcsrc/menu/xonotic/serverlist.c +++ b/qcsrc/menu/xonotic/serverlist.c @@ -414,7 +414,7 @@ void XonoticServerList_toggleFavorite(entity me, string srv) f = 1; --i; } - + if(!f) { s1 = ""; @@ -1077,7 +1077,7 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float theAlpha = SKINALPHA_SERVERLIST_FULL; else if(freeslots == 0) theAlpha = SKINALPHA_SERVERLIST_FULL; // g_maxplayers support - else if not(gethostcachenumber(SLIST_FIELD_NUMHUMANS, i)) + else if (!gethostcachenumber(SLIST_FIELD_NUMHUMANS, i)) theAlpha = SKINALPHA_SERVERLIST_EMPTY; else theAlpha = 1; @@ -1163,7 +1163,7 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float string n; - if not(me.seenIPv4 && me.seenIPv6) + if (!(me.seenIPv4 && me.seenIPv6)) { iconPos_x += iconSize_x * 0.5; } diff --git a/qcsrc/menu/xonotic/skinlist.c b/qcsrc/menu/xonotic/skinlist.c index fdb07870a4..3e094e7d7e 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/slider.c b/qcsrc/menu/xonotic/slider.c index e833bb1251..0577207ca2 100644 --- a/qcsrc/menu/xonotic/slider.c +++ b/qcsrc/menu/xonotic/slider.c @@ -58,14 +58,14 @@ void XonoticSlider_setValue(entity me, float val) } void XonoticSlider_loadCvars(entity me) { - if not(me.cvarName) + if (!me.cvarName) return; me.setValue( me, cvar(me.cvarName) ); } void XonoticSlider_saveCvars(entity me) { - if not(me.cvarName) + if (!me.cvarName) return; cvar_set(me.cvarName, ftos(me.value)); diff --git a/qcsrc/menu/xonotic/slider_decibels.c b/qcsrc/menu/xonotic/slider_decibels.c index 0ea9d161f1..f70f433970 100644 --- a/qcsrc/menu/xonotic/slider_decibels.c +++ b/qcsrc/menu/xonotic/slider_decibels.c @@ -48,7 +48,7 @@ void XonoticDecibelsSlider_loadCvars(entity me) { float v; - if not(me.cvarName) + if (!me.cvarName) return; v = cvar(me.cvarName); @@ -61,7 +61,7 @@ void XonoticDecibelsSlider_loadCvars(entity me) } void XonoticDecibelsSlider_saveCvars(entity me) { - if not(me.cvarName) + if (!me.cvarName) return; if(me.value > me.valueMax - 0.5 * me.valueStep) diff --git a/qcsrc/menu/xonotic/textslider.c b/qcsrc/menu/xonotic/textslider.c index 3fee2bf558..a4448f7deb 100644 --- a/qcsrc/menu/xonotic/textslider.c +++ b/qcsrc/menu/xonotic/textslider.c @@ -52,7 +52,7 @@ void XonoticTextSlider_setValue(entity me, float val) } void XonoticTextSlider_loadCvars(entity me) { - if not(me.cvarName) + if (!me.cvarName) return; var float n = tokenize_console(me.cvarName); @@ -74,7 +74,7 @@ void XonoticTextSlider_loadCvars(entity me) } void XonoticTextSlider_saveCvars(entity me) { - if not(me.cvarName) + if (!me.cvarName) return; if(me.value >= 0 && me.value < me.nValues) diff --git a/qcsrc/menu/xonotic/util.qc b/qcsrc/menu/xonotic/util.qc index dd022eb699..34f67397eb 100644 --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@ -494,7 +494,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); @@ -552,7 +552,7 @@ void preMenuDraw() draw_CenterText(mid - 1 * line, l1, fs, '1 0 0', 1, 0); draw_CenterText(mid - 0 * line, l2, fs, '0 0 1', 1, 0); } - if not(campaign_name_previous) + if (!campaign_name_previous) campaign_name_previous = strzone(strcat(campaign_name, "x")); // force unequal if(campaign_name == campaign_name_previous) { @@ -640,7 +640,6 @@ float updateCompression() // note: include only those that should be in the menu! #define GAMETYPES \ - GAMETYPE(MAPINFO_TYPE_ARENA) \ GAMETYPE(MAPINFO_TYPE_ASSAULT) \ GAMETYPE(MAPINFO_TYPE_CTF) \ GAMETYPE(MAPINFO_TYPE_CA) \ @@ -661,13 +660,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; } @@ -675,31 +674,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 ""; } @@ -707,7 +706,7 @@ string GameType_GetIcon(float cnt) { float i = GameType_GetID(cnt); string s = _MapInfo_GetDefaultEx(i); - + if(i) { if(strstrofs(s, "teams", 0) >= 0) @@ -715,7 +714,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 6790befe12..ad4071060f 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 d9f1add2c5..6ec1756ed6 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/accuracy.qc b/qcsrc/server/accuracy.qc index dfc923b2bb..aca64a431a 100644 --- a/qcsrc/server/accuracy.qc +++ b/qcsrc/server/accuracy.qc @@ -25,7 +25,7 @@ float accuracy_send(entity to, float sf) a = a.accuracy; if(to != a.owner) - if not(self.owner.cvar_cl_accuracy_data_share && autocvar_sv_accuracy_data_share) + if (!(self.owner.cvar_cl_accuracy_data_share && autocvar_sv_accuracy_data_share)) sf = 0; // note: zero sendflags can never be sent... so we can use that to say that we send no accuracy! WriteInt24_t(MSG_ENTITY, sf); diff --git a/qcsrc/server/antilag.qc b/qcsrc/server/antilag.qc index 5e0a91a3e8..c53452ab78 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/autocvars.qh b/qcsrc/server/autocvars.qh index 759aea6add..19187a39de 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -70,14 +70,7 @@ float autocvar_ekg; #define autocvar_fraglimit_override cvar("fraglimit_override") float autocvar_g_allow_oldnexbeam; float autocvar_g_antilag; -float autocvar_g_antilag_bullets; float autocvar_g_antilag_nudge; -float autocvar_g_arena_maxspawned; -float autocvar_g_arena_point_leadlimit; -float autocvar_g_arena_point_limit; -float autocvar_g_arena_roundbased; -float autocvar_g_arena_round_timelimit; -float autocvar_g_arena_warmup; float autocvar_g_balance_armor_blockpercent; float autocvar_g_balance_armor_limit; float autocvar_g_balance_armor_regen; @@ -808,6 +801,7 @@ float autocvar_g_domination_point_leadlimit; float autocvar_g_domination_point_rate; float autocvar_g_domination_teams_override; float autocvar_g_forced_respawn; +float autocvar_g_respawn_delay_max; string autocvar_g_forced_team_blue; string autocvar_g_forced_team_otherwise; string autocvar_g_forced_team_pink; diff --git a/qcsrc/server/bot/aim.qc b/qcsrc/server/bot/aim.qc index 578306c4eb..3467e2b395 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/bot.qc b/qcsrc/server/bot/bot.qc index 45c7af3b7e..b93d87ad29 100644 --- a/qcsrc/server/bot/bot.qc +++ b/qcsrc/server/bot/bot.qc @@ -363,7 +363,7 @@ void bot_relinkplayerlist() void bot_clientdisconnect() { - if not(IS_BOT_CLIENT(self)) + if (!IS_BOT_CLIENT(self)) return; bot_clearqueue(self); if(self.cleanname) @@ -386,7 +386,7 @@ void bot_clientdisconnect() void bot_clientconnect() { - if not(IS_BOT_CLIENT(self)) + if (!IS_BOT_CLIENT(self)) return; self.bot_preferredcolors = self.clientcolors; self.bot_nextthink = time - random(); @@ -551,7 +551,7 @@ float bot_fixcount() FOR_EACH_REALCLIENT(head) { - if(IS_PLAYER(head) || g_lms || g_arena || head.caplayer == 1) + if(IS_PLAYER(head) || g_lms || head.caplayer == 1) ++activerealplayers; ++realplayers; } diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index 7e23903ed2..a0e6bfffd4 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -20,7 +20,7 @@ void havocbot_ai() } else { - if not(self.jumppadcount) + if (!self.jumppadcount) self.havocbot_role(); } @@ -146,7 +146,7 @@ void havocbot_ai() havocbot_movetogoal(); // if the bot is not attacking, consider reloading weapons - if not(self.aistatus & AI_STATUS_ATTACKING) + if (!(self.aistatus & AI_STATUS_ATTACKING)) { float i; entity e; @@ -316,7 +316,7 @@ void havocbot_bunnyhop(vector dir) if(self.aistatus & AI_STATUS_ROAMING) if(self.goalcurrent.classname=="waypoint") - if not(self.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL) + if (!(self.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL)) if(fabs(gco_z - self.origin_z) < self.maxs_z - self.mins_z) if(self.goalstack01!=world) { @@ -422,7 +422,7 @@ void havocbot_movetogoal() } // Take off - if not(self.aistatus & AI_STATUS_JETPACK_FLYING) + if (!(self.aistatus & AI_STATUS_JETPACK_FLYING)) { // Brake almost completely so it can get a good direction if(vlen(self.velocity)>10) @@ -546,7 +546,7 @@ void havocbot_movetogoal() // If there is a trigger_hurt right below try to use the jetpack or make a rocketjump if(skill>6) - if not(self.flags & FL_ONGROUND) + if (!(self.flags & FL_ONGROUND)) { tracebox(self.origin, self.mins, self.maxs, self.origin + '0 0 -65536', MOVE_NOMONSTERS, self); if(tracebox_hits_trigger_hurt(self.origin, self.mins, self.maxs, trace_endpos )) diff --git a/qcsrc/server/bot/havocbot/role_onslaught.qc b/qcsrc/server/bot/havocbot/role_onslaught.qc index ab53728333..dc942a3821 100644 --- a/qcsrc/server/bot/havocbot/role_onslaught.qc +++ b/qcsrc/server/bot/havocbot/role_onslaught.qc @@ -156,7 +156,7 @@ void havocbot_goalrating_ons_controlpoints_attack(float ratingscale) cp = world; for (; cp1; cp1 = cp1.chain) { - if not(cp1.wpconsidered) + if (!cp1.wpconsidered) continue; if(cp1.wpcost self.pauseregen_finished) * ((self.items & IT_FUEL_REGEN) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, rot_mod * frametime * (time > self.pauserotfuel_finished), limitf); } @@ -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,27 +1746,27 @@ 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; - if not(IS_PLAYER(self.enemy)) + if (!IS_PLAYER(self.enemy)) return 0; SpectateCopy(self.enemy); @@ -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; } @@ -1861,7 +1861,7 @@ float SpectatePrev() { // NOTE: chain order is from the highest to the lower entnum (unlike find) other = findchain(classname, "player"); - if not(other) // no player + if (!other) // no player return FALSE; entity first = other; @@ -1875,7 +1875,7 @@ float SpectatePrev() do { other = other.chain; } while(other && other.team != self.team); - if not(other) + if (!other) { other = first; while(other.team != self.team) @@ -2135,7 +2135,7 @@ void SpectatorThink() void PlayerUseKey() { - if not(IS_PLAYER(self)) + if (!IS_PLAYER(self)) return; if(self.vehicle) @@ -2143,7 +2143,7 @@ void PlayerUseKey() vehicles_exit(VHEF_NORMAL); return; } - + // a use key was pressed; call handlers MUTATOR_CALLHOOK(PlayerUseKey); } @@ -2305,10 +2305,10 @@ 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) + if((self.respawn_flags & RESPAWN_FORCE) && !autocvar_g_respawn_delay_max) self.deadflag = DEAD_RESPAWNING; else if(!button_pressed) self.deadflag = DEAD_DEAD; @@ -2317,6 +2317,8 @@ void PlayerPreThink (void) { if(button_pressed) self.deadflag = DEAD_RESPAWNABLE; + else if(time >= self.respawn_time_max && (self.respawn_flags & RESPAWN_FORCE)) + self.deadflag = DEAD_RESPAWNING; } else if (self.deadflag == DEAD_RESPAWNABLE) { @@ -2328,6 +2330,7 @@ void PlayerPreThink (void) if(time > self.respawn_time) { self.respawn_time = time + 1; // only retry once a second + self.respawn_time_max = self.respawn_time; respawn(); } } @@ -2336,6 +2339,8 @@ void PlayerPreThink (void) if(self.respawn_flags & RESPAWN_SILENT) self.stat_respawn_time = 0; + else if((self.respawn_flags & RESPAWN_FORCE) && autocvar_g_respawn_delay_max) + self.stat_respawn_time = self.respawn_time_max; else self.stat_respawn_time = self.respawn_time; } @@ -2410,10 +2415,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 +2578,7 @@ void PlayerPostThink (void) return; // intermission or finale GetPressedKeys(); } - + #ifdef TETRIS } #endif @@ -2603,7 +2608,7 @@ void PlayerPostThink (void) if((g_cts || g_race) && self.cvar_cl_allow_uidtracking == 1 && self.cvar_cl_allow_uid2name == 1) { - if not(self.stored_netname) + if (!self.stored_netname) self.stored_netname = strzone(uid2name(self.crypto_idfp)); if(self.stored_netname != self.netname) { diff --git a/qcsrc/server/cl_impulse.qc b/qcsrc/server/cl_impulse.qc index a94ba29015..a4376bd418 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)) { } @@ -168,7 +168,7 @@ void ImpulseCommands (void) case 33: if(self.deadflag == DEAD_NO && teamplay) { - if not(MUTATOR_CALLHOOK(HelpMePing)) + if (!MUTATOR_CALLHOOK(HelpMePing)) { wp = WaypointSprite_Attach("helpme", TRUE, RADARICON_HELPME, '1 0.5 0'); if(!wp) @@ -256,7 +256,7 @@ void ImpulseCommands (void) case 104: e = navigation_findnearestwaypoint(self, FALSE); if (e) - if not(e.wpflags & WAYPOINTFLAG_GENERATED) + if (!(e.wpflags & WAYPOINTFLAG_GENERATED)) { bprint(strcat("Waypoint removed at ",vtos(e.origin),"\n")); waypoint_remove(e); @@ -299,7 +299,7 @@ void ImpulseCommands (void) { print("cannot reach me: ", etos(e), " ", vtos(e.origin), "\n"); e.colormod_x = 8; - if not(e.effects & EF_NODEPTHTEST) // not already reported before + if(!(e.effects & EF_NODEPTHTEST)) // not already reported before ++m; e.effects |= EF_NODEPTHTEST | EF_RED; ++i; diff --git a/qcsrc/server/cl_physics.qc b/qcsrc/server/cl_physics.qc index b5b6ad7935..edad6d63f8 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)) @@ -804,7 +804,7 @@ void SV_PlayerPhysics() if(self.conveyor.state) self.velocity -= self.conveyor.movedir; - if not(IS_PLAYER(self)) + if (!IS_PLAYER(self)) { maxspd_mod = autocvar_sv_spectator_speed_multiplier; if(!self.spectatorspeed) @@ -860,12 +860,12 @@ void SV_PlayerPhysics() if(self.waterlevel < WATERLEVEL_SWIMMING) if(time >= self.ladder_time) - if not(self.hook) + if (!self.hook) { self.nextstep = time + 0.3 + random() * 0.1; trace_dphitq3surfaceflags = 0; tracebox(self.origin, self.mins, self.maxs, self.origin - '0 0 1', MOVE_NOMONSTERS, self); - if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS) + if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS)) { if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS) GlobalSound(globalsound_metalfall, CH_PLAYER, VOICETYPE_PLAYERSOUND); @@ -1076,7 +1076,7 @@ void SV_PlayerPhysics() if (f > 0 && wishvel != '0 0 0') { self.velocity = self.velocity + wishvel * f * frametime; - if not(self.items & IT_UNLIMITED_WEAPON_AMMO) + if (!(self.items & IT_UNLIMITED_WEAPON_AMMO)) self.ammo_fuel -= autocvar_g_jetpack_fuel * frametime * fvel * f; self.flags &= ~FL_ONGROUND; self.items |= IT_USING_JETPACK; diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 63924e60fe..eb3e81fbb2 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -637,6 +637,10 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht self.respawn_time = ceil((time + sdelay) / waves) * waves; else self.respawn_time = time + sdelay; + if(autocvar_g_respawn_delay_max > sdelay) + self.respawn_time_max = time + autocvar_g_respawn_delay_max; + else + self.respawn_time_max = self.respawn_time; if((sdelay + waves >= 5.0) && (self.respawn_time - time > 1.75)) self.respawn_countdown = 10; // first number to count down from is 10 else @@ -697,7 +701,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f msgin = formatmessage(msgin); - if not(IS_PLAYER(source)) + if (!IS_PLAYER(source)) colorstr = "^0"; // black for spectators else if(teamplay) colorstr = Team_ColorCode(source.team); @@ -857,9 +861,9 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f } if(!privatesay) - if not(IS_PLAYER(source)) + if (!IS_PLAYER(source)) { - if not(intermission_running) + if (!intermission_running) if(teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !(warmup_stage || gameover))) teamsay = -1; // spectators } @@ -903,7 +907,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f { sprint(source, sourcemsgstr); sprint(privatesay, msgstr); - if not(autocvar_g_chat_tellprivacy) { dedicated_print(msgstr); } // send to server console too if "tellprivacy" is disabled + if (!autocvar_g_chat_tellprivacy) { dedicated_print(msgstr); } // send to server console too if "tellprivacy" is disabled if(cmsgstr != "") centerprint(privatesay, cmsgstr); } @@ -925,7 +929,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f { sprint(source, sourcemsgstr); dedicated_print(msgstr); // send to server console too - FOR_EACH_REALCLIENT(head) if not(IS_PLAYER(head)) + FOR_EACH_REALCLIENT(head) if (!IS_PLAYER(head)) if(head != source) sprint(head, msgstr); } @@ -1014,7 +1018,7 @@ void PrecachePlayerSounds(string f) } fclose(fh); - if not(allvoicesamples) + if (!allvoicesamples) { #define _VOICEMSG(m) allvoicesamples = strcat(allvoicesamples, " ", #m); ALLVOICEMSGS diff --git a/qcsrc/server/cl_weapons.qc b/qcsrc/server/cl_weapons.qc index 2fc23307ed..88397a8802 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,8 +345,8 @@ 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 not(a) return; + + 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 f530b54046..8d72a798ba 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -93,7 +93,7 @@ void W_HitPlotAnalysis(entity player, vector screenforward, vector screenright, lag = ANTILAG_LATENCY(player); if(lag < 0.001) lag = 0; - if not(IS_REAL_CLIENT(player)) + if (!IS_REAL_CLIENT(player)) lag = 0; // only antilag for clients org = player.origin + player.view_ofs; @@ -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; @@ -733,7 +733,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) { if(e.classname == "droppedweapon") continue; - if not(e.flags & FL_ITEM) + if (!(e.flags & FL_ITEM)) continue; WaypointSprite_Spawn( s, @@ -816,7 +816,7 @@ void W_SwitchToOtherWeapon(entity pl) .float prevwarntime; float weapon_prepareattack_checkammo(float secondary) { - if not(self.items & IT_UNLIMITED_WEAPON_AMMO) + if (!(self.items & IT_UNLIMITED_WEAPON_AMMO)) if (!weapon_action(self.weapon, WR_CHECKAMMO1 + secondary)) { // always keep the Mine Layer if we placed mines, so that we can detonate them @@ -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! @@ -1342,7 +1342,7 @@ void W_Reload(float sent_ammo_min, float sent_ammo_amount, float sent_time, stri e = get_weaponinfo(self.weapon); // don't reload weapons that don't have the RELOADABLE flag - if not(e.spawnflags & WEP_FLAG_RELOADABLE) + if (!(e.spawnflags & WEP_FLAG_RELOADABLE)) { dprint("Warning: Attempted to reload a weapon that does not have the WEP_FLAG_RELOADABLE flag. Fix your code!\n"); return; @@ -1358,7 +1358,7 @@ void W_Reload(float sent_ammo_min, float sent_ammo_amount, float sent_time, stri // no ammo, so nothing to load if(!self.(self.current_ammo) && self.reload_ammo_min) - if not(self.items & IT_UNLIMITED_WEAPON_AMMO) + if (!(self.items & IT_UNLIMITED_WEAPON_AMMO)) { if(IS_REAL_CLIENT(self) && self.reload_complain < time) { @@ -1367,7 +1367,7 @@ void W_Reload(float sent_ammo_min, float sent_ammo_amount, float sent_time, stri self.reload_complain = time + 1; } // switch away if the amount of ammo is not enough to keep using this weapon - if not(weapon_action(self.weapon, WR_CHECKAMMO1) + weapon_action(self.weapon, WR_CHECKAMMO2)) + if (!(weapon_action(self.weapon, WR_CHECKAMMO1) + weapon_action(self.weapon, WR_CHECKAMMO2))) { self.clip_load = -1; // reload later W_SwitchToOtherWeapon(self); diff --git a/qcsrc/server/command/banning.qc b/qcsrc/server/command/banning.qc index 1694bb661d..794854dedd 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 4850049e5c..363bb7c4c3 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -5,7 +5,7 @@ float SV_ParseClientCommand_floodcheck() { - if not(timeout_status) // not while paused + if (!timeout_status) // not while paused { if(time <= (self.cmd_floodtime + autocvar_sv_clientcommand_antispam_time)) { @@ -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) { @@ -150,9 +150,9 @@ void ClientCommand_join(float request) { if(IS_CLIENT(self)) { - if(!IS_PLAYER(self) && !lockteams && !g_arena) + if(!IS_PLAYER(self) && !lockteams) { - 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: { @@ -208,7 +208,7 @@ void ClientCommand_ready(float request) // todo: anti-spam for toggling readynes } // cannot reset the game while a timeout is active! - if not(timeout_status) + if (!timeout_status) ReadyCount(); } else { sprint(self, "^1Game has already been restarted\n"); @@ -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: { @@ -279,11 +279,11 @@ void ClientCommand_selectteam(float request, float argc) if(IS_CLIENT(self)) { if(teamplay) - if not(self.team_forced > 0) - if not(lockteams) + if(self.team_forced <= 0) + 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,6 @@ void ClientCommand_spectate(float request) { if(IS_CLIENT(self)) { - if(g_arena) { return; } if(g_lms) { if(self.lms_spectate_warning) @@ -411,8 +410,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 +424,7 @@ void ClientCommand_spectate(float request) } return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -448,7 +447,7 @@ void ClientCommand_suggestmap(float request, float argc) return; } } - + default: sprint(self, "Incorrect parameters for ^2suggestmap^7\n"); case CMD_REQUEST_USAGE: @@ -470,7 +469,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 +479,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 +499,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 +511,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 +536,10 @@ void ClientCommand_(float request) { case CMD_REQUEST_COMMAND: { - + return; // never fall through to usage } - + default: case CMD_REQUEST_USAGE: { @@ -575,15 +574,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 +590,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 +601,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 +631,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 +653,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 +684,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 ca59aba601..c5ae7c7be0 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -24,13 +24,13 @@ string GetCallerName(entity caller) // verify that the client provided is acceptable for use float VerifyClientEntity(entity client, float must_be_real, float must_be_bots) { - if not(IS_CLIENT(client)) + if (!IS_CLIENT(client)) return CLIENT_DOESNT_EXIST; else if(must_be_real && !IS_REAL_CLIENT(client)) 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: { @@ -479,9 +479,9 @@ void CommonCommand_timein(float request, entity caller) { if(!caller || autocvar_sv_timeout) { - if not(timeout_status) { print_to(caller, "^7Error: There is no active timeout called."); } + 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 415d20f9cf..a55e0e0cd2 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 not(r) + + 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 not(r) + + 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 not(r) + + 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 7fd7078135..331f5f95f4 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 b336d3ee26..ff07f2458a 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 not(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 not(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 not(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 not(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 not(shuffleteams_teams[i] >= x) + { + if (!(shuffleteams_teams[i] >= x)) { - if not(shuffleteams_players[z]) + 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 bb90536cf0..c3e8ca9fb3 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; } @@ -455,7 +455,7 @@ void ReadyRestart_force() if(autocvar_sv_timeout) { FOR_EACH_REALPLAYER(tmp_player) { tmp_player.allowed_timeouts = autocvar_sv_timeout_number; } } //reset map immediately if this cvar is not set - if not(autocvar_sv_ready_restart_after_countdown) { reset_map(TRUE); } + if (!autocvar_sv_ready_restart_after_countdown) { reset_map(TRUE); } if(autocvar_sv_eventlog) { GameLogEcho(":restart"); } } @@ -463,17 +463,17 @@ void ReadyRestart_force() void ReadyRestart() { // no arena, assault support yet... - if(g_arena | g_assault | gameover | intermission_running | race_completing) + if(g_assault | gameover | intermission_running | race_completing) localcmd("restart\n"); else localcmd("\nsv_hook_gamerestart\n"); // Reset ALL scores, but only do that at the beginning of the countdown if sv_ready_restart_after_countdown is off! // Otherwise scores could be manipulated during the countdown. - if not(autocvar_sv_ready_restart_after_countdown) { Score_ClearAll(); } + 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 not(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", @@ -680,10 +680,10 @@ float VoteCommand_parse(entity caller, string vote_command, string vote_list, fl ) return FALSE; - if not(VoteCommand_checkinlist(first_command, vote_list)) + if (!VoteCommand_checkinlist(first_command, vote_list)) return FALSE; - if not(VoteCommand_checkargs(startpos, argc)) + if (!VoteCommand_checkargs(startpos, argc)) return FALSE; switch(first_command) // now go through and parse the proper commands to adjust as needed. @@ -693,43 +693,43 @@ 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 { vote_command = ValidateMap(argv(startpos + 1), caller); - if not(vote_command) { return FALSE; } + 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; } } @@ -747,9 +747,9 @@ void VoteCommand_abstain(float request, entity caller) // CLIENT ONLY { case CMD_REQUEST_COMMAND: { - if not(vote_called) { print_to(caller, "^1No vote called."); } - else if not(caller.vote_selection == VOTE_SELECT_NULL || autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); } - + 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,23 +777,23 @@ 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 not(autocvar_sv_vote_call || !caller) { print_to(caller, "^1Vote calling is not allowed."); } + + 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."); } 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 if(caller && (time < caller.vote_waittime)) { print_to(caller, strcat("^1You have to wait ^2", ftos(ceil(caller.vote_waittime - time)), "^1 seconds before you can again call a vote.")); } - else if not(VoteCommand_checknasty(vote_command)) { print_to(caller, "^1Syntax error in command, see 'vhelp' for more info."); } - else if not(VoteCommand_parse(caller, vote_command, autocvar_sv_vote_commands, 2, argc)) { print_to(caller, "^1This command is not acceptable, see 'vhelp' for more info."); } + 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, autocvar_sv_vote_commands, 2, argc)) { print_to(caller, "^1This command is not acceptable, see 'vhelp' for more info."); } else // everything went okay, continue with calling the vote { @@ -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 not(caller.vote_master) { print_to(caller, "^1You do not have vote master privelages."); } - else if not(VoteCommand_checknasty(vote_command)) { print_to(caller, "^1Syntax error in command, see 'vhelp' for more info."); } - else if not(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."); } - + + 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,15 +859,15 @@ 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 not(autocvar_sv_vote_master_password != "") { print_to(caller, "^1Login to vote master is not allowed."); } + if(autocvar_sv_vote_master_password == "") { print_to(caller, "^1Login to vote master is not allowed."); } else if(caller.vote_master) { print_to(caller, "^1You are already logged in as vote master."); } - else if not(autocvar_sv_vote_master_password == argv(3)) { print_to(caller, strcat("Rejected vote master login from ", GetCallerName(caller))); } + else if(autocvar_sv_vote_master_password != argv(3)) { print_to(caller, strcat("Rejected vote master login from ", GetCallerName(caller))); } else // everything went okay, proceed with giving this player master privilages { @@ -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 not(autocvar_sv_vote_master_callable) { print_to(caller, "^1Vote to become vote master is not allowed."); } + + 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: { @@ -934,10 +934,10 @@ void VoteCommand_no(float request, entity caller) // CLIENT ONLY { case CMD_REQUEST_COMMAND: { - if not(vote_called) { print_to(caller, "^1No vote called."); } - else if not(caller.vote_selection == VOTE_SELECT_NULL || autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); } + 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: { @@ -989,13 +989,13 @@ void VoteCommand_stop(float request, entity caller) // BOTH { case CMD_REQUEST_COMMAND: { - if not(vote_called) { print_to(caller, "^1No vote called."); } + 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: { @@ -1012,9 +1012,9 @@ void VoteCommand_yes(float request, entity caller) // CLIENT ONLY { case CMD_REQUEST_COMMAND: { - if not(vote_called) { print_to(caller, "^1No vote called."); } - else if not(caller.vote_selection == VOTE_SELECT_NULL || autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); } - + 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 1225b6be58..0386e1d5a1 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 ac58a90c3e..4d208ebda8 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 fe41a23fab..72f4457d61 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 @@ -104,6 +104,7 @@ float server_is_dedicated; .float play_time; .float respawn_flags; .float respawn_time; +.float respawn_time_max; .float death_time; .float fade_time; .float fade_rate; @@ -475,7 +476,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 +517,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/ent_cs.qc b/qcsrc/server/ent_cs.qc index 8fce148d1f..7b3af04bfd 100644 --- a/qcsrc/server/ent_cs.qc +++ b/qcsrc/server/ent_cs.qc @@ -26,13 +26,13 @@ float entcs_customize() o = self.owner; if(o.deadflag != DEAD_NO) return FALSE; - if not(IS_PLAYER(o)) + if (!IS_PLAYER(o)) return FALSE; if(other == o) return FALSE; if((IS_PLAYER(other)) || other.caplayer) if(!teamplay || o.team != other.team) - if not (radar_showennemies) + if (!radar_showennemies) return FALSE; return TRUE; } diff --git a/qcsrc/server/func_breakable.qc b/qcsrc/server/func_breakable.qc index 8dca538f1a..d67e79cd4d 100644 --- a/qcsrc/server/func_breakable.qc +++ b/qcsrc/server/func_breakable.qc @@ -70,7 +70,7 @@ void LaunchDebris (string debrisname, vector force) void func_breakable_colormod() { float h; - if not(self.spawnflags & 2) + if (!(self.spawnflags & 2)) return; h = self.health / self.max_health; if(h < 0.25) @@ -79,6 +79,8 @@ void func_breakable_colormod() self.colormod = '1 0 0' + '0 1 0' * (2 * h - 0.5); else self.colormod = '1 1 1'; + + CSQCMODEL_AUTOUPDATE(); } void func_breakable_look_destroyed() @@ -140,12 +142,16 @@ void func_breakable_destroyed() { func_breakable_look_destroyed(); func_breakable_behave_destroyed(); + + CSQCMODEL_AUTOUPDATE(); } void func_breakable_restore() { func_breakable_look_restore(); func_breakable_behave_restore(); + + CSQCMODEL_AUTOUPDATE(); } vector debrisforce; // global, set before calling this @@ -217,6 +223,8 @@ void func_breakable_reset() func_breakable_behave_destroyed(); else func_breakable_behave_restore(); + + CSQCMODEL_AUTOUPDATE(); } // destructible walls that can be used to trigger target_objective_decrease @@ -268,6 +276,8 @@ void spawnfunc_func_breakable() { self.reset = func_breakable_reset; func_breakable_reset(); + + CSQCMODEL_AUTOINIT(); } // for use in maps with a "model" key set diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 15b7a62bf2..195829b40d 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -147,7 +147,7 @@ void GiveFrags (entity attacker, entity targ, float f, float deathtype) } // after a frag, choose another random weapon set - if not(attacker.weapons & WepSet_FromWeapon(attacker.weapon)) + if (!(attacker.weapons & WepSet_FromWeapon(attacker.weapon))) W_SwitchWeapon_Force(attacker, w_getbestweapon(attacker)); } @@ -225,7 +225,7 @@ void Obituary_SpecialDeath( if(DEATH_ISSPECIAL(deathtype)) { entity deathent = deathtypes[(deathtype - DT_FIRST)]; - if not(deathent) { backtrace("Obituary_SpecialDeath: Could not find deathtype entity!\n"); return; } + if (!deathent) { backtrace("Obituary_SpecialDeath: Could not find deathtype entity!\n"); return; } if(murder) { @@ -326,7 +326,7 @@ float Obituary_WeaponDeath( void Obituary(entity attacker, entity inflictor, entity targ, float deathtype) { // Sanity check - if not(IS_PLAYER(targ)) { backtrace("Obituary called on non-player?!\n"); return; } + if (!IS_PLAYER(targ)) { backtrace("Obituary called on non-player?!\n"); return; } // Declarations float notif_firstblood = FALSE; @@ -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); @@ -379,7 +379,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype) } } } - else if not(Obituary_WeaponDeath(targ, FALSE, deathtype, targ.netname, deathlocation, "", targ.killcount, 0)) + else if (!Obituary_WeaponDeath(targ, FALSE, deathtype, targ.netname, deathlocation, "", targ.killcount, 0)) { backtrace("SUICIDE: what the hell happened here?\n"); return; @@ -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); @@ -493,7 +493,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype) ); } - if not(Obituary_WeaponDeath(targ, TRUE, deathtype, targ.netname, attacker.netname, deathlocation, targ.killcount, kill_count_to_attacker)) + if (!Obituary_WeaponDeath(targ, TRUE, deathtype, targ.netname, attacker.netname, deathlocation, targ.killcount, kill_count_to_attacker)) Obituary_SpecialDeath(targ, TRUE, deathtype, targ.netname, attacker.netname, deathlocation, targ.killcount, kill_count_to_attacker, 0); } } @@ -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... @@ -669,7 +669,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float } } - if not(DEATH_ISSPECIAL(deathtype)) + if (!DEATH_ISSPECIAL(deathtype)) { damage *= g_weapondamagefactor; mirrordamage *= g_weapondamagefactor; @@ -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,8 +689,8 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float damage = frag_damage; mirrordamage = frag_mirrordamage; force = frag_force; - - if not(g_minstagib) + + if (!g_minstagib) { // apply strength multiplier if (attacker.items & IT_STRENGTH) @@ -749,7 +749,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float damage_goodhits += 1; damage_gooddamage += damage; - if not(DEATH_ISSPECIAL(deathtype)) + if (!DEATH_ISSPECIAL(deathtype)) { if(IS_PLAYER(targ)) // don't do this for vehicles if(IsFlying(victim)) @@ -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; @@ -1187,7 +1187,7 @@ void Fire_ApplyDamage(entity e) float t, d, hi, ty; entity o; - if not(Fire_IsBurning(e)) + if (!Fire_IsBurning(e)) return; for(t = 0, o = e.owner; o.owner && t < 16; o = o.owner, ++t); @@ -1216,12 +1216,12 @@ void Fire_ApplyDamage(entity e) } e.fire_hitsound = TRUE; - if not(IS_INDEPENDENT_PLAYER(e)) + if (!IS_INDEPENDENT_PLAYER(e)) FOR_EACH_PLAYER(other) if(e != other) { if(IS_PLAYER(other)) if(other.deadflag == DEAD_NO) - if not(IS_INDEPENDENT_PLAYER(other)) + if (!IS_INDEPENDENT_PLAYER(other)) if(boxesoverlap(e.absmin, e.absmax, other.absmin, other.absmax)) { t = autocvar_g_balance_firetransfer_time * (e.fire_endtime - time); diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index bde5e580a0..0df6ba0aee 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) @@ -383,7 +383,7 @@ void GrapplingHookFrame() // offhand hook controls if(self.BUTTON_HOOK) { - if not(self.hook || (self.hook_state & HOOK_WAITING_FOR_RELEASE)) + if (!(self.hook || (self.hook_state & HOOK_WAITING_FOR_RELEASE))) { self.hook_state |= HOOK_FIRING; self.hook_state |= HOOK_WAITING_FOR_RELEASE; diff --git a/qcsrc/server/g_models.qc b/qcsrc/server/g_models.qc index 20a78b7c9d..8a2fe9ef33 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 cc6f3694b9..834bb47116 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(); @@ -467,7 +467,7 @@ void tracebox_antilag_force_wz (entity source, vector v1, vector mi, vector ma, // check whether antilagged traces are enabled if (lag < 0.001) lag = 0; - if not(IS_REAL_CLIENT(forent)) + if (!IS_REAL_CLIENT(forent)) lag = 0; // only antilag for clients // change shooter to SOLID_BBOX so the shot can hit corpses @@ -799,7 +799,7 @@ void LODmodel_attach() } if(self.lodmodelindex1) - if not(self.SendEntity) + if (!self.SendEntity) SetCustomizer(self, LOD_customize, LOD_uncustomize); } diff --git a/qcsrc/server/g_triggers.qc b/qcsrc/server/g_triggers.qc index 359bf84a36..c0e81fa891 100644 --- a/qcsrc/server/g_triggers.qc +++ b/qcsrc/server/g_triggers.qc @@ -164,7 +164,7 @@ void multi_trigger() if (self.classname == "trigger_secret") { - if not(IS_PLAYER(self.enemy)) + if (!IS_PLAYER(self.enemy)) return; found_secrets = found_secrets + 1; WriteByte (MSG_ALL, SVC_FOUNDSECRET); @@ -205,8 +205,8 @@ void multi_use() void multi_touch() { - if not(self.spawnflags & 2) - if not(other.iscreature) + if (!(self.spawnflags & 2)) + if (!other.iscreature) return; if(self.team) @@ -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) @@ -459,7 +459,7 @@ void trigger_hurt_touch() entity own; own = self.enemy; - if not(IS_PLAYER(own)) + if (!IS_PLAYER(own)) { own = self; self.enemy = world; // I still hate you all @@ -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) @@ -628,7 +628,7 @@ void trigger_gravity_touch() g = self.gravity; - if not(self.spawnflags & 1) + if (!(self.spawnflags & 1)) { if(other.trigger_gravity_check) { @@ -691,7 +691,7 @@ void spawnfunc_trigger_gravity() void target_speaker_use_off(); void target_speaker_use_activator() { - if not(IS_REAL_CLIENT(activator)) + if (!IS_REAL_CLIENT(activator)) return; string snd; if(substring(self.noise, 0, 1) == "*") @@ -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) @@ -1164,7 +1164,7 @@ void misc_laser_think() if(self.enemy) { o = self.enemy.origin; - if not(self.spawnflags & 2) + if (!(self.spawnflags & 2)) o = self.origin + normalize(o - self.origin) * 32768; } else @@ -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)) @@ -1766,7 +1766,7 @@ void target_voicescript_next(entity pl) return; if(vs.message == "") return; - if not(IS_PLAYER(pl)) + if (!IS_PLAYER(pl)) return; if(gameover) return; @@ -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; @@ -1918,13 +1918,13 @@ string trigger_magicear_processmessage(entity ear, entity source, float teamsay, dotrigger = ((IS_PLAYER(source)) && (source.deadflag == DEAD_NO) && ((ear.radius == 0) || (vlen(source.origin - ear.origin) <= ear.radius))); domatch = ((ear.spawnflags & 32) || dotrigger); - if not(domatch) + if (!domatch) return msgin; - if not(msgin) + if (!msgin) { // we are in TUBA mode! - if not(ear.spawnflags & 256) + if (!(ear.spawnflags & 256)) return msgin; if(!W_Tuba_HasPlayed(source, ear.message, ear.movedir_x, !(ear.spawnflags & 512), ear.movedir_y, ear.movedir_z)) @@ -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); @@ -2062,7 +2062,7 @@ string trigger_magicear_processmessage_forallears(entity source, float teamsay, for(ear = magicears; ear; ear = ear.enemy) { msgout = trigger_magicear_processmessage(ear, source, teamsay, privatesay, msgin); - if not(ear.spawnflags & 64) + if (!(ear.spawnflags & 64)) if(magicear_matched) return msgout; msgin = msgout; @@ -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 68532192ec..42c2d7a8e4 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -253,7 +253,6 @@ void cvar_changes_init() // mapinfo BADCVAR("fraglimit"); - BADCVAR("g_arena"); BADCVAR("g_assault"); BADCVAR("g_ca"); BADCVAR("g_ca_teams"); @@ -304,7 +303,6 @@ void cvar_changes_init() // does nothing visible BADCVAR("captureleadlimit_override"); - BADCVAR("g_arena_point_leadlimit"); BADCVAR("g_balance_kill_delay"); BADCVAR("g_ca_point_leadlimit"); BADCVAR("g_ctf_captimerecord_always"); @@ -428,7 +426,7 @@ void cvar_changes_init() BADCVAR("g_nix"); BADCVAR("g_grappling_hook"); BADCVAR("g_jetpack"); - + #undef BADPREFIX #undef BADCVAR @@ -1401,7 +1399,7 @@ void DumpStats(float final) { s = strcat(":player:see-labels:", GetPlayerScoreString(other, 0), ":"); s = strcat(s, ftos(rint(time - other.jointime)), ":"); - if(IS_PLAYER(other) || g_arena || other.caplayer == 1 || g_lms) + if(IS_PLAYER(other) || other.caplayer == 1 || g_lms) s = strcat(s, ftos(other.team), ":"); else s = strcat(s, "spectator:"); @@ -1514,7 +1512,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) @@ -1855,7 +1853,7 @@ float WinningCondition_Scores(float limit, float leadlimit) if(WinningConditionHelper_zeroisworst) leadlimit = 0; // not supported in this mode - if(g_dm || g_tdm || g_arena || g_ca || (g_race && !g_race_qualifying) || g_nexball) + if(g_dm || g_tdm || g_ca || (g_race && !g_race_qualifying) || g_nexball) // these modes always score in increments of 1, thus this makes sense { if(leaderfrags != WinningConditionHelper_topscore) @@ -2238,7 +2236,7 @@ string MapVote_Suggest(string m) if(mapvote_initialized) return "Can't suggest - voting is already in progress!"; m = MapInfo_FixName(m); - if not(m) + if (!m) return "The map you suggested is not available on this server."; if(!autocvar_g_maplist_votable_suggestions_override_mostrecent) if(Map_IsRecent(m)) diff --git a/qcsrc/server/ipban.qc b/qcsrc/server/ipban.qc index 08fd83fe3f..a180547c0f 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 @@ -434,7 +434,7 @@ float Ban_IsClientBanned(entity client, float idx) { if(!autocvar_g_banned_list_idmode) return TRUE; - if not(ban_idfp) + if (!ban_idfp) return TRUE; } return FALSE; diff --git a/qcsrc/server/item_key.qc b/qcsrc/server/item_key.qc index 5c7e30e36e..f181f37644 100644 --- a/qcsrc/server/item_key.qc +++ b/qcsrc/server/item_key.qc @@ -9,8 +9,8 @@ TODO: float item_keys_usekey(entity l, entity p) { float valid = l.itemkeys & p.itemkeys; - - if not(valid) { + + if (!valid) { // other has none of the needed keys return FALSE; } else if (l.itemkeys == valid) { @@ -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 not(keylist) + 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; } @@ -63,16 +63,16 @@ item_key * Key touch handler. */ void item_key_touch(void) { - if not(IS_PLAYER(other)) + 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 not(IS_PLAYER(other)) + 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 91e922869b..e7e771dc6e 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -96,7 +96,7 @@ const string STR_OBSERVER = "observer"; #define FOR_EACH_REALCLIENT(v) FOR_EACH_CLIENT(v) if(IS_REAL_CLIENT(v)) #define FOR_EACH_PLAYER(v) FOR_EACH_CLIENT(v) if(IS_PLAYER(v)) -#define FOR_EACH_SPEC(v) FOR_EACH_CLIENT(v) if not(IS_PLAYER(v)) // Samual: shouldn't this be IS_SPEC(v)? and rather create a separate macro to include observers too +#define FOR_EACH_SPEC(v) FOR_EACH_CLIENT(v) if (!IS_PLAYER(v)) // Samual: shouldn't this be IS_SPEC(v)? and rather create a separate macro to include observers too #define FOR_EACH_REALPLAYER(v) FOR_EACH_REALCLIENT(v) if(IS_PLAYER(v)) #define CENTER_OR_VIEWOFS(ent) (ent.origin + (IS_PLAYER(ent) ? ent.view_ofs : ((ent.mins + ent.maxs) * 0.5))) @@ -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? @@ -713,7 +713,7 @@ void readplayerstartcvars() for (j = WEP_FIRST; j <= WEP_LAST; ++j) { e = get_weaponinfo(j); - if not(e.spawnflags & WEP_FLAG_MUTATORBLOCKED) + if (!(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)) g_weaponarena_weapons |= WepSet_FromWeapon(j); } } @@ -724,7 +724,7 @@ void readplayerstartcvars() for (j = WEP_FIRST; j <= WEP_LAST; ++j) { e = get_weaponinfo(j); - if not(e.spawnflags & WEP_FLAG_MUTATORBLOCKED) + if (!(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)) if (e.spawnflags & WEP_FLAG_NORMAL) g_weaponarena_weapons |= WepSet_FromWeapon(j); } @@ -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"); @@ -970,7 +970,7 @@ void readlevelcvars(void) g_warmup_allguns = cvar("g_warmup_allguns"); g_warmup_allow_timeout = cvar("g_warmup_allow_timeout"); - if ((g_race && g_race_qualifying == 2) || g_arena || g_assault || cvar("g_campaign")) + if ((g_race && g_race_qualifying == 2) || g_assault || cvar("g_campaign")) warmup_stage = 0; // these modes cannot work together, sorry g_pickup_respawntime_weapon = cvar("g_pickup_respawntime_weapon"); @@ -1037,7 +1037,7 @@ void readlevelcvars(void) if(!g_weapon_stay) g_weapon_stay = cvar("g_weapon_stay"); - if not(warmup_stage) + if (!warmup_stage) game_starttime = time + cvar("g_start_delay"); readplayerstartcvars(); @@ -1645,7 +1645,7 @@ void adaptor_think2use() void adaptor_think2use_hittype_splash() // for timed projectile detonation { - if not(self.flags & FL_ONGROUND) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING + if(!(self.flags & FL_ONGROUND)) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING self.projectiledeathtype |= HITTYPE_SPLASH; adaptor_think2use(); } @@ -1818,7 +1818,7 @@ string uid2name(string myuid) { db_put(ServerProgsDB, strcat("uid2name", myuid), ""); } } - + if(s == "") s = "^1Unregistered Player"; return s; @@ -2336,7 +2336,7 @@ void shockwave_spawn(string m, vector org, float sz, float t1, float t2) float randombit(float bits) { - if not(bits & (bits-1)) // this ONLY holds for powers of two! + if(!(bits & (bits-1))) // this ONLY holds for powers of two! return bits; float n, f, b, r; @@ -2404,7 +2404,7 @@ float ExponentialFalloff(float mindist, float maxdist, float halflifedist, float #else string cvar_string_normal(string n) { - if not(cvar_type(n) & 1) + if (!(cvar_type(n) & 1)) backtrace(strcat("Attempt to access undefined cvar: ", n)); return builtin_cvar_string(n); } diff --git a/qcsrc/server/movelib.qc b/qcsrc/server/movelib.qc index 9b9f7fde01..de82b16a8a 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.qc b/qcsrc/server/mutators/base.qc index f4761b884d..d2cec391b9 100644 --- a/qcsrc/server/mutators/base.qc +++ b/qcsrc/server/mutators/base.qc @@ -101,7 +101,7 @@ float Mutator_Add(mutatorfunc_t func, string name) { if(name == loaded_mutators[i]) return 1; // already added - if not(loaded_mutators[i]) + if (!(loaded_mutators[i])) j = i; } if(j < 0) diff --git a/qcsrc/server/mutators/base.qh b/qcsrc/server/mutators/base.qh index 98a44944dd..893ebb301f 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 deleted file mode 100644 index bb6312ea1f..0000000000 --- a/qcsrc/server/mutators/gamemode_arena.qc +++ /dev/null @@ -1,288 +0,0 @@ -.float spawned; -float maxspawned; -float numspawned; -.entity spawnqueue_next; -.entity spawnqueue_prev; -.float spawnqueue_in; -entity spawnqueue_first; -entity spawnqueue_last; - -void Spawnqueue_Insert(entity e) -{ - if(e.spawnqueue_in) - return; - dprint(strcat("Into queue: ", e.netname, "\n")); - e.spawnqueue_in = TRUE; - e.spawnqueue_prev = spawnqueue_last; - e.spawnqueue_next = world; - if(spawnqueue_last) - spawnqueue_last.spawnqueue_next = e; - spawnqueue_last = e; - if(!spawnqueue_first) - spawnqueue_first = e; -} - -void Spawnqueue_Remove(entity e) -{ - if(!e.spawnqueue_in) - return; - dprint(strcat("Out of queue: ", e.netname, "\n")); - e.spawnqueue_in = FALSE; - if(e == spawnqueue_first) - spawnqueue_first = e.spawnqueue_next; - if(e == spawnqueue_last) - spawnqueue_last = e.spawnqueue_prev; - if(e.spawnqueue_prev) - e.spawnqueue_prev.spawnqueue_next = e.spawnqueue_next; - if(e.spawnqueue_next) - e.spawnqueue_next.spawnqueue_prev = e.spawnqueue_prev; - e.spawnqueue_next = world; - e.spawnqueue_prev = world; -} - -void Spawnqueue_Unmark(entity e) -{ - if(!e.spawned) - return; - e.spawned = FALSE; - numspawned = numspawned - 1; -} - -void Spawnqueue_Mark(entity e) -{ - if(e.spawned) - return; - e.spawned = TRUE; - numspawned = numspawned + 1; -} - -float Arena_CheckWinner() -{ - entity e; - - if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0) - { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER); - round_handler_Init(5, autocvar_g_arena_warmup, autocvar_g_arena_round_timelimit); - return 1; - } - - if(numspawned > 1) - return 0; - - entity champion; - champion = world; - FOR_EACH_CLIENT(e) - { - if(e.spawned && IS_PLAYER(e)) - champion = e; - } - - if(champion) - { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_PLAYER_WIN, champion.netname); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_PLAYER_WIN, champion.netname); - UpdateFrags(champion, +1); - } - else - { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_TIED); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_TIED); - } - round_handler_Init(5, autocvar_g_arena_warmup, autocvar_g_arena_round_timelimit); - return 1; -} - -void Arena_AddChallengers() -{ - entity e; - if(time < 2) // don't force players to spawn so early - return; - e = self; - while(numspawned < maxspawned && spawnqueue_first) - { - self = spawnqueue_first; - - bprint ("^4", self.netname, "^4 is the next challenger\n"); - - Spawnqueue_Remove(self); - Spawnqueue_Mark(self); - - self.classname = "player"; - PutClientInServer(); - } - self = e; -} - -float prev_numspawned; -float Arena_CheckPlayers() -{ - Arena_AddChallengers(); - - if(numspawned >= 2) - { - if(prev_numspawned > 0) - Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_MISSING_PLAYERS); - prev_numspawned = -1; - return 1; - } - - if(prev_numspawned != numspawned && numspawned == 1) - { - if(maxspawned - numspawned > 0) - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_MISSING_PLAYERS, maxspawned - numspawned); - prev_numspawned = numspawned; - } - - return 0; -} - -void Arena_RoundStart() -{ - entity e; - FOR_EACH_PLAYER(e) - e.player_blocked = 0; -} - -MUTATOR_HOOKFUNCTION(arena_ClientDisconnect) -{ - Spawnqueue_Unmark(self); - Spawnqueue_Remove(self); - return 1; -} - -MUTATOR_HOOKFUNCTION(arena_reset_map_players) -{ - FOR_EACH_CLIENT(self) - { - if(self.spawned) - { - PutClientInServer(); - self.player_blocked = 1; - } - else - PutObserverInServer(); - } - return 1; -} - -MUTATOR_HOOKFUNCTION(arena_MakePlayerObserver) -{ - if(self.version_mismatch) - { - self.frags = FRAGS_SPECTATOR; - Spawnqueue_Unmark(self); - Spawnqueue_Remove(self); - } - else - { - self.frags = FRAGS_LMS_LOSER; - Spawnqueue_Insert(self); - } - return 1; -} - -MUTATOR_HOOKFUNCTION(arena_PutClientInServer) -{ - if(!self.spawned) - self.classname = "observer"; - return 1; -} - -MUTATOR_HOOKFUNCTION(arena_ClientConnect) -{ - self.classname = "observer"; - Spawnqueue_Insert(self); - return 1; -} - -MUTATOR_HOOKFUNCTION(arena_PlayerSpawn) -{ - Spawnqueue_Remove(self); - Spawnqueue_Mark(self); - if(arena_roundbased) - self.player_blocked = 1; - return 1; -} - -MUTATOR_HOOKFUNCTION(arena_ForbidPlayerScore_Clear) -{ - return 1; -} - -MUTATOR_HOOKFUNCTION(arena_GiveFragsForKill) -{ - if(arena_roundbased) - frag_score = 0; // score will be given to the champion when the round ends - return 1; -} - -MUTATOR_HOOKFUNCTION(arena_PlayerDies) -{ - // put dead players in the spawn queue - if(arena_roundbased) - self.respawn_flags = (RESPAWN_FORCE | RESPAWN_SILENT); - else - self.respawn_flags = RESPAWN_SILENT; - Spawnqueue_Unmark(self); - return 1; -} - -MUTATOR_HOOKFUNCTION(arena_SV_StartFrame) -{ - if(gameover) return 1; - if(time <= game_starttime || !arena_roundbased) - Arena_AddChallengers(); - return 1; -} - -MUTATOR_HOOKFUNCTION(arena_FilterItem) -{ - if(autocvar_g_powerups <= 0) - if(self.flags & FL_POWERUP) - return TRUE; - - return FALSE; -} - -void arena_Initialize() -{ - maxspawned = max(2, autocvar_g_arena_maxspawned); - arena_roundbased = autocvar_g_arena_roundbased; - if(arena_roundbased) - { - round_handler_Spawn(Arena_CheckPlayers, Arena_CheckWinner, Arena_RoundStart); - round_handler_Init(5, autocvar_g_arena_warmup, autocvar_g_arena_round_timelimit); - } -} - -MUTATOR_DEFINITION(gamemode_arena) -{ - MUTATOR_HOOK(ClientDisconnect, arena_ClientDisconnect, CBC_ORDER_ANY); - MUTATOR_HOOK(reset_map_players, arena_reset_map_players, CBC_ORDER_ANY); - MUTATOR_HOOK(MakePlayerObserver, arena_MakePlayerObserver, CBC_ORDER_ANY); - MUTATOR_HOOK(PutClientInServer, arena_PutClientInServer, CBC_ORDER_ANY); - MUTATOR_HOOK(ClientConnect, arena_ClientConnect, CBC_ORDER_ANY); - MUTATOR_HOOK(PlayerSpawn, arena_PlayerSpawn, CBC_ORDER_ANY); - MUTATOR_HOOK(ForbidPlayerScore_Clear, arena_ForbidPlayerScore_Clear, CBC_ORDER_ANY); - MUTATOR_HOOK(GiveFragsForKill, arena_GiveFragsForKill, CBC_ORDER_ANY); - MUTATOR_HOOK(PlayerDies, arena_PlayerDies, CBC_ORDER_ANY); - MUTATOR_HOOK(SV_StartFrame, arena_SV_StartFrame, CBC_ORDER_ANY); - MUTATOR_HOOK(FilterItem, arena_FilterItem, CBC_ORDER_ANY); - - MUTATOR_ONADD - { - if(time > 1) // game loads at time 1 - error("This is a game type and it cannot be added at runtime."); - arena_Initialize(); - } - - MUTATOR_ONREMOVE - { - print("This is a game type and it cannot be removed at runtime."); - return -1; - } - - return 0; -} diff --git a/qcsrc/server/mutators/gamemode_arena.qh b/qcsrc/server/mutators/gamemode_arena.qh deleted file mode 100644 index a2f623a000..0000000000 --- a/qcsrc/server/mutators/gamemode_arena.qh +++ /dev/null @@ -1,2 +0,0 @@ -// should be removed in the future, as other code should not have to care -float arena_roundbased; diff --git a/qcsrc/server/mutators/gamemode_assault.qc b/qcsrc/server/mutators/gamemode_assault.qc index 94e104728f..0325067f28 100644 --- a/qcsrc/server/mutators/gamemode_assault.qc +++ b/qcsrc/server/mutators/gamemode_assault.qc @@ -266,24 +266,24 @@ void assault_new_round() // spawnfuncs void spawnfunc_info_player_attacker() { - if not(g_assault) { remove(self); return; } - + if (!g_assault) { remove(self); return; } + self.team = NUM_TEAM_1; // red, gets swapped every round spawnfunc_info_player_deathmatch(); } void spawnfunc_info_player_defender() { - if not(g_assault) { remove(self); return; } - + if (!g_assault) { remove(self); return; } + self.team = NUM_TEAM_2; // blue, gets swapped every round spawnfunc_info_player_deathmatch(); } void spawnfunc_target_objective() { - if not(g_assault) { remove(self); return; } - + if (!g_assault) { remove(self); return; } + self.classname = "target_objective"; self.use = assault_objective_use; assault_objective_reset(); @@ -293,7 +293,7 @@ void spawnfunc_target_objective() void spawnfunc_target_objective_decrease() { - if not(g_assault) { remove(self); return; } + if (!g_assault) { remove(self); return; } self.classname = "target_objective_decrease"; @@ -311,11 +311,11 @@ void spawnfunc_target_objective_decrease() // destructible walls that can be used to trigger target_objective_decrease void spawnfunc_func_assault_destructible() { - if not(g_assault) { remove(self); return; } - + 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 @@ -326,8 +326,8 @@ void spawnfunc_func_assault_destructible() void spawnfunc_func_assault_wall() { - if not(g_assault) { remove(self); return; } - + if (!g_assault) { remove(self); return; } + self.classname = "func_assault_wall"; self.mdl = self.model; setmodel(self, self.mdl); @@ -339,7 +339,7 @@ void spawnfunc_func_assault_wall() void spawnfunc_target_assault_roundend() { - if not(g_assault) { remove(self); return; } + if (!g_assault) { remove(self); return; } self.winning = 0; // round not yet won by attackers self.classname = "target_assault_roundend"; @@ -350,8 +350,8 @@ void spawnfunc_target_assault_roundend() void spawnfunc_target_assault_roundstart() { - if not(g_assault) { remove(self); return; } - + if (!g_assault) { remove(self); return; } + assault_attacker_team = NUM_TEAM_1; self.classname = "target_assault_roundstart"; self.use = assault_roundstart_use; @@ -373,7 +373,7 @@ void havocbot_goalrating_ast_targets(float ratingscale) if (ad.target == "") continue; - if not(ad.bot_attack) + if (!ad.bot_attack) continue; found = FALSE; @@ -549,13 +549,13 @@ MUTATOR_HOOKFUNCTION(assault_PlayerSpawn) centerprint(self, "You are attacking!"); else centerprint(self, "You are defending!"); - + return FALSE; } MUTATOR_HOOKFUNCTION(assault_TurretSpawn) { - if not (self.team) + if (!self.team) self.team = 14; 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 f55c46e00a..9fbd483cab 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 62320f37f3..19cc563f80 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; - - if not(player) { return; } // without someone to give the reward to, we can't possibly cap - + 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 not(wpforenemy_announced) + + 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) { @@ -787,7 +787,7 @@ void ctf_FlagTouch() else return; // do nothing } - else if not(IS_PLAYER(toucher)) // The flag just touched an object, most likely the world + else if (!IS_PLAYER(toucher)) // The flag just touched an object, most likely the world { if(time > self.wait) // if we haven't in a while, play a sound/effect { @@ -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); } @@ -1066,7 +1066,7 @@ entity havocbot_ctf_find_enemy_flag(entity bot) float havocbot_ctf_teamcount(entity bot, vector org, float tc_radius) { - if not(teamplay) + if (!teamplay) return 0; float c = 0; @@ -1108,7 +1108,7 @@ void havocbot_goalrating_ctf_ourbase(float ratingscale) break; head = head.ctf_worldflagnext; } - if not(head) + if (!head) return; navigation_routerating(head.bot_basewaypoint, ratingscale, 10000); @@ -1130,7 +1130,7 @@ void havocbot_goalrating_ctf_enemyflag(float ratingscale) void havocbot_goalrating_ctf_enemybase(float ratingscale) { - if not(bot_waypoints_for_items) + if (!bot_waypoints_for_items) { havocbot_goalrating_ctf_enemyflag(ratingscale); return; @@ -1140,7 +1140,7 @@ void havocbot_goalrating_ctf_enemybase(float ratingscale) head = havocbot_ctf_find_enemy_flag(self); - if not(head) + if (!head) return; navigation_routerating(head.bot_basewaypoint, ratingscale, 10000); @@ -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 58699208e5..ca4961eddc 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 50f5129917..89e6fe485d 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; ) { @@ -182,7 +182,7 @@ void dompointthink() void dompointtouch() { entity head; - if not(IS_PLAYER(other)) + if (!IS_PLAYER(other)) return; if (other.health < 1) return; @@ -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 0c22db05bc..9bc0652237 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; } @@ -582,7 +582,7 @@ MUTATOR_HOOKFUNCTION(freezetag_ItemTouch) MUTATOR_HOOKFUNCTION(freezetag_BotRoles) { - if not(self.deadflag) + if (!self.deadflag) { if (random() < 0.5) self.havocbot_role = havocbot_role_ft_freeing; @@ -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 145636239c..ec6ee8cd4c 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 not(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; @@ -306,7 +306,7 @@ MUTATOR_HOOKFUNCTION(ka_PlayerDamage) // for changing damage and force values th frag_force *= autocvar_g_keepaway_ballcarrier_force; } } - else if not(frag_target.ballcarried) // if the target is a noncarrier + else if (!frag_target.ballcarried) // if the target is a noncarrier { if(frag_target == frag_attacker) // damage done to yourself { @@ -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 a0cbf619a7..34d87f97bb 100644 --- a/qcsrc/server/mutators/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/gamemode_keyhunt.qc @@ -426,7 +426,7 @@ void kh_Key_Touch() // runs many, many times when a key has been dropped and ca // maybe start a shorter countdown? } - if not(IS_PLAYER(other)) + if (!IS_PLAYER(other)) return; if(other.deadflag != DEAD_NO) return; @@ -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,8 +840,8 @@ float kh_CheckPlayers(float num) if(!tmp_player.BUTTON_CHAT) if(tmp_player.team == t_team) ++players; - - if not(players) { return t_team; } + + if (!players) { return t_team; } } return 0; } @@ -855,7 +855,7 @@ void kh_WaitForPlayers() // delay start of the round until enough players are p } float p1 = kh_CheckPlayers(0), p2 = kh_CheckPlayers(1), p3 = kh_CheckPlayers(2), p4 = kh_CheckPlayers(3); - if not(p1 || p2 || p3 || p4) + if (!(p1 || p2 || p3 || p4)) { Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEYHUNT_ROUNDSTART, autocvar_g_balance_keyhunt_delay_round); kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round, kh_StartRound); @@ -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 f980607a7e..928c78b349 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 5831250d2d..2d2c857e90 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; @@ -248,7 +248,7 @@ void football_touch(void) self.nextthink = time + autocvar_g_nexball_delay_idle; return; } - if not(IS_PLAYER(other)) + if (!IS_PLAYER(other)) return; if(other.health < 1) return; @@ -529,7 +529,7 @@ void spawnfunc_nexball_basketball(void) { nexball_mode |= NBM_BASKETBALL; self.classname = "nexball_basketball"; - if not(balls & BALL_BASKET) + if (!(balls & BALL_BASKET)) { /* CVTOV(g_nexball_basketball_effects_default); @@ -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 b5b6594d70..6f01db2cdf 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) @@ -510,7 +510,7 @@ void onslaught_generator_deaththink() vector org; float i; - if not (self.count) + if (!self.count) self.count = 40; // White shockwave @@ -614,7 +614,7 @@ void onslaught_generator_damage(entity inflictor, entity attacker, float damage, #endif self.lasthealth = self.health; } - else if not(warmup_stage) + else if (!warmup_stage) { if (attacker == self) bprint(Team_ColoredFullName(self.team), " generator spontaneously exploded due to overtime!\n"); @@ -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) @@ -1271,7 +1271,7 @@ void onslaught_controlpoint_touch() { entity e; float a; - if not(IS_PLAYER(other)) + if (!IS_PLAYER(other)) return; a = onslaught_controlpoint_attackable(self, other.team); if(a != 2 && a != 4) @@ -1304,6 +1304,12 @@ void onslaught_controlpoint_touch() onslaught_updatelinks(); } +void onslaught_controlpoint_think() +{ + self.nextthink = time; + CSQCMODEL_AUTOUPDATE(); +} + void onslaught_controlpoint_reset() { if(self.goalentity && self.goalentity != world) @@ -1316,8 +1322,9 @@ void onslaught_controlpoint_reset() self.isshielded = TRUE; self.enemy.solid = SOLID_NOT; self.enemy.colormap = self.colormap; - self.think = self.enemy.think = func_null; - self.nextthink = 0; // don't like func_null :P + self.think = onslaught_controlpoint_think; + self.enemy.think = func_null; + self.nextthink = time; // don't like func_null :P setmodel(self, "models/onslaught/controlpoint_pad.md3"); //setsize(self, '-32 -32 0', '32 32 8'); @@ -1327,6 +1334,8 @@ void onslaught_controlpoint_reset() activator = self; SUB_UseTargets(); // to reset the structures, playerspawns etc. + + CSQCMODEL_AUTOUPDATE(); } /*QUAKED spawnfunc_onslaught_controlpoint (0 .5 .8) (-32 -32 0) (32 32 128) @@ -1397,6 +1406,9 @@ void spawnfunc_onslaught_controlpoint() self.enemy.colormap = self.colormap; waypoint_spawnforitem(self); + + self.think = onslaught_controlpoint_think; + self.nextthink = time; WaypointSprite_SpawnFixed(string_null, self.origin + '0 0 128', self, sprite, RADARICON_NONE, '0 0 0'); WaypointSprite_UpdateRule(self.sprite, NUM_TEAM_2, SPRITERULE_TEAMPLAY); @@ -1404,6 +1416,8 @@ void spawnfunc_onslaught_controlpoint() onslaught_updatelinks(); self.reset = onslaught_controlpoint_reset; + + CSQCMODEL_AUTOINIT(); } float onslaught_link_send(entity to, float sendflags) @@ -1524,24 +1538,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 +1566,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 +1576,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 +1638,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 +1654,7 @@ MUTATOR_HOOKFUNCTION(ons_PlayerSpawn) } } } - + return 0; } diff --git a/qcsrc/server/mutators/mutator_bloodloss.qc b/qcsrc/server/mutators/mutator_bloodloss.qc index adffdece9b..4d990b3cf5 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 d9d219c5ad..fb20d1cff2 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 2eaa5f0b24..3f808499a8 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 33d0e27b6b..73b7dd9499 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 0d48fef9d0..f13ae5c8ab 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 f82817d12d..ac6e158ed4 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 not(g_minstagib) { remove(self); return; } - if not(self.ammo_cells) + 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); @@ -28,7 +28,7 @@ void minstagib_stop_countdown(entity e) } void minstagib_ammocheck() { - if not(IS_PLAYER(self)) + if (!IS_PLAYER(self)) return; // not a player if (time < self.minstagib_nextthink) return; @@ -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; } @@ -137,7 +137,7 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerPreThink) MUTATOR_HOOKFUNCTION(minstagib_PlayerPowerups) { - if not(self.effects & EF_FULLBRIGHT) + if (!(self.effects & EF_FULLBRIGHT)) self.effects |= EF_FULLBRIGHT; if (self.items & IT_STRENGTH) @@ -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,37 +359,37 @@ 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; } MUTATOR_HOOKFUNCTION(minstagib_OnEntityPreSpawn) { - if not(autocvar_g_powerups) { return FALSE; } - if not(self.classname == "item_strength" || self.classname == "item_invincible" || self.classname == "item_health_mega") + 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 c945e1c2f4..50741dc20b 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 d911720de5..5ab6df75dc 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 not(autocvar_g_nades) + + if (!autocvar_g_nades) return FALSE; // allow turning them off mid match - + if(forbidWeaponUse()) return FALSE; - - if not(IS_PLAYER(self)) + + 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 873e1632c7..f11298451c 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 @@ -110,7 +110,7 @@ string nt_GetReplacement(string w, float m) if(m == NT_AUTOREPLACE_NEVER) return w; string s = nt_GetFullReplacement(w); - if not(s) + if (!s) return w; if(m == NT_AUTOREPLACE_RANDOM) s = strcat(w, " ", s); @@ -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_nix.qc b/qcsrc/server/mutators/mutator_nix.qc index 4a11e564bd..dc12b05209 100644 --- a/qcsrc/server/mutators/mutator_nix.qc +++ b/qcsrc/server/mutators/mutator_nix.qc @@ -26,7 +26,7 @@ float NIX_CanChooseWeapon(float wpn) return FALSE; if(e.spawnflags & WEP_FLAG_MUTATORBLOCKED) return FALSE; - if not(e.spawnflags & WEP_FLAG_NORMAL) + if (!(e.spawnflags & WEP_FLAG_NORMAL)) return FALSE; } return TRUE; diff --git a/qcsrc/server/mutators/mutator_physical_items.qc b/qcsrc/server/mutators/mutator_physical_items.qc index 74b7db2f0d..c99228673d 100644 --- a/qcsrc/server/mutators/mutator_physical_items.qc +++ b/qcsrc/server/mutators/mutator_physical_items.qc @@ -105,7 +105,7 @@ MUTATOR_DEFINITION(mutator_physical_items) // check if we have a physics engine MUTATOR_ONADD { - if not(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) + if (!(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE"))) { dprint("Warning: Physical items are enabled but no physics engine can be used. Reverting to old items.\n"); return -1; diff --git a/qcsrc/server/mutators/mutator_pinata.qc b/qcsrc/server/mutators/mutator_pinata.qc index af5d4a8b13..6d982d5a4c 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 e2832ace2d..184047189b 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_superspec.qc b/qcsrc/server/mutators/mutator_superspec.qc index fc9fc7966b..c323262f06 100644 --- a/qcsrc/server/mutators/mutator_superspec.qc +++ b/qcsrc/server/mutators/mutator_superspec.qc @@ -33,7 +33,7 @@ void superspec_save_client_conf() string fn = "superspec-local.options"; float fh; - if not(_ISLOCAL) + if (!_ISLOCAL) { if(self.crypto_idfp == "") return; @@ -68,7 +68,7 @@ void superspec_msg(string _center_title, string _con_title, entity _to, string _ return; if(_spamlevel > 1) - if not(_to.superspec_flags & SSF_VERBOSE) + if (!(_to.superspec_flags & SSF_VERBOSE)) return; centerprint(_to, strcat(_center_title, _msg)); @@ -452,7 +452,7 @@ MUTATOR_HOOKFUNCTION(superspec_ClientConnect) _hello.think = superspec_hello; _hello.nextthink = time + 5; - if not(_ISLOCAL) + if (!_ISLOCAL) { if(self.crypto_idfp == "") return FALSE; diff --git a/qcsrc/server/mutators/mutator_touchexplode.qc b/qcsrc/server/mutators/mutator_touchexplode.qc index f2d47a5ed1..fabf13639c 100644 --- a/qcsrc/server/mutators/mutator_touchexplode.qc +++ b/qcsrc/server/mutators/mutator_touchexplode.qc @@ -19,15 +19,15 @@ void PlayerTouchExplode(entity p1, entity p2) MUTATOR_HOOKFUNCTION(touchexplode_PlayerThink) { if(time > self.touchexplode_time) - if not(gameover) + if (!gameover) if(IS_PLAYER(self)) if(self.deadflag == DEAD_NO) - if not(IS_INDEPENDENT_PLAYER(self)) + if (!IS_INDEPENDENT_PLAYER(self)) FOR_EACH_PLAYER(other) if(self != other) { if(time > other.touchexplode_time) if(other.deadflag == DEAD_NO) - if not(IS_INDEPENDENT_PLAYER(other)) + if (!IS_INDEPENDENT_PLAYER(other)) if(boxesoverlap(self.absmin, self.absmax, other.absmin, other.absmax)) { PlayerTouchExplode(self, other); diff --git a/qcsrc/server/mutators/mutator_vampire.qc b/qcsrc/server/mutators/mutator_vampire.qc index edfcba4398..73317d0c1e 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/mutators/mutators.qh b/qcsrc/server/mutators/mutators.qh index e7a95de7ec..3c17651a03 100644 --- a/qcsrc/server/mutators/mutators.qh +++ b/qcsrc/server/mutators/mutators.qh @@ -1,5 +1,4 @@ MUTATOR_DECLARATION(gamemode_assault); -MUTATOR_DECLARATION(gamemode_arena); MUTATOR_DECLARATION(gamemode_ca); MUTATOR_DECLARATION(gamemode_keyhunt); MUTATOR_DECLARATION(gamemode_freezetag); diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index 94ba20f10d..e84c6d696a 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -20,7 +20,7 @@ void sandbox_ObjectFunction_Touch() intensity = vlen(self.velocity) + vlen(other.velocity); if(intensity) // avoid divisions by 0 intensity /= 2; // average the two velocities - if not(intensity >= autocvar_g_sandbox_object_material_velocity_min) + if (!(intensity >= autocvar_g_sandbox_object_material_velocity_min)) return; // impact not strong enough to do anything // now offset intensity and apply it to the effects intensity -= autocvar_g_sandbox_object_material_velocity_min; // start from minimum velocity, not actual velocity @@ -56,6 +56,8 @@ void sandbox_ObjectFunction_Think() } self.nextthink = time; + + CSQCMODEL_AUTOUPDATE(); } .float old_solid, old_movetype; @@ -74,7 +76,7 @@ entity sandbox_ObjectEdit_Get(float permissions) return trace_ent; // don't check permissions, anyone can edit this object if(trace_ent.crypto_idfp == "") return trace_ent; // the player who spawned this object did not have an UID, so anyone can edit it - if not(trace_ent.realowner != self && autocvar_g_sandbox_editor_free < 2) + if (!(trace_ent.realowner != self && autocvar_g_sandbox_editor_free < 2)) return trace_ent; // object does not belong to the player, and players can only edit their own objects on this server return world; } @@ -137,7 +139,7 @@ entity sandbox_ObjectSpawn(float database) { // spawn a new object with default properties - entity e; + entity e, oldself; e = spawn(); e.classname = "object"; e.takedamage = DAMAGE_AIM; @@ -172,6 +174,11 @@ entity sandbox_ObjectSpawn(float database) setorigin(e, trace_endpos); e.angles_y = self.v_angle_y; } + + oldself = self; + self = e; + CSQCMODEL_AUTOINIT(); + self = oldself; object_count += 1; return e; @@ -484,7 +491,7 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand) print_to(self, "^1SANDBOX - WARNING: ^7Attempted to spawn an object without specifying a model. Please specify the path to your model file after the 'object_spawn' command"); return TRUE; } - if not(fexists(argv(2))) + if (!(fexists(argv(2)))) { print_to(self, "^1SANDBOX - WARNING: ^7Attempted to spawn an object with a non-existent model. Make sure the path to your model file is correct"); return TRUE; diff --git a/qcsrc/server/pathlib.qc b/qcsrc/server/pathlib.qc index 3cb4ca750e..3799c755d4 100644 --- a/qcsrc/server/pathlib.qc +++ b/qcsrc/server/pathlib.qc @@ -149,7 +149,7 @@ float floor_ok(vector point) case CONTENT_SKY: return 0; case CONTENT_EMPTY: - if not (pointcontents(point - '0 0 1') == CONTENT_SOLID) + if (!(pointcontents(point - '0 0 1') == CONTENT_SOLID)) return 0; break; case CONTENT_WATER: @@ -171,7 +171,7 @@ float inwater(vector point) } */ -#define _pcheck(p) traceline(p+z_up,p-z_down,MOVE_WORLDONLY,self); if not(floor_ok(trace_endpos)) return 1 +#define _pcheck(p) traceline(p+z_up,p-z_down,MOVE_WORLDONLY,self); if (!floor_ok(trace_endpos)) return 1 float edge_check(vector point,float fsize) { vector z_up,z_down; @@ -226,7 +226,7 @@ vector pathlib_wateroutnode(vector start,vector end,float doedge) traceline(end + ('0 0 0.25' * pathlib_gridsize),end - ('0 0 1' * pathlib_gridsize),MOVE_WORLDONLY,self); end = trace_endpos; - if not(pointcontents(end - '0 0 1') == CONTENT_SOLID) + if (!(pointcontents(end - '0 0 1') == CONTENT_SOLID)) return end; for(surface = start ; surface_z < (end_z + 32); ++surface_z) @@ -324,7 +324,7 @@ vector pathlib_walknode(vector start,vector end,float doedge) return trace_endpos; point = trace_endpos; - if not(floor_ok(trace_endpos)) + if (!floor_ok(trace_endpos)) return trace_endpos; tracebox(last_point + walknode_boxup, walknode_boxmin,walknode_boxmax, point + walknode_boxup, MOVE_WORLDONLY, self); @@ -352,7 +352,7 @@ vector pathlib_walknode(vector start,vector end,float doedge) point = trace_endpos; - if not(floor_ok(trace_endpos)) + if (!floor_ok(trace_endpos)) return trace_endpos; tracebox(last_point + walknode_boxup, walknode_boxmin,walknode_boxmax, point + walknode_boxup, MOVE_WORLDONLY, self); @@ -618,7 +618,7 @@ float pathlib_makenode_adaptive(entity parent,vector start, vector to, vector go } where = pathlib_movenode(parent.origin,to,0); - if not(pathlib_movenode_goodnode) + if (!pathlib_movenode_goodnode) return 0; if(doedge) @@ -648,7 +648,7 @@ float pathlib_makenode_adaptive(entity parent,vector start, vector to, vector go node.path_prev = parent; } - if not (best_open_node) + if (!best_open_node) best_open_node = node; else if(best_open_node.pathlib_node_f > node.pathlib_node_f) best_open_node = node; @@ -664,7 +664,7 @@ float pathlib_makenode_adaptive(entity parent,vector start, vector to, vector go node.pathlib_node_g = g; node.pathlib_node_f = f; - if not (best_open_node) + if (!best_open_node) best_open_node = node; else if(best_open_node.pathlib_node_f > node.pathlib_node_f) best_open_node = node; @@ -899,13 +899,13 @@ entity pathlib_astar(vector from,vector to) pathlib_movenode = pathlib_swimnode; } - if not(openlist) + if (!openlist) openlist = spawn(); - if not(closedlist) + if (!closedlist) closedlist = spawn(); - if not(scraplist) + if (!scraplist) scraplist = spawn(); pathlib_closed_cnt = 0; diff --git a/qcsrc/server/pathlib/debug.qc b/qcsrc/server/pathlib/debug.qc index 64ce9da028..d432221f25 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/main.qc b/qcsrc/server/pathlib/main.qc index fd889d0432..589ff82a11 100644 --- a/qcsrc/server/pathlib/main.qc +++ b/qcsrc/server/pathlib/main.qc @@ -110,7 +110,7 @@ float pathlib_makenode_adaptive(entity parent,vector start, vector to, vector go node.path_prev = parent; } - if not (best_open_node) + if (!best_open_node) best_open_node = node; else if(best_open_node.pathlib_node_f > node.pathlib_node_f) best_open_node = node; @@ -121,7 +121,7 @@ float pathlib_makenode_adaptive(entity parent,vector start, vector to, vector go where = pathlib_movenode(parent.origin, to, 0); - if not(pathlib_movenode_goodnode) + if (!pathlib_movenode_goodnode) { //pathlib_showsquare(where, 0 ,30); //pathlib_showsquare(parent.origin, 1 ,30); @@ -141,7 +141,7 @@ float pathlib_makenode_adaptive(entity parent,vector start, vector to, vector go if(doedge) - if not (tile_check(where)) + if (!tile_check(where)) { dprint("tile_check fail\n"); pathlib_showsquare(where, 0 ,30); @@ -175,7 +175,7 @@ float pathlib_makenode_adaptive(entity parent,vector start, vector to, vector go //} } - if not (best_open_node) + if (!best_open_node) best_open_node = node; else if(best_open_node.pathlib_node_f > node.pathlib_node_f) best_open_node = node; @@ -192,7 +192,7 @@ float pathlib_makenode_adaptive(entity parent,vector start, vector to, vector go node.pathlib_node_g = g; node.pathlib_node_f = f; - if not (best_open_node) + if (!best_open_node) best_open_node = node; else if(best_open_node.pathlib_node_f > node.pathlib_node_f) best_open_node = node; @@ -405,10 +405,10 @@ entity pathlib_astar(vector from,vector to) pathlib_movenode = pathlib_swimnode; } - if not(openlist) + if (!openlist) openlist = spawn(); - if not(closedlist) + if (!closedlist) closedlist = spawn(); pathlib_closed_cnt = 0; diff --git a/qcsrc/server/pathlib/movenode.qc b/qcsrc/server/pathlib/movenode.qc index c45ac0dee4..997eaa4209 100644 --- a/qcsrc/server/pathlib/movenode.qc +++ b/qcsrc/server/pathlib/movenode.qc @@ -10,7 +10,7 @@ vector pathlib_wateroutnode(vector start,vector end, float doedge) traceline(end + ('0 0 0.25' * pathlib_gridsize),end - ('0 0 1' * pathlib_gridsize),MOVE_WORLDONLY,self); end = trace_endpos; - if not(pointcontents(end - '0 0 1') == CONTENT_SOLID) + if (!(pointcontents(end - '0 0 1') == CONTENT_SOLID)) return end; for(surface = start ; surface_z < (end_z + 32); ++surface_z) diff --git a/qcsrc/server/pathlib/path_waypoint.qc b/qcsrc/server/pathlib/path_waypoint.qc index 73b415537b..9f443b0ac7 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,24 +133,24 @@ 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 not (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 not(openlist) + + if (!openlist) openlist = spawn(); - if not(closedlist) + if (!closedlist) closedlist = spawn(); pathlib_closed_cnt = 0; @@ -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/pathlib/utility.qc b/qcsrc/server/pathlib/utility.qc index 0a5ea42b1c..7a0aec8652 100644 --- a/qcsrc/server/pathlib/utility.qc +++ b/qcsrc/server/pathlib/utility.qc @@ -94,25 +94,25 @@ float tile_check_cross(vector where) // forward-right p = where + f + r; traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self); - if not (location_isok(trace_endpos, 1, 0)) + if (!location_isok(trace_endpos, 1, 0)) return 0; // Forward-left p = where + f - r; traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self); - if not (location_isok(trace_endpos, 1, 0)) + if (!location_isok(trace_endpos, 1, 0)) return 0; // Back-right p = where - f + r; traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self); - if not (location_isok(trace_endpos, 1 ,0)) + if (!location_isok(trace_endpos, 1 ,0)) return 0; //Back-left p = where - f - r; traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self); - if not (location_isok(trace_endpos, 1, 0)) + if (!location_isok(trace_endpos, 1, 0)) return 0; return 1; @@ -128,26 +128,26 @@ float tile_check_plus(vector where) // forward p = where + f; traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self); - if not (location_isok(trace_endpos,1,0)) + if (!location_isok(trace_endpos,1,0)) return 0; //left p = where - r; traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self); - if not (location_isok(trace_endpos,1,0)) + if (!location_isok(trace_endpos,1,0)) return 0; // Right p = where + r; traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self); - if not (location_isok(trace_endpos,1,0)) + if (!location_isok(trace_endpos,1,0)) return 0; //Back p = where - f; traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self); - if not (location_isok(trace_endpos,1,0)) + if (!location_isok(trace_endpos,1,0)) return 0; return 1; diff --git a/qcsrc/server/playerstats.qc b/qcsrc/server/playerstats.qc index 354b521e81..2c6e941a6a 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/portals.qc b/qcsrc/server/portals.qc index bf3772090d..aff0652d4a 100644 --- a/qcsrc/server/portals.qc +++ b/qcsrc/server/portals.qc @@ -89,7 +89,7 @@ float Portal_TeleportPlayer(entity teleporter, entity player) vector from, to, safe, step, transform, ang, newvel; float planeshift, s, t; - if not(teleporter.enemy) + if (!teleporter.enemy) { backtrace("Portal_TeleportPlayer called without other portal being set. Stop."); return 0; @@ -160,7 +160,7 @@ float Portal_TeleportPlayer(entity teleporter, entity player) player = self; self = oldself; - if not(teleporter.enemy) + if (!teleporter.enemy) { backtrace("Portal_TeleportPlayer ended up without other portal being set BEFORE TeleportPlayer. Stop."); return 0; @@ -175,7 +175,7 @@ float Portal_TeleportPlayer(entity teleporter, entity player) Send_Notification(NOTIF_ONE, player, MSG_ANNCE, ANNCE_ACHIEVEMENT_AMAZING); } - if not(teleporter.enemy) + if (!teleporter.enemy) { backtrace("Portal_TeleportPlayer ended up without other portal being set AFTER TeleportPlayer. Stop."); return 0; diff --git a/qcsrc/server/progs.src b/qcsrc/server/progs.src index 8980f77594..f29324a478 100644 --- a/qcsrc/server/progs.src +++ b/qcsrc/server/progs.src @@ -37,7 +37,6 @@ defs.qh // Should rename this, it has fields and globals mutators/base.qh mutators/mutators.qh mutators/gamemode_assault.qh -mutators/gamemode_arena.qh mutators/gamemode_ca.qh mutators/gamemode_ctf.qh mutators/gamemode_domination.qh @@ -228,7 +227,6 @@ round_handler.qc mutators/base.qc mutators/gamemode_assault.qc -mutators/gamemode_arena.qc mutators/gamemode_ca.qc mutators/gamemode_ctf.qc mutators/gamemode_domination.qc diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 63d846f1fd..e6d7a43acc 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); @@ -249,7 +249,7 @@ void race_SendTime(entity e, float cp, float t, float tvalid) if(tvalid) if(cp == race_timed_checkpoint) // finish line - if not(e.race_completed) + if (!e.race_completed) { float s; if(g_race_qualifying) @@ -457,7 +457,7 @@ void checkpoint_passed() /* * Trigger targets */ - if not((self.spawnflags & 2) && (IS_PLAYER(other))) + if (!((self.spawnflags & 2) && (IS_PLAYER(other)))) { activator = other; oldmsg = self.message; @@ -466,7 +466,7 @@ void checkpoint_passed() self.message = oldmsg; } - if not(IS_PLAYER(other)) + if (!IS_PLAYER(other)) return; /* @@ -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) // @@ -800,7 +800,7 @@ void spawnfunc_trigger_race_checkpoint() EXACTTRIGGER_INIT; self.use = checkpoint_use; - if not(self.spawnflags & 1) + if (!(self.spawnflags & 1)) self.touch = checkpoint_touch; o = (self.absmin + self.absmax) * 0.5; @@ -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) @@ -853,7 +853,7 @@ void spawnfunc_target_checkpoint() // defrag entity EXACTTRIGGER_INIT; self.use = checkpoint_use; - if not(self.spawnflags & 1) + if (!(self.spawnflags & 1)) self.touch = checkpoint_touch; o = (self.absmin + self.absmax) * 0.5; @@ -1090,7 +1090,7 @@ void spawnfunc_trigger_race_penalty() EXACTTRIGGER_INIT; self.use = penalty_use; - if not(self.spawnflags & 1) + if (!(self.spawnflags & 1)) self.touch = penalty_touch; if (self.race_penalty_reason == "") @@ -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 1537f6752e..3a8b830d74 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -334,7 +334,7 @@ float PlayerScore_Add(entity player, float scorefield, float score) entity s; if(gameover) - if not(g_lms && scorefield == SP_LMS_RANK) // allow writing to this field in intermission as it is needed for newly joining players + if(!(g_lms && scorefield == SP_LMS_RANK)) // allow writing to this field in intermission as it is needed for newly joining players score = 0; if(!scores_initialized) return 0; // FIXME remove this when everything uses this system @@ -532,12 +532,12 @@ void WinningConditionHelper() s = strcat(s, ":human"); else s = strcat(s, ":bot"); - if(!IS_PLAYER(p) && !g_arena && p.caplayer != 1 && !g_lms) + if(!IS_PLAYER(p) && p.caplayer != 1 && !g_lms) s = strcat(s, ":spectator"); } else { - if(IS_PLAYER(p) || g_arena || p.caplayer == 1 || g_lms) + if(IS_PLAYER(p) || p.caplayer == 1 || g_lms) s = GetPlayerScoreString(p, 2); else s = "-666"; @@ -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; @@ -742,7 +742,7 @@ entity PlayerScore_Sort(.float field, float teams, float strict, float nospectat pbest.field = j; - if not(pfirst) + if (!pfirst) pfirst = pbest; if(plast) plast.chain = pbest; @@ -765,7 +765,7 @@ float TeamScore_GetCompareValue(float t) } sk = teamscorekeepers[t - 1]; - if not(sk) + if (!sk) return -999999999; s = sk.teamscores_primary; if(teamscores_flags_primary & SFL_ZERO_IS_WORST) @@ -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,12 +896,12 @@ void Score_NicePrint(entity to) t = p.team; p = p.chain; } - + t = 0; FOR_EACH_CLIENT(p) - if not(IS_PLAYER(p)) + if (!IS_PLAYER(p)) { - if not(t) + if (!t) Score_NicePrint_Spectators(to); Score_NicePrint_Spectator(to, p); t = 1; diff --git a/qcsrc/server/scores_rules.qc b/qcsrc/server/scores_rules.qc index d60f4563c1..b57666a689 100644 --- a/qcsrc/server/scores_rules.qc +++ b/qcsrc/server/scores_rules.qc @@ -17,12 +17,12 @@ void ScoreRules_basics(float teams, float sprio, float stprio, float score_enabl if(score_enabled) ScoreInfo_SetLabel_TeamScore (ST_SCORE, "score", stprio); - if not(INDEPENDENT_PLAYERS) + if (!INDEPENDENT_PLAYERS) ScoreInfo_SetLabel_PlayerScore(SP_KILLS, "kills", 0); ScoreInfo_SetLabel_PlayerScore(SP_DEATHS, "deaths", SFL_LOWER_IS_BETTER); - if not(INDEPENDENT_PLAYERS) + if (!INDEPENDENT_PLAYERS) ScoreInfo_SetLabel_PlayerScore(SP_SUICIDES, "suicides", SFL_LOWER_IS_BETTER); if(score_enabled) diff --git a/qcsrc/server/secret.qc b/qcsrc/server/secret.qc index 9af13eca28..06f7e075dd 100644 --- a/qcsrc/server/secret.qc +++ b/qcsrc/server/secret.qc @@ -10,9 +10,9 @@ void secrets_setstatus() { */ void trigger_secret_touch() { // only a player can trigger this - if not(IS_PLAYER(other)) + 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 not(self.sounds) + 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 429bf84947..3f4e72c3b3 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) @@ -318,12 +318,7 @@ entity SelectSpawnPoint (float anypoint) } else { - float mindist; - if(g_arena && arena_roundbased) - mindist = 800; - else - mindist = 100; - firstspot = Spawn_FilterOutBadSpots(firstspot, mindist, teamcheck); + firstspot = Spawn_FilterOutBadSpots(firstspot, 100, teamcheck); // there is 50/50 chance of choosing a random spot or the furthest spot // (this means that roughly every other spawn will be furthest, so you diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index 8b8f8efe85..043cb7713d 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) @@ -125,7 +125,7 @@ void CreatureFrame (void) else dprint(ftos(trace_dphitq3surfaceflags), "\n"); */ - if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS) + if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS)) { if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS) GlobalSound(globalsound_metalstep, CH_PLAYER, VOICETYPE_PLAYERSOUND); @@ -135,7 +135,7 @@ void CreatureFrame (void) } } } - + self.oldvelocity = self.velocity; } self = oldself; @@ -249,7 +249,7 @@ void SV_OnEntityPreSpawnFunction() { if (self) if (self.gametypefilter != "") - if not(isGametypeInFilter(MapInfo_LoadedGametype, teamplay, have_team_spawns, self.gametypefilter)) + if (!isGametypeInFilter(MapInfo_LoadedGametype, teamplay, have_team_spawns, self.gametypefilter)) { remove(self); return; @@ -349,14 +349,14 @@ void SV_OnEntityPreSpawnFunction() else { k = s; - if not(cvar(k)) + if (!cvar(k)) goto cvar_fail; } } inv = !inv; :cvar_fail // now inv is 1 if we want to keep the item, and 0 if we want to get rid of it - if not(inv) + if (!inv) { //print("cvarfilter fail\n"); remove(self); diff --git a/qcsrc/server/t_halflife.qc b/qcsrc/server/t_halflife.qc index 0a95b78d06..bb2254c977 100644 --- a/qcsrc/server/t_halflife.qc +++ b/qcsrc/server/t_halflife.qc @@ -37,7 +37,7 @@ void spawnfunc_func_healthcharger() {} void func_ladder_touch() { - if not(other.iscreature) + if (!other.iscreature) return; if (other.vehicle_flags & VHF_ISVEHICLE) return; diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index fcc8c0cf30..1db8f6cd76 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; @@ -601,7 +601,7 @@ float Item_GiveTo(entity item, entity player) if (player.switchweapon == w_getbestweapon(player)) _switchweapon = TRUE; - if not(player.weapons & WepSet_FromWeapon(player.switchweapon)) + if (!(player.weapons & WepSet_FromWeapon(player.switchweapon))) _switchweapon = TRUE; pickedup |= Item_GiveAmmoTo(item, player, ammo_fuel, g_pickup_fuel_max, ITEM_MODE_FUEL); @@ -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") { @@ -680,7 +680,7 @@ void Item_Touch (void) } } - if not(IS_PLAYER(other)) + if (!IS_PLAYER(other)) return; if (other.deadflag) return; @@ -723,7 +723,7 @@ void Item_Touch (void) if (self.classname == "droppedweapon") remove (self); - else if not(self.spawnshieldtime) + else if (!self.spawnshieldtime) return; else { @@ -869,7 +869,7 @@ float commodity_pickupevalfunc(entity player, entity item) { wi = get_weaponinfo(i); - if not(player.weapons & WepSet_FromWeapon(i)) + if (!(player.weapons & WepSet_FromWeapon(i))) continue; if(wi.items & IT_SHELLS) @@ -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 @@ -1486,7 +1486,7 @@ void target_items_use (void) return; } - if not(IS_PLAYER(activator)) + if (!IS_PLAYER(activator)) return; if(activator.deadflag != DEAD_NO) return; @@ -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); @@ -1859,7 +1859,7 @@ float GiveItems(entity e, float beginarg, float endarg) { wi = get_weaponinfo(j); if(wi.weapon) - if not(wi.spawnflags & WEP_FLAG_MUTATORBLOCKED) + if (!(wi.spawnflags & WEP_FLAG_MUTATORBLOCKED)) got += GiveWeapon(e, j, op, val); } case "allammo": @@ -1943,7 +1943,7 @@ float GiveItems(entity e, float beginarg, float endarg) if(wi.weapon) { POSTGIVE_WEAPON(e, j, "weapons/weaponpickup.wav", string_null); - if not(save_weapons & WepSet_FromWeapon(j)) + if (!(save_weapons & WepSet_FromWeapon(j))) if(e.weapons & WepSet_FromWeapon(j)) weapon_action(wi.weapon, WR_PRECACHE); } @@ -1975,7 +1975,7 @@ float GiveItems(entity e, float beginarg, float endarg) else e.superweapons_finished += time; - if not(e.weapons & WepSet_FromWeapon(e.switchweapon)) + if (!(e.weapons & WepSet_FromWeapon(e.switchweapon))) _switchweapon = TRUE; if(_switchweapon) W_SwitchWeapon_Force(e, w_getbestweapon(e)); diff --git a/qcsrc/server/t_jumppads.qc b/qcsrc/server/t_jumppads.qc index 3c797f9771..029bd8e5b6 100644 --- a/qcsrc/server/t_jumppads.qc +++ b/qcsrc/server/t_jumppads.qc @@ -329,7 +329,7 @@ void spawnfunc_trigger_push() self.speed = 1000; self.movedir = self.movedir * self.speed * 10; - if not(self.noise) + if (!self.noise) self.noise = "misc/jumppad.wav"; precache_sound (self.noise); diff --git a/qcsrc/server/t_plats.qc b/qcsrc/server/t_plats.qc index 97ae43e1e8..3955442310 100644 --- a/qcsrc/server/t_plats.qc +++ b/qcsrc/server/t_plats.qc @@ -95,7 +95,7 @@ void plat_go_up() void plat_center_touch() { - if not(other.iscreature) + if (!other.iscreature) return; if (other.health <= 0) @@ -110,7 +110,7 @@ void plat_center_touch() void plat_outside_touch() { - if not(other.iscreature) + if (!other.iscreature) return; if (other.health <= 0) @@ -258,7 +258,7 @@ void spawnfunc_func_plat() self.angles = '0 0 0'; self.classname = "plat"; - if not(InitMovingBrushTrigger()) + if (!InitMovingBrushTrigger()) return; self.effects |= EF_LOWPRECISION; setsize (self, self.mins , self.maxs); @@ -422,7 +422,7 @@ void spawnfunc_func_train() else self.view_ofs = self.mins; - if not(InitMovingBrushTrigger()) + if (!InitMovingBrushTrigger()) return; self.effects |= EF_LOWPRECISION; @@ -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 == "")) @@ -509,7 +509,7 @@ void spawnfunc_func_rotating() self.dmgtime2 = time; - if not(InitMovingBrushTrigger()) + if (!InitMovingBrushTrigger()) return; // no EF_LOWPRECISION here, as rounding angles is bad @@ -527,13 +527,13 @@ void func_bobbing_controller_think() { vector v; self.nextthink = time + 0.1; - - if not (self.owner.active == ACTIVE_ACTIVE) + + 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; @@ -588,7 +588,7 @@ void spawnfunc_func_bobbing() else // Z self.movedir = '0 0 1' * self.height; - if not(InitMovingBrushTrigger()) + if (!InitMovingBrushTrigger()) return; // wait for targets to spawn @@ -612,7 +612,7 @@ void func_pendulum_controller_think() float v; self.nextthink = time + 0.1; - if not (self.owner.active == ACTIVE_ACTIVE) + if (!(self.owner.active == ACTIVE_ACTIVE)) { self.owner.avelocity_x = 0; return; @@ -656,7 +656,7 @@ void spawnfunc_func_pendulum() self.blocked = generic_plat_blocked; self.avelocity_z = 0.0000001; - if not(InitMovingBrushTrigger()) + if (!InitMovingBrushTrigger()) return; if(!self.freq) @@ -745,7 +745,7 @@ void button_reset() void button_use() { - if not (self.active == ACTIVE_ACTIVE) + if (!(self.active == ACTIVE_ACTIVE)) return; self.enemy = activator; @@ -756,7 +756,7 @@ void button_touch() { if (!other) return; - if not(other.iscreature) + if (!other.iscreature) return; if(other.velocity * self.movedir < 0) return; @@ -799,7 +799,7 @@ void spawnfunc_func_button() { SetMovedir (); - if not(InitMovingBrushTrigger()) + if (!InitMovingBrushTrigger()) return; self.effects |= EF_LOWPRECISION; @@ -992,22 +992,22 @@ ACTIVATION FUNCTIONS float door_check_keys(void) { local entity door; - - + + if (self.owner) door = self.owner; else door = self; - + // no key needed - if not(door.itemkeys) + if (!door.itemkeys) return TRUE; // this door require a key // only a player can have a key - if not(IS_PLAYER(other)) + 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; @@ -1113,16 +1113,16 @@ void door_use() void door_trigger_touch() { if (other.health < 1) - if not(other.iscreature && other.deadflag == DEAD_NO) + if (!(other.iscreature && other.deadflag == DEAD_NO)) return; 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; @@ -1166,7 +1166,7 @@ Prints messages */ void door_touch() { - if not(IS_PLAYER(other)) + if (!IS_PLAYER(other)) return; if (self.owner.attack_finished_single > time) return; @@ -1489,13 +1489,13 @@ 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 (); self.max_health = self.health; - if not(InitMovingBrushTrigger()) + if (!InitMovingBrushTrigger()) return; self.effects |= EF_LOWPRECISION; self.classname = "door"; @@ -1621,7 +1621,7 @@ void spawnfunc_func_door_rotating() self.max_health = self.health; self.avelocity = self.movedir; - if not(InitMovingBrushTrigger()) + if (!InitMovingBrushTrigger()) return; self.velocity = '0 0 0'; //self.effects |= EF_LOWPRECISION; @@ -1839,7 +1839,7 @@ Prints messages */ void secret_touch() { - if not(other.iscreature) + if (!other.iscreature) return; if (self.attack_finished_single > time) return; @@ -1895,7 +1895,7 @@ void spawnfunc_func_door_secret() self.mangle = self.angles; self.angles = '0 0 0'; self.classname = "door"; - if not(InitMovingBrushTrigger()) + if (!InitMovingBrushTrigger()) return; self.effects |= EF_LOWPRECISION; @@ -1940,9 +1940,9 @@ void func_fourier_controller_think() float n, i, t; self.nextthink = time + 0.1; - if not (self.owner.active == ACTIVE_ACTIVE) + if (!(self.owner.active == ACTIVE_ACTIVE)) { - self.owner.velocity = '0 0 0'; + self.owner.velocity = '0 0 0'; return; } @@ -1991,7 +1991,7 @@ void spawnfunc_func_fourier() if(self.netname == "") self.netname = "1 0 0 0 1"; - if not(InitMovingBrushTrigger()) + if (!InitMovingBrushTrigger()) return; self.active = ACTIVE_ACTIVE; @@ -2073,9 +2073,9 @@ void func_vectormamamam_controller_think() { self.nextthink = time + 0.1; - if not (self.owner.active == ACTIVE_ACTIVE) + if (!(self.owner.active == ACTIVE_ACTIVE)) { - self.owner.velocity = '0 0 0'; + self.owner.velocity = '0 0 0'; return; } @@ -2154,7 +2154,7 @@ void spawnfunc_func_vectormamamam() if(self.netname == "") self.netname = "1 0 0 0 1"; - if not(InitMovingBrushTrigger()) + if (!InitMovingBrushTrigger()) return; // wait for targets to spawn diff --git a/qcsrc/server/t_quake3.qc b/qcsrc/server/t_quake3.qc index 7f8cb82921..bb1128bd60 100644 --- a/qcsrc/server/t_quake3.qc +++ b/qcsrc/server/t_quake3.qc @@ -142,7 +142,7 @@ float DoesQ3ARemoveThisEntity() return 1; if(self.notta) - if not(!teamplay || g_tdm || g_ctf) + if (!(!teamplay || g_tdm || g_ctf)) return 1; if(self.notsingle) @@ -164,8 +164,6 @@ float DoesQ3ARemoveThisEntity() gametypename = "ffa"; if(teamplay) gametypename = "team"; - if(g_arena) - gametypename = "tournament"; if(g_ctf) gametypename = "ctf"; if(maxclients == 1) diff --git a/qcsrc/server/t_swamp.qc b/qcsrc/server/t_swamp.qc index 2a9d5427b6..e481dc6349 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 d61911ecdf..8f15a4f820 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) { @@ -33,7 +33,7 @@ float check_tdeath(entity player, vector org, vector telefragmin, vector telefra { TDEATHLOOP(org) { - if not(teamplay && autocvar_g_telefrags_teamplay && head.team == player.team) + if (!(teamplay && autocvar_g_telefrags_teamplay && head.team == player.team)) if(IS_PLAYER(head)) if(head.health >= 1) return 1; @@ -48,7 +48,7 @@ void tdeath(entity player, entity teleporter, entity telefragger, vector telefra { if (IS_PLAYER(player) && player.health >= 1) { - if not(teamplay && autocvar_g_telefrags_teamplay && head.team == player.team) + if (!(teamplay && autocvar_g_telefrags_teamplay && head.team == player.team)) { if(IS_PLAYER(head)) if(head.health >= 1) @@ -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 not(other.teleportable) + + 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,14 +223,14 @@ void Teleport_Touch (void) if(IS_PLAYER(other)) RemoveGrapplingHook(other); - + entity e; e = Simple_TeleportPlayer(self, other); activator = other; s = self.target; self.target = string_null; SUB_UseTargets(); - if not(self.target) self.target = s; + if (!self.target) self.target = s; oldself = self; self = e; @@ -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 ebb89aa5c9..4da6b13bbb 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 81c877db90..5185b2c611 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -56,7 +56,7 @@ void InitGameplayMode() teamplay = 0; serverflags &= ~SERVERFLAG_TEAMPLAY; - if not(cvar_value_issafe(world.fog)) + if (!cvar_value_issafe(world.fog)) { print("The current map contains a potentially harmful fog setting, ignored\n"); world.fog = string_null; @@ -115,13 +115,6 @@ void InitGameplayMode() MUTATOR_ADD(gamemode_lms); } - if(g_arena) - { - fraglimit_override = autocvar_g_arena_point_limit; - leadlimit_override = autocvar_g_arena_point_leadlimit; - MUTATOR_ADD(gamemode_arena); - } - if(g_ca) { ActivateTeamplay(); @@ -192,7 +185,7 @@ void InitGameplayMode() have_team_spawns = -1; // request team spawns MUTATOR_ADD(gamemode_nexball); } - + if(g_keepaway) { MUTATOR_ADD(gamemode_keepaway); @@ -600,7 +593,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 +664,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 675b5de0db..c3dbe55a48 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.. @@ -43,7 +43,7 @@ vector turret_stdproc_aim_generic() prep = pre_pos + (self.enemy.velocity * (impact_time + mintime)); if(self.aim_flags & TFL_AIM_ZPREDICT) - if not(self.enemy.flags & FL_ONGROUND) + if (!(self.enemy.flags & FL_ONGROUND)) if(self.enemy.movetype == MOVETYPE_WALK || self.enemy.movetype == MOVETYPE_TOSS || self.enemy.movetype == MOVETYPE_BOUNCE) { float vz; @@ -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 4145a6ea34..a8feaebc3b 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) @@ -88,7 +88,7 @@ void turret_stdproc_damage (entity inflictor, entity attacker, float damage, flo return; // Inactive turrets take no damage. (hm..) - if not (self.active) + if (!self.active) return; if (teamplay) @@ -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 5a77b17d91..b4ad709b4d 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; } @@ -83,13 +83,13 @@ void load_unit_settings(entity ent, string unitname, float is_reload) if (ent == world) return; - if not (ent.turret_scale_damage) ent.turret_scale_damage = 1; - if not (ent.turret_scale_range) ent.turret_scale_range = 1; - if not (ent.turret_scale_refire) ent.turret_scale_refire = 1; - if not (ent.turret_scale_ammo) ent.turret_scale_ammo = 1; - if not (ent.turret_scale_aim) ent.turret_scale_aim = 1; - if not (ent.turret_scale_health) ent.turret_scale_health = 1; - if not (ent.turret_scale_respawn) ent.turret_scale_respawn = 1; + if (!ent.turret_scale_damage) ent.turret_scale_damage = 1; + if (!ent.turret_scale_range) ent.turret_scale_range = 1; + if (!ent.turret_scale_refire) ent.turret_scale_refire = 1; + if (!ent.turret_scale_ammo) ent.turret_scale_ammo = 1; + if (!ent.turret_scale_aim) ent.turret_scale_aim = 1; + if (!ent.turret_scale_health) ent.turret_scale_health = 1; + if (!ent.turret_scale_respawn) ent.turret_scale_respawn = 1; sbase = strcat(cvar_base,unitname); if (is_reload) @@ -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,11 +328,11 @@ 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; - if not (self.active) + if (!self.active) target_angle = self.idle_aim - ('1 0 0' * self.aim_maxpitch); else if (self.enemy == world) { @@ -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,17 +571,17 @@ 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; if(e_target.owner == e_turret) return -0.5; - if not(checkpvs(e_target.origin, e_turret)) - return -1; + if (!checkpvs(e_target.origin, e_turret)) + return -1; - if not (e_target) + if (!e_target) return -2; if(g_onslaught) @@ -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; @@ -607,7 +607,7 @@ float turret_validate_target(entity e_turret, entity e_target, float validate_fl // player if (IS_CLIENT(e_target)) { - if not (validate_flags & TFL_TARGETSELECT_PLAYERS) + if (!(validate_flags & TFL_TARGETSELECT_PLAYERS)) return -7; if (e_target.deadflag != DEAD_NO) @@ -622,11 +622,11 @@ float turret_validate_target(entity e_turret, entity e_target, float validate_fl // Missile if (e_target.flags & FL_PROJECTILE) - if not (validate_flags & TFL_TARGETSELECT_MISSILES) + if (!(validate_flags & TFL_TARGETSELECT_MISSILES)) return -10; if (validate_flags & TFL_TARGETSELECT_MISSILESONLY) - if not (e_target.flags & FL_PROJECTILE) + if (!(e_target.flags & FL_PROJECTILE)) return -10.5; // Team check @@ -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) { @@ -785,13 +785,13 @@ void turret_think() #endif // Handle ammo - if not (self.spawnflags & TSF_NO_AMMO_REGEN) + 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 not (self.active) + if (!self.active) { turret_stdproc_track(); return; @@ -827,11 +827,11 @@ void turret_think() // This one is doing something.. oddball. assume its handles what needs to be handled. // Predict? - if not(self.aim_flags & TFL_AIM_NO) + if (!(self.aim_flags & TFL_AIM_NO)) self.tur_aimpos = turret_stdproc_aim_generic(); // Turn & pitch? - if not(self.track_flags & TFL_TRACK_NO) + if (!(self.track_flags & TFL_TRACK_NO)) turret_stdproc_track(); turret_do_updates(self); @@ -847,11 +847,11 @@ void turret_think() if(self.volly_counter != self.shot_volly) { // Predict or whatnot - if not(self.aim_flags & TFL_AIM_NO) + if (!(self.aim_flags & TFL_AIM_NO)) self.tur_aimpos = turret_stdproc_aim_generic(); // Turn & pitch - if not(self.track_flags & TFL_TRACK_NO) + if (!(self.track_flags & TFL_TRACK_NO)) turret_stdproc_track(); turret_do_updates(self); @@ -896,7 +896,7 @@ void turret_think() if (self.enemy == world) { // Turn & pitch - if not(self.track_flags & TFL_TRACK_NO) + if (!(self.track_flags & TFL_TRACK_NO)) turret_stdproc_track(); // do any per-turret stuff @@ -910,11 +910,11 @@ void turret_think() self.lip = time + autocvar_g_turrets_aimidle_delay; // Keep track of the last time we had a target. // Predict? - if not(self.aim_flags & TFL_AIM_NO) + if (!(self.aim_flags & TFL_AIM_NO)) self.tur_aimpos = turret_stdproc_aim_generic(); // Turn & pitch? - if not(self.track_flags & TFL_TRACK_NO) + if (!(self.track_flags & TFL_TRACK_NO)) turret_stdproc_track(); turret_do_updates(self); @@ -1021,24 +1021,24 @@ 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 not (e) + if (!e) { e = spawn(); e.classname = "turret_manager"; e.think = turrets_manager_think; e.nextthink = time + 2; } - - if not (self.spawnflags & TSF_SUSPENDED) + + if (!(self.spawnflags & TSF_SUSPENDED)) builtin_droptofloor(); // why can't we use regular droptofloor here? // Terrainbase spawnflag. This puts a enlongated model @@ -1058,9 +1058,9 @@ 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 not (teamplay) + if (!teamplay) self.team = MAX_SHOT_DISTANCE; // Group all turrets into the same team, so they dont kill eachother. else if(g_onslaught && self.targetname) { @@ -1081,111 +1081,111 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa * if it hits a glitch in my logic :P so try to set as mutch * as possible beforehand. */ - if not(self.ticrate) - { + 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 if (self.netname == "") self.netname = self.classname; - if not (self.respawntime) + if (!self.respawntime) self.respawntime = 60; self.respawntime = max(-1, self.respawntime); - if not (self.health) + if (!self.health) self.health = 1000; self.tur_health = max(1, self.health); - if not (self.turrcaps_flags) + if (!self.turrcaps_flags) self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL; - if not (self.damage_flags) + if (!self.damage_flags) self.damage_flags = TFL_DMG_YES | TFL_DMG_RETALIATE | TFL_DMG_AIMSHAKE; // Shot stuff. - if not (self.shot_refire) + if (!self.shot_refire) self.shot_refire = 1; self.shot_refire = bound(0.01, self.shot_refire, 9999); - if not (self.shot_dmg) + if (!self.shot_dmg) self.shot_dmg = self.shot_refire * 50; self.shot_dmg = max(1, self.shot_dmg); - if not (self.shot_radius) + if (!self.shot_radius) self.shot_radius = self.shot_dmg * 0.5; self.shot_radius = max(1, self.shot_radius); - if not (self.shot_speed) + if (!self.shot_speed) self.shot_speed = 2500; self.shot_speed = max(1, self.shot_speed); - if not (self.shot_spread) + if (!self.shot_spread) self.shot_spread = 0.0125; self.shot_spread = bound(0.0001, self.shot_spread, 500); - if not (self.shot_force) + if (!self.shot_force) self.shot_force = self.shot_dmg * 0.5 + self.shot_radius * 0.5; self.shot_force = bound(0.001, self.shot_force, 5000); - if not (self.shot_volly) + if (!self.shot_volly) self.shot_volly = 1; self.shot_volly = bound(1, self.shot_volly, floor(self.ammo_max / self.shot_dmg)); - if not (self.shot_volly_refire) + if (!self.shot_volly_refire) self.shot_volly_refire = self.shot_refire * self.shot_volly; self.shot_volly_refire = bound(self.shot_refire, self.shot_volly_refire, 60); - if not (self.firecheck_flags) + if (!self.firecheck_flags) self.firecheck_flags = TFL_FIRECHECK_DEAD | TFL_FIRECHECK_DISTANCES | TFL_FIRECHECK_LOS | TFL_FIRECHECK_AIMDIST | TFL_FIRECHECK_TEAMCECK | TFL_FIRECHECK_OWM_AMMO | TFL_FIRECHECK_REFIRE; // Range stuff. - if not (self.target_range) + if (!self.target_range) self.target_range = self.shot_speed * 0.5; self.target_range = bound(0, self.target_range, MAX_SHOT_DISTANCE); - if not (self.target_range_min) + if (!self.target_range_min) self.target_range_min = self.shot_radius * 2; self.target_range_min = bound(0, self.target_range_min, MAX_SHOT_DISTANCE); - if not (self.target_range_optimal) + if (!self.target_range_optimal) self.target_range_optimal = self.target_range * 0.5; self.target_range_optimal = bound(0, self.target_range_optimal, MAX_SHOT_DISTANCE); // Aim stuff. - if not (self.aim_maxrot) + if (!self.aim_maxrot) self.aim_maxrot = 90; self.aim_maxrot = bound(0, self.aim_maxrot, 360); - if not (self.aim_maxpitch) + if (!self.aim_maxpitch) self.aim_maxpitch = 20; self.aim_maxpitch = bound(0, self.aim_maxpitch, 90); - if not (self.aim_speed) + if (!self.aim_speed) self.aim_speed = 36; self.aim_speed = bound(0.1, self.aim_speed, 1000); - if not (self.aim_firetolerance_dist) + if (!self.aim_firetolerance_dist) self.aim_firetolerance_dist = 5 + (self.shot_radius * 2); self.aim_firetolerance_dist = bound(0.1, self.aim_firetolerance_dist, MAX_SHOT_DISTANCE); - if not (self.aim_flags) + if (!self.aim_flags) { self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE; if(self.turrcaps_flags & TFL_TURRCAPS_RADIUSDMG) self.aim_flags |= TFL_AIM_GROUNDGROUND; } - if not (self.track_type) + if (!self.track_type) self.track_type = TFL_TRACKTYPE_STEPMOTOR; if (self.track_type != TFL_TRACKTYPE_STEPMOTOR) @@ -1193,17 +1193,17 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa // Fluid / Ineria mode. Looks mutch nicer. // Can reduce aim preformance alot, needs a bit diffrent aimspeed - if not (self.aim_speed) + if (!self.aim_speed) self.aim_speed = 180; self.aim_speed = bound(0.1, self.aim_speed, 1000); - if not (self.track_accel_pitch) + if (!self.track_accel_pitch) self.track_accel_pitch = 0.5; - if not (self.track_accel_rot) + if (!self.track_accel_rot) self.track_accel_rot = 0.5; - if not (self.track_blendrate) + if (!self.track_blendrate) self.track_blendrate = 0.35; } @@ -1212,25 +1212,25 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa // Target selection stuff. - if not (self.target_select_rangebias) + if (!self.target_select_rangebias) self.target_select_rangebias = 1; self.target_select_rangebias = bound(-10, self.target_select_rangebias, 10); - if not (self.target_select_samebias) + if (!self.target_select_samebias) self.target_select_samebias = 1; self.target_select_samebias = bound(-10, self.target_select_samebias, 10); - if not (self.target_select_anglebias) + if (!self.target_select_anglebias) self.target_select_anglebias = 1; self.target_select_anglebias = bound(-10, self.target_select_anglebias, 10); - if not (self.target_select_missilebias) + if (!self.target_select_missilebias) self.target_select_missilebias = -10; self.target_select_missilebias = bound(-10, self.target_select_missilebias, 10); self.target_select_playerbias = bound(-10, self.target_select_playerbias, 10); - if not (self.target_select_flags) + if (!self.target_select_flags) { self.target_select_flags = TFL_TARGETSELECT_LOS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_ANGLELIMITS; @@ -1247,32 +1247,32 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa self.target_validate_flags = self.target_select_flags; // Ammo stuff - if not (self.ammo_max) + if (!self.ammo_max) self.ammo_max = self.shot_dmg * 10; self.ammo_max = max(self.shot_dmg, self.ammo_max); - if not (self.ammo) + if (!self.ammo) self.ammo = self.shot_dmg * 5; self.ammo = bound(0,self.ammo, self.ammo_max); - if not (self.ammo_recharge) + if (!self.ammo_recharge) self.ammo_recharge = self.shot_dmg * 0.5; self.ammo_recharge = max(0 ,self.ammo_recharge); // Convert the recharge from X per sec to X per ticrate self.ammo_recharge = self.ammo_recharge * self.ticrate; - if not (self.ammo_flags) + if (!self.ammo_flags) self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE; // Damage stuff if(self.spawnflags & TSL_NO_RESPAWN) - if not (self.damage_flags & TFL_DMG_DEATH_NORESPAWN) + if (!(self.damage_flags & TFL_DMG_DEATH_NORESPAWN)) self.damage_flags |= TFL_DMG_DEATH_NORESPAWN; // Offsets & origins if (!self.tur_shotorg) self.tur_shotorg = '50 0 50'; - + if (!self.health) self.health = 150; @@ -1306,7 +1306,7 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa self.tur_head.movetype = MOVETYPE_NOCLIP; // Defend mode? - if not (self.tur_defend) + if (!self.tur_defend) if (self.target != "") { self.tur_defend = find(world, targetname, self.target); @@ -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 2e3a006881..3fdd5eb1eb 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 481b4a285d..c919601a33 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 31b984e391..b98388984c 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 7c21ba7abe..8a01a9752a 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 8118b8f234..014fa25f69 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 not (self.enemy.ammo_flags & TFL_AMMO_ENERGY) - return 0; - + + if (!(self.enemy.ammo_flags & TFL_AMMO_ENERGY)) + return 0; + return 1; } diff --git a/qcsrc/server/tturrets/units/unit_hellion.qc b/qcsrc/server/tturrets/units/unit_hellion.qc index 75360bcd71..e1b88b06a8 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 c7d7396e8f..6ce6c72e23 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 8f18d845a9..46c46d7f8f 100644 --- a/qcsrc/server/tturrets/units/unit_machinegun.qc +++ b/qcsrc/server/tturrets/units/unit_machinegun.qc @@ -5,7 +5,7 @@ void turret_machinegun_attack(); //.float bulletcounter; void turret_machinegun_attack() { - fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, self.shot_force, DEATH_TURRET_MACHINEGUN, 0, 1, autocvar_g_balance_uzi_bulletconstant); + fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, self.shot_force, DEATH_TURRET_MACHINEGUN, 0, autocvar_g_balance_uzi_bulletconstant); endFireBallisticBullet(); UziFlash(); @@ -20,9 +20,8 @@ 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 not (autocvar_g_antilag_bullets) - self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN; + + self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN; if (turret_stdproc_init("machinegun_std", "models/turrets/base.md3", "models/turrets/machinegun.md3", TID_MACHINEGUN) == 0) { diff --git a/qcsrc/server/tturrets/units/unit_mlrs.qc b/qcsrc/server/tturrets/units/unit_mlrs.qc index a12d9d7259..783966032f 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 f4a60e545a..9fce826a2d 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 5969938912..4989b2445e 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; @@ -71,7 +71,7 @@ float turret_tesla_firecheck() self.target_select_time = time; } - if not (turret_stdproc_firecheck()) + if (!turret_stdproc_firecheck()) return 0; if(self.enemy) @@ -120,7 +120,7 @@ void turret_tesla_fire() void turret_tesla_postthink() { - if not (self.active) + if (!self.active) { self.tur_head.avelocity = '0 0 0'; return; diff --git a/qcsrc/server/tturrets/units/unit_walker.qc b/qcsrc/server/tturrets/units/unit_walker.qc index 5e0feea35b..1ce59dd278 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); } @@ -515,7 +515,7 @@ void walker_postthink() void walker_attack() { sound (self, CH_WEAPON_A, "weapons/uzi_fire.wav", VOL_BASE, ATTEN_NORM); - fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated, self.shot_spread, self.shot_speed, 5, self.shot_dmg, self.shot_force, DEATH_TURRET_WALK_GUN, 0, 1, autocvar_g_balance_uzi_bulletconstant); + fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated, self.shot_spread, self.shot_speed, 5, self.shot_dmg, self.shot_force, DEATH_TURRET_WALK_GUN, 0, autocvar_g_balance_uzi_bulletconstant); endFireBallisticBullet(); pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); } @@ -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); @@ -574,10 +574,7 @@ void turret_walker_dinit() self.turrcaps_flags = TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_MOVE ; self.aim_flags = TFL_AIM_LEAD; - if (autocvar_g_antilag_bullets) - self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN; - else - self.aim_flags |= TFL_AIM_SHOTTIMECOMPENSATE; + self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN; self.turret_respawnhook = walker_respawnhook; @@ -597,7 +594,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 dff26d6ea3..bc5f03d8ae 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); @@ -339,7 +339,7 @@ float bumb_gunner_enter() float vehicles_valid_pilot() { - if not(IS_PLAYER(other)) + if (!IS_PLAYER(other)) return FALSE; if(other.deadflag != DEAD_NO) @@ -348,7 +348,7 @@ float vehicles_valid_pilot() if(other.vehicle != world) return FALSE; - if not(IS_REAL_CLIENT(other)) + if (!IS_REAL_CLIENT(other)) if(!autocvar_g_vehicles_allow_bots) return FALSE; @@ -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'); } @@ -913,7 +913,7 @@ void spawnfunc_vehicle_bumblebee() if(autocvar_g_vehicle_bumblebee_health_regen) self.vehicle_flags |= VHF_HEALTHREGEN; - if not(vehicle_initialize( + if(!vehicle_initialize( "Bumblebee", "models/vehicles/bumblebee_body.dpm", "", "models/vehicles/spiderbot_cockpit.dpm", "", "", "tag_viewport", HUD_BUMBLEBEE, BUMB_MIN, BUMB_MAX, FALSE, @@ -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 97bf73aed1..ff54539027 100644 --- a/qcsrc/server/vehicles/racer.qc +++ b/qcsrc/server/vehicles/racer.qc @@ -150,7 +150,7 @@ void racer_rocket_groundhugger() return; } - if not (self.realowner.vehicle) + if (!self.realowner.vehicle) { UpdateCSQCProjectile(self); return; @@ -198,7 +198,7 @@ void racer_rocket_tracker() return; } - if not (self.realowner.vehicle) + if (!self.realowner.vehicle) { UpdateCSQCProjectile(self); return; @@ -492,7 +492,7 @@ void racer_exit(float eject) self.movetype = MOVETYPE_BOUNCE; sound (self.tur_head, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_VEHICLEENGINE, ATTEN_NORM); - if not (self.owner) + if (!self.owner) return; makevectors(self.angles); @@ -637,8 +637,8 @@ void spawnfunc_vehicle_racer() { remove(self); return; - } - + } + self.vehicle_flags |= VHF_DMGSHAKE; self.vehicle_flags |= VHF_DMGROLL; @@ -666,7 +666,7 @@ void spawnfunc_vehicle_racer() if(autocvar_g_vehicle_racer_health_regen) self.vehicle_flags |= VHF_HEALTHREGEN; - if not (vehicle_initialize( + if(!vehicle_initialize( "Wakizashi", "models/vehicles/wakizashi.dpm", "null", // we need this so tur_head is networked and usable for sounds @@ -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 ecad45b67c..58a640e9cf 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; @@ -249,9 +249,9 @@ void raptor_exit(float eject) self.nextthink = time; } - if not (self.owner) + 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,12 +909,12 @@ 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 not (vehicle_initialize( + + 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 9dc41952f3..bdbcb82887 100644 --- a/qcsrc/server/vehicles/spiderbot.qc +++ b/qcsrc/server/vehicles/spiderbot.qc @@ -99,7 +99,7 @@ void spiderbot_rocket_guided() self.nextthink = time; - if not (self.realowner.vehicle) + if (!self.realowner.vehicle) self.think = spiderbot_rocket_unguided; crosshair_trace(self.realowner); @@ -117,7 +117,7 @@ void spiderbot_guide_release() { entity rkt; rkt = findchainentity(realowner, self.owner); - if not (rkt) + if (!rkt) return; crosshair_trace(self.owner); @@ -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 not (self.owner.BUTTON_ATCK2) + 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); @@ -495,10 +495,10 @@ float spiderbot_frame() v_forward = normalize(v_forward); v += v_forward * 50; -//void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float force, float dtype, float tracereffects, float gravityfactor, float bulletconstant) +//void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float force, float dtype, float tracereffects, float bulletconstant) fireBallisticBullet(v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_speed, - 5, autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN, 0, 1, autocvar_g_vehicle_spiderbot_minigun_bulletconstant); + 5, autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN, 0, autocvar_g_vehicle_spiderbot_minigun_bulletconstant); endFireBallisticBullet(); @@ -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,8 +600,8 @@ void spiderbot_exit(float eject) self.nextthink = time; self.frame = 5; self.movetype = MOVETYPE_WALK; - - if not (self.owner) + + if (!self.owner) return; makevectors(self.angles); @@ -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,8 +854,8 @@ void spawnfunc_vehicle_spiderbot() if(autocvar_g_vehicle_spiderbot_health_regen) self.vehicle_flags |= VHF_HEALTHREGEN; - - if not (vehicle_initialize( + + if(!vehicle_initialize( "Spiderbot", "models/vehicles/spiderbot.dpm", "models/vehicles/spiderbot_top.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 75fa9407e6..1e5537a259 100644 --- a/qcsrc/server/vehicles/vehicles.qc +++ b/qcsrc/server/vehicles/vehicles.qc @@ -46,7 +46,7 @@ float SendAuxiliaryXhair(entity to, float sf) void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, float axh_id) { - if not(IS_REAL_CLIENT(own)) + if (!IS_REAL_CLIENT(own)) return; entity axh; @@ -101,15 +101,15 @@ void SendAuxiliaryXhair2(entity own, vector loc, vector clr, float axh_id) **/ void CSQCVehicleSetup(entity own, float vehicle_id) { - if not(IS_REAL_CLIENT(own)) + 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); } @@ -275,7 +275,7 @@ void vehicles_locktarget(float incr, float decr, float _lock_time) if(trace_ent.deadflag != DEAD_NO) trace_ent = world; - if not (trace_ent.vehicle_flags & VHF_ISVEHICLE || + if(!trace_ent.vehicle_flags & VHF_ISVEHICLE || trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET || trace_ent.takedamage == DAMAGE_TARGETDRONE) trace_ent = world; @@ -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) { @@ -559,7 +559,7 @@ void vehicles_touch() return; } - if not(IS_PLAYER(other)) + if (!IS_PLAYER(other)) return; if(other.deadflag != DEAD_NO) @@ -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,18 +1142,18 @@ 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 not (_owner.vehicle_flags & VHF_MULTISLOT) + if (!(_owner.vehicle_flags & VHF_MULTISLOT)) _owner.vehicle_flags |= VHF_MULTISLOT; _slot.PlayerPhysplug = _framefunc; @@ -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"); @@ -1310,25 +1310,25 @@ float vehicle_initialize(string net_name, } setsize(self, min_s, max_s); - if not (nodrop) + if (!nodrop) { setorigin(self, self.origin); 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 2eca8c2cbb..72cac79857 100644 --- a/qcsrc/server/w_common.qc +++ b/qcsrc/server/w_common.qc @@ -104,7 +104,10 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f // Find all non-hit players the beam passed close by if(deathtype == WEP_MINSTANEX || deathtype == WEP_NEX) { - FOR_EACH_REALCLIENT(msg_entity) if(msg_entity != self) if(!msg_entity.railgunhit) if not(IS_SPEC(msg_entity) && msg_entity.enemy == self) // we use realclient, so spectators can hear the whoosh too + FOR_EACH_REALCLIENT(msg_entity) + if(msg_entity != self) + if(!msg_entity.railgunhit) + if(!(IS_SPEC(msg_entity) && msg_entity.enemy == self)) // we use realclient, so spectators can hear the whoosh too { // nearest point on the beam beampos = start + dir * bound(0, (msg_entity.origin - start) * dir, length); @@ -189,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 @@ -244,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) { @@ -354,8 +357,8 @@ void W_BallisticBullet_Touch (void) // common/weapclip (intended) // common/noimpact (is supposed to eat projectiles, but is erased farther above) if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW) - if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID) - if not(trace_dphitcontents & DPCONTENTS_OPAQUE) + if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID)) + if (!(trace_dphitcontents & DPCONTENTS_OPAQUE)) { remove(self); return; @@ -386,29 +389,20 @@ void fireBallisticBullet_trace_callback(vector start, vector hit, vector end) self.owner = world; } -void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float force, float dtype, float tracereffects, float gravityfactor, float bulletconstant) +void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float force, float dtype, float tracereffects, float bulletconstant) { float lag, dt, savetime; //, density; entity pl, oldself; - float antilagging; - - antilagging = (autocvar_g_antilag_bullets && (pSpeed >= autocvar_g_antilag_bullets)); entity proj; proj = spawn(); proj.classname = "bullet"; proj.owner = proj.realowner = self; PROJECTILE_MAKETRIGGER(proj); - if(gravityfactor > 0) - { - proj.movetype = MOVETYPE_TOSS; - proj.gravity = gravityfactor; - } - else - proj.movetype = MOVETYPE_FLY; + proj.movetype = MOVETYPE_FLY; proj.think = SUB_Remove; proj.nextthink = time + lifetime; // min(pLifetime, vlen(world.maxs - world.mins) / pSpeed); - W_SetupProjectileVelocityEx(proj, dir, v_up, pSpeed, 0, 0, spread, antilagging); + W_SetupProjectileVelocityEx(proj, dir, v_up, pSpeed, 0, 0, spread, TRUE); proj.angles = vectoangles(proj.velocity); if(bulletconstant > 0) proj.dmg_radius = autocvar_g_ballistics_materialconstant / bulletconstant; @@ -429,122 +423,108 @@ void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, f other = proj; MUTATOR_CALLHOOK(EditProjectile); - if(antilagging) - { - float eff; + float eff; - if(tracereffects & EF_RED) - eff = particleeffectnum("tr_rifle"); - else if(tracereffects & EF_BLUE) - eff = particleeffectnum("tr_rifle_weak"); - else - eff = particleeffectnum("tr_bullet"); + if(tracereffects & EF_RED) + eff = particleeffectnum("tr_rifle"); + else if(tracereffects & EF_BLUE) + eff = particleeffectnum("tr_rifle_weak"); + else + eff = particleeffectnum("tr_bullet"); + + // NOTE: this may severely throw off weapon balance + lag = ANTILAG_LATENCY(self); + if(lag < 0.001) + lag = 0; + if (!IS_REAL_CLIENT(self)) + lag = 0; + if(autocvar_g_antilag == 0 || self.cvar_cl_noantilag) + lag = 0; // only do hitscan, but no antilag + + if(lag) + FOR_EACH_PLAYER(pl) + if(pl != self) + antilag_takeback(pl, time - lag); - // NOTE: this may severely throw off weapon balance - lag = ANTILAG_LATENCY(self); - if(lag < 0.001) - lag = 0; - if not(IS_REAL_CLIENT(self)) - lag = 0; - if(autocvar_g_antilag == 0 || self.cvar_cl_noantilag) - lag = 0; // only do hitscan, but no antilag + oldself = self; + self = proj; - if(lag) - FOR_EACH_PLAYER(pl) - if(pl != self) - antilag_takeback(pl, time - lag); + savetime = frametime; + frametime = 0.05; - oldself = self; - self = proj; + for(;;) + { + // DP tracetoss is stupid and always traces in 0.05s + // ticks. This makes it trace in 0.05*0.125s ticks + // instead. + vector v0; + v0 = self.velocity; + self.velocity = self.velocity * 0.125; + trace_fraction = 0; + fireBallisticBullet_trace_callback_ent = self; + fireBallisticBullet_trace_callback_eff = eff; + WarpZone_TraceToss_ThroughZone(self, self.owner, world, fireBallisticBullet_trace_callback); + self.velocity = v0; + + if(trace_fraction == 1) + break; + // won't hit anything anytime soon (DP's + // tracetoss does 200 tics of, here, + // 0.05*0.125s, that is, 1.25 seconds - savetime = frametime; - frametime = 0.05; + other = trace_ent; + dt = WarpZone_tracetoss_time * 0.125; // this is only approximate! + setorigin(self, trace_endpos); + self.velocity = WarpZone_tracetoss_velocity * (1 / 0.125); - for(;;) + if(!SUB_OwnerCheck()) { - // DP tracetoss is stupid and always traces in 0.05s - // ticks. This makes it trace in 0.05*0.125s ticks - // instead. - vector v0; - float g0; - v0 = self.velocity; - g0 = self.gravity; - self.velocity = self.velocity * 0.125; - self.gravity *= 0.125 * 0.125; - trace_fraction = 0; - fireBallisticBullet_trace_callback_ent = self; - fireBallisticBullet_trace_callback_eff = eff; - WarpZone_TraceToss_ThroughZone(self, self.owner, world, fireBallisticBullet_trace_callback); - self.velocity = v0; - self.gravity = g0; - - if(trace_fraction == 1) + if(SUB_NoImpactCheck()) break; - // won't hit anything anytime soon (DP's - // tracetoss does 200 tics of, here, - // 0.05*0.125s, that is, 1.25 seconds - - other = trace_ent; - dt = WarpZone_tracetoss_time * 0.125; // this is only approximate! - setorigin(self, trace_endpos); - self.velocity = WarpZone_tracetoss_velocity * (1 / 0.125); - if(!SUB_OwnerCheck()) - { - if(SUB_NoImpactCheck()) - break; - - // hit the player - W_BallisticBullet_Hit(); - } - - if(proj.dmg_radius < 0) // these NEVER penetrate solid - break; + // hit the player + W_BallisticBullet_Hit(); + } - // if we hit "weapclip", bail out - // - // rationale of this check: - // - // any shader that is solid, nodraw AND trans is meant to clip weapon - // shots and players, but has no other effect! - // - // if it is not trans, it is caulk and should not have this side effect - // - // matching shaders: - // common/weapclip (intended) - // common/noimpact (is supposed to eat projectiles, but is erased farther above) - if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW) - if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID) - if not(trace_dphitcontents & DPCONTENTS_OPAQUE) - break; + if(proj.dmg_radius < 0) // these NEVER penetrate solid + break; - // go through solid! - if(!W_BallisticBullet_LeaveSolid((other && (other.solid != SOLID_BSP)) ? eff : -1)) - break; + // if we hit "weapclip", bail out + // + // rationale of this check: + // + // any shader that is solid, nodraw AND trans is meant to clip weapon + // shots and players, but has no other effect! + // + // if it is not trans, it is caulk and should not have this side effect + // + // matching shaders: + // common/weapclip (intended) + // common/noimpact (is supposed to eat projectiles, but is erased farther above) + if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW) + if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID)) + if (!(trace_dphitcontents & DPCONTENTS_OPAQUE)) + break; - W_BallisticBullet_LeaveSolid_think(); + // go through solid! + if(!W_BallisticBullet_LeaveSolid((other && (other.solid != SOLID_BSP)) ? eff : -1)) + break; - self.projectiledeathtype |= HITTYPE_BOUNCE; - } - frametime = savetime; - self = oldself; + W_BallisticBullet_LeaveSolid_think(); - if(lag) - FOR_EACH_PLAYER(pl) - if(pl != self) - antilag_restore(pl); + self.projectiledeathtype |= HITTYPE_BOUNCE; + } + frametime = savetime; + self = oldself; - remove(proj); + if(lag) + FOR_EACH_PLAYER(pl) + if(pl != self) + antilag_restore(pl); - return; - } + remove(proj); - if(tracereffects & EF_RED) - CSQCProjectile(proj, TRUE, PROJECTILE_BULLET_GLOWING_TRACER, TRUE); - else if(tracereffects & EF_BLUE) - CSQCProjectile(proj, TRUE, PROJECTILE_BULLET_GLOWING, TRUE); - else - CSQCProjectile(proj, TRUE, PROJECTILE_BULLET, TRUE); + return; } void fireBullet (vector start, vector dir, float spread, float damage, float force, float dtype, float tracer) @@ -562,8 +542,8 @@ void fireBullet (vector start, vector dir, float spread, float damage, float for if (pointcontents (trace_endpos) != CONTENT_SKY) { - if not (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) - Damage_DamageInfo(trace_endpos, damage, 0, 0, dir * max(1, force), dtype, trace_ent.species, self); + if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)) + 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); } @@ -575,7 +555,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) @@ -593,14 +573,14 @@ float W_CheckProjectileDamage(entity inflictor, entity projowner, float deathtyp { if(is_from_exception) return (exception); // if exception is detected, allow it to override - else if not(is_from_contents) + else if (!is_from_contents) return FALSE; // otherwise, only allow damage from contents - } + } else if(autocvar_g_projectiles_damage == 1) { if(is_from_exception) return (exception); // if exception is detected, allow it to override - else if not(is_from_contents || is_from_owner) + else if (!(is_from_contents || is_from_owner)) return FALSE; // otherwise, only allow self damage and damage from contents } else if(autocvar_g_projectiles_damage == 2) // allow any damage, but override for exceptions @@ -616,13 +596,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 80af85acf3..f7ad7583d1 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); @@ -637,7 +637,7 @@ float w_crylink(float req) } self.crylink_waitrelease = 0; if(!w_crylink(WR_CHECKAMMO1) && !w_crylink(WR_CHECKAMMO2)) - if not(self.items & IT_UNLIMITED_WEAPON_AMMO) + if (!(self.items & IT_UNLIMITED_WEAPON_AMMO)) { // ran out of ammo! self.cnt = WEP_CRYLINK; diff --git a/qcsrc/server/w_electro.qc b/qcsrc/server/w_electro.qc index dcf4e65633..0ad23a137e 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) { @@ -279,7 +279,7 @@ void lgbeam_think() dt = frametime; // if this weapon is reloadable, decrease its load. Else decrease the player's ammo - if not(owner_player.items & IT_UNLIMITED_WEAPON_AMMO) + if (!(owner_player.items & IT_UNLIMITED_WEAPON_AMMO)) { if(autocvar_g_balance_electro_primary_ammo) { diff --git a/qcsrc/server/w_fireball.qc b/qcsrc/server/w_fireball.qc index b019bcc316..88e9d770fb 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 db8913b351..17144d3a53 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 811038b142..05768fc50b 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)) { @@ -337,7 +337,7 @@ void W_Hagar_Attack2_Load (void) } // we aren't checking ammo during an attack, so we must do it here - if not(weapon_action(self.weapon, WR_CHECKAMMO1) + weapon_action(self.weapon, WR_CHECKAMMO2)) + if (!(weapon_action(self.weapon, WR_CHECKAMMO1) + weapon_action(self.weapon, WR_CHECKAMMO2))) { // note: this doesn't force the switch W_SwitchToOtherWeapon(self); @@ -442,7 +442,7 @@ float w_hagar(float req) } else if (req == WR_RELOAD) { - if not(self.hagar_load) // require releasing loaded rockets first + if (!self.hagar_load) // require releasing loaded rockets first W_Reload(min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo), autocvar_g_balance_hagar_reload_ammo, autocvar_g_balance_hagar_reload_time, "weapons/reload.wav"); } else if (req == WR_SUICIDEMESSAGE) diff --git a/qcsrc/server/w_hlac.qc b/qcsrc/server/w_hlac.qc index 5959965a6c..5642ef0577 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); @@ -148,7 +148,7 @@ void HLAC_fire1_02() if (self.BUTTON_ATCK) { if (!weapon_action(self.weapon, WR_CHECKAMMO1)) - if not(self.items & IT_UNLIMITED_WEAPON_AMMO) + if (!(self.items & IT_UNLIMITED_WEAPON_AMMO)) { W_SwitchWeapon_Force(self, w_getbestweapon(self)); w_ready(); diff --git a/qcsrc/server/w_hook.qc b/qcsrc/server/w_hook.qc index 923083387f..f0310c702e 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 ... @@ -151,14 +151,14 @@ float w_hook(float req) if (self.BUTTON_ATCK || (!(self.items & IT_JETPACK) && self.BUTTON_HOOK)) { if(!self.hook) - if not(self.hook_state & HOOK_WAITING_FOR_RELEASE) - if not(self.hook_state & HOOK_FIRING) + if (!(self.hook_state & HOOK_WAITING_FOR_RELEASE)) + if (!(self.hook_state & HOOK_FIRING)) if (time > self.hook_refire) if (weapon_prepareattack(0, -1)) { 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); } } @@ -177,25 +177,25 @@ float w_hook(float req) self.hook_refire = max(self.hook_refire, time + autocvar_g_balance_hook_primary_refire * W_WeaponRateFactor()); // hook also inhibits health regeneration, but only for 1 second - if not(self.items & IT_UNLIMITED_WEAPON_AMMO) + if (!(self.items & IT_UNLIMITED_WEAPON_AMMO)) self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_pause_fuel_regen); } 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) { if ( time > self.hook_time_fueldecrease ) { - if not(self.items & IT_UNLIMITED_WEAPON_AMMO) + if (!(self.items & IT_UNLIMITED_WEAPON_AMMO)) { if ( self.ammo_fuel >= (time - self.hook_time_fueldecrease) * hooked_fuel ) { @@ -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 ac8cbf1c1d..0a0704638c 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 5d427a5a0f..5d88df8b25 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); } @@ -470,7 +470,7 @@ float w_minelayer(float req) if(autocvar_g_balance_minelayer_reload_ammo && self.clip_load < autocvar_g_balance_minelayer_ammo) // forced reload { // not if we're holding the minelayer without enough ammo, but can detonate existing mines - if not (W_PlacedMines(FALSE) && self.ammo_rockets < autocvar_g_balance_minelayer_ammo) + if (!(W_PlacedMines(FALSE) && self.ammo_rockets < autocvar_g_balance_minelayer_ammo)) weapon_action(self.weapon, WR_RELOAD); } else if (self.BUTTON_ATCK) diff --git a/qcsrc/server/w_minstanex.qc b/qcsrc/server/w_minstanex.qc index 1bd4e11bd4..9fb80c6d51 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 5ab21e2eae..919e27e5ae 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); @@ -156,7 +156,7 @@ float w_nex(float req) if(self.BUTTON_ATCK2) // only eat ammo when the button is pressed { dt = min(dt, (1 - self.nex_charge) / autocvar_g_balance_nex_secondary_charge_rate); - if not(self.items & IT_UNLIMITED_WEAPON_AMMO) + if (!(self.items & IT_UNLIMITED_WEAPON_AMMO)) { // if this weapon is reloadable, decrease its load. Else decrease the player's ammo if(autocvar_g_balance_nex_reload_ammo) @@ -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_rifle.qc b/qcsrc/server/w_rifle.qc index c1ed230cf9..90db2ad75c 100644 --- a/qcsrc/server/w_rifle.qc +++ b/qcsrc/server/w_rifle.qc @@ -21,7 +21,7 @@ void W_Rifle_FireBullet(float pSpread, float pDamage, float pForce, float pSpeed W_DecreaseAmmo(ammo_nails, pAmmo, autocvar_g_balance_rifle_reload_ammo); - W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, pSound, CH_WEAPON_A, pDamage * pShots); + W_SetupShot (self, TRUE, 2, pSound, CH_WEAPON_A, pDamage * pShots); pointparticles(particleeffectnum("rifle_muzzleflash"), w_shotorg, w_shotdir * 2000, 1); @@ -32,7 +32,7 @@ void W_Rifle_FireBullet(float pSpread, float pDamage, float pForce, float pSpeed } for(i = 0; i < pShots; ++i) - fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE), 1, pBulletConstant); + fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE), pBulletConstant); endFireBallisticBullet(); if (autocvar_g_casings >= 2) diff --git a/qcsrc/server/w_rocketlauncher.qc b/qcsrc/server/w_rocketlauncher.qc index 6c5bae99c1..6cd8929f6f 100644 --- a/qcsrc/server/w_rocketlauncher.qc +++ b/qcsrc/server/w_rocketlauncher.qc @@ -147,8 +147,8 @@ void W_Rocket_Think (void) if (self.realowner.weapon == WEP_ROCKET_LAUNCHER) { if(self == self.realowner.lastrocket) - if not(self.realowner.rl_release) - if not(self.BUTTON_ATCK2) + if (!self.realowner.rl_release) + if (!self.BUTTON_ATCK2) if(autocvar_g_balance_rocketlauncher_guiderate) if(time > self.pushltime) if(self.realowner.deadflag == DEAD_NO) @@ -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 ba580e702e..c870f0868e 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 b26fca2b7a..2fb6214017 100644 --- a/qcsrc/server/w_shotgun.qc +++ b/qcsrc/server/w_shotgun.qc @@ -35,9 +35,9 @@ void W_Shotgun_Attack (void) W_DecreaseAmmo(ammo_shells, ammoamount, autocvar_g_balance_shotgun_reload_ammo); - W_SetupShot (self, autocvar_g_antilag_bullets && bulletspeed >= autocvar_g_antilag_bullets, 5, "weapons/shotgun_fire.wav", CH_WEAPON_A, d * bullets); + W_SetupShot (self, TRUE, 5, "weapons/shotgun_fire.wav", CH_WEAPON_A, d * bullets); for (sc = 0;sc < bullets;sc = sc + 1) - fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, f, WEP_SHOTGUN, 0, 1, bulletconstant); + fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, f, WEP_SHOTGUN, 0, bulletconstant); endFireBallisticBullet(); pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 1000, autocvar_g_balance_shotgun_primary_ammo); @@ -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; } @@ -178,19 +178,14 @@ float w_shotgun(float req) if(vlen(self.origin-self.enemy.origin) <= autocvar_g_balance_shotgun_secondary_melee_range) self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, FALSE); else - { - if(autocvar_g_antilag_bullets) - self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE); - else - self.BUTTON_ATCK = bot_aim(autocvar_g_balance_shotgun_primary_speed, 0, 0.001, FALSE); - } + self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE); else if (req == WR_THINK) { if(autocvar_g_balance_shotgun_reload_ammo && self.clip_load < autocvar_g_balance_shotgun_primary_ammo) // forced reload { // don't force reload an empty shotgun if its melee attack is active - if not(autocvar_g_balance_shotgun_secondary && self.ammo_shells < autocvar_g_balance_shotgun_primary_ammo) + if (!(autocvar_g_balance_shotgun_secondary && self.ammo_shells < autocvar_g_balance_shotgun_primary_ammo)) weapon_action(self.weapon, WR_RELOAD); } else diff --git a/qcsrc/server/w_tuba.qc b/qcsrc/server/w_tuba.qc index db4f953852..f70aa04431 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 // *** ** **** @@ -313,7 +313,7 @@ void W_Tuba_NoteOn(float hittype) } } - if not(self.tuba_note) + if (!self.tuba_note) { self.tuba_note = spawn(); self.tuba_note.owner = self.tuba_note.realowner = self; diff --git a/qcsrc/server/w_uzi.qc b/qcsrc/server/w_uzi.qc index b3852b8e87..5fd890a0b7 100644 --- a/qcsrc/server/w_uzi.qc +++ b/qcsrc/server/w_uzi.qc @@ -51,7 +51,7 @@ void UziFlash() void W_UZI_Attack (float deathtype) { - W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, ((self.misc_bulletcounter == 1) ? autocvar_g_balance_uzi_first_damage : autocvar_g_balance_uzi_sustained_damage)); + W_SetupShot (self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, ((self.misc_bulletcounter == 1) ? autocvar_g_balance_uzi_first_damage : autocvar_g_balance_uzi_sustained_damage)); if (!autocvar_g_norecoil) { self.punchangle_x = random () - 0.5; @@ -62,9 +62,9 @@ void W_UZI_Attack (float deathtype) ATTACK_FINISHED(self) = time + autocvar_g_balance_uzi_first_refire * W_WeaponRateFactor(); if (self.misc_bulletcounter == 1) - fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_first_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_first_damage, autocvar_g_balance_uzi_first_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant); + fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_first_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_first_damage, autocvar_g_balance_uzi_first_force, deathtype, 0, autocvar_g_balance_uzi_bulletconstant); else - fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_sustained_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant); + fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_sustained_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, deathtype, 0, autocvar_g_balance_uzi_bulletconstant); endFireBallisticBullet(); pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1); @@ -93,7 +93,7 @@ void uzi_fire1_02() if (self.BUTTON_ATCK) { if (!weapon_action(self.weapon, WR_CHECKAMMO2)) - if not(self.items & IT_UNLIMITED_WEAPON_AMMO) + if (!(self.items & IT_UNLIMITED_WEAPON_AMMO)) { W_SwitchWeapon_Force(self, w_getbestweapon(self)); w_ready(); @@ -119,7 +119,7 @@ void uzi_mode1_fire_auto() } if (!weapon_action(self.weapon, WR_CHECKAMMO1)) - if not(self.items & IT_UNLIMITED_WEAPON_AMMO) + if (!(self.items & IT_UNLIMITED_WEAPON_AMMO)) { W_SwitchWeapon_Force(self, w_getbestweapon(self)); w_ready(); @@ -128,7 +128,7 @@ void uzi_mode1_fire_auto() W_DecreaseAmmo(ammo_nails, autocvar_g_balance_uzi_sustained_ammo, autocvar_g_balance_uzi_reload_ammo); - W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, autocvar_g_balance_uzi_sustained_damage); + W_SetupShot (self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, autocvar_g_balance_uzi_sustained_damage); if (!autocvar_g_norecoil) { self.punchangle_x = random () - 0.5; @@ -136,7 +136,7 @@ void uzi_mode1_fire_auto() } uzi_spread = bound(autocvar_g_balance_uzi_spread_min, autocvar_g_balance_uzi_spread_min + (autocvar_g_balance_uzi_spread_add * self.misc_bulletcounter), autocvar_g_balance_uzi_spread_max); - fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant); + fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, autocvar_g_balance_uzi_bulletconstant); endFireBallisticBullet(); self.misc_bulletcounter = self.misc_bulletcounter + 1; @@ -155,14 +155,14 @@ void uzi_mode1_fire_auto() void uzi_mode1_fire_burst() { - W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, autocvar_g_balance_uzi_sustained_damage); + W_SetupShot (self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, autocvar_g_balance_uzi_sustained_damage); if (!autocvar_g_norecoil) { self.punchangle_x = random () - 0.5; self.punchangle_y = random () - 0.5; } - fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_burst_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant); + fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_burst_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, autocvar_g_balance_uzi_bulletconstant); endFireBallisticBullet(); @@ -216,7 +216,7 @@ float w_uzi(float req) if(weapon_prepareattack(1, 0)) { if (!weapon_action(self.weapon, WR_CHECKAMMO2)) - if not(self.items & IT_UNLIMITED_WEAPON_AMMO) + if (!(self.items & IT_UNLIMITED_WEAPON_AMMO)) { W_SwitchWeapon_Force(self, w_getbestweapon(self)); w_ready(); diff --git a/qcsrc/server/waypointsprites.qc b/qcsrc/server/waypointsprites.qc index 6454838ebd..736cc564cc 100644 --- a/qcsrc/server/waypointsprites.qc +++ b/qcsrc/server/waypointsprites.qc @@ -197,7 +197,7 @@ float WaypointSprite_visible_for_player(entity e) { if(self.team != e.team) return FALSE; - if not(IS_PLAYER(e)) + if (!IS_PLAYER(e)) return FALSE; } @@ -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 0000000000..c71b6cdced --- /dev/null +++ b/qcsrc/uncrusticracy.sh @@ -0,0 +1,173 @@ +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_CONFIG=uncrustify.cfg.test sh uncrustify.sh $FILES >/dev/null 2>&1 + status=$? + if [ $status -gt 1 ]; then + echo "# ERROR: $KEY = $choice crashes with status $status." + continue + fi + 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"*|*"#ignore"*) + 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 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 new file mode 100644 index 0000000000..982e527f9e --- /dev/null +++ b/qcsrc/uncrustify.cfg @@ -0,0 +1,1849 @@ +# Uncrustify 0.60 + +# +# General options +# + +# 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 +input_tab_size = 4 # number + +# The size of tabs in the output (only used if align_with_tabs=true) +output_tab_size = 4 # number + +# The ASCII value of the string escape char, usually 92 (\) or 94 (^). (Pawn) +string_escape_char = 92 # number #ignore + +# Alternate string escape char for Pawn. Only works right before the quote char. +string_escape_char2 = 0 # number #ignore + +# Allow interpreting '>=' and '>>=' as part of a template in 'void f(list>=val);'. +# If true (default), 'assert(x<0 && y>=3)' will be broken. +# Improvements to template detection may make this option obsolete. +# WARNING: Code doesn't seem to use this feature - delete from the config? +tok_split_gte = false # false/true + +# Control what to do with the UTF-8 BOM (recommend 'remove') +utf8_bom = remove # ignore/add/remove/force #force + +# If the file contains bytes with values between 128 and 255, but is not UTF-8, then output as UTF-8 +utf8_byte = true # false/true #force + +# Force the output encoding to UTF-8 +utf8_force = true # false/true #force + +# +# Indenting +# + +# The number of columns to indent per level. +# Usually 2, 3, 4, or 8. +indent_columns = 4 # number + +# The continuation indent. If non-zero, this overrides the indent of '(' and '=' continuation indents. +# For FreeBSD, this is set to 4. Negative value is absolute and not increased for each ( level +indent_continue = indent_columns # number + +# How to use tabs when indenting code +# 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 #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 +indent_brace = 0 # number + +# Whether braces are indented to the body level +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 + +# Virtual indent from the ':' for member initializers. Default is 2 +# WARNING: Code doesn't seem to use this feature - delete from the config? +indent_ctor_init_leading = 0 # number + +# Additional indenting for constructor initializer list +# WARNING: Code doesn't seem to use this feature - delete from the config? +indent_ctor_init = 0 # number + +# False=treat 'else\nif' as 'else if' for indenting purposes +# True=indent the 'if' one level +indent_else_if = true # 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: force indentation of function definition to start in column 1 +# False: use the default behavior +indent_func_def_force_col1 = false # false/true + +# True: indent continued function call parameters one indent level +# False: align parameters under the open paren +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 = true # 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. +indent_member = 0 # number + +# Spaces to indent single line ('//') comments on lines before code +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 = true # false/true #force + +# Spaces to indent 'case' from 'switch' +# Usually 0 or indent_columns. +indent_switch_case = indent_columns # number + +# Spaces to shift the 'case' line, without affecting any other lines +# Usually 0. +indent_case_shift = 0 # number + +# Spaces to indent '{' from 'case'. +# By default, the brace will appear under the 'c' in case. +# Usually set to 0 or indent_columns. +indent_case_brace = 0 # number + +# Whether to indent comments found in first column +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 +# 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 +# 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 = 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 +# If FALSE or the '=' is followed by a newline, the next line is indent one tab. +# WARNING: Code doesn't seem to use this feature - delete from the config? +indent_align_assign = false # false/true + +# Indent OC blocks at brace level instead of usual rules. +indent_oc_block = false # false/true #ignore + +# Indent OC blocks in a message relative to the parameter name. +# 0=use indent_oc_block rules, 1+=spaces to indent #ignore +indent_oc_block_msg = 0 # number #ignore + +# Minimum indent for subsequent parameters +indent_oc_msg_colon = 0 # number #ignore + +# +# Spacing options +# + +# Add or remove space around arithmetic operator '+', '-', '/', '*', etc +sp_arith = ignore # ignore/add/remove/force #force + +# Add or remove space around assignment operator '=', '+=', etc +# NOTE: is 54 worse than ignore +sp_assign = add # ignore/add/remove/force + +# Add or remove space around '=' in C++11 lambda capture specifications. Overrides sp_assign +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_cpp_lambda_assign = ignore # ignore/add/remove/force + +# Add or remove space after the capture specification in C++11 lambda. +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_cpp_lambda_paren = ignore # ignore/add/remove/force + +# Add or remove space around assignment operator '=' in a prototype +# 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 #force + +# Add or remove space after assignment operator '=', '+=', etc. Overrides sp_assign. +sp_after_assign = ignore # ignore/add/remove/force #force + +# Add or remove space around assignment '=' in enum +# 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 #force + +# Add or remove space after assignment '=' in enum. Overrides sp_enum_assign. +sp_enum_after_assign = ignore # ignore/add/remove/force #force + +# Add or remove space around preprocessor '##' concatenation operator. Default=Add +# NOTE: is 4 worse than ignore +sp_pp_concat = remove # ignore/add/remove/force + +# Add or remove space after preprocessor '#' stringify operator. Also affects the '#@' charizing operator. +sp_pp_stringify = remove # ignore/add/remove/force + +# Add or remove space before preprocessor '#' stringify operator as in '#define x(y) L#y'. +sp_before_pp_stringify = add # ignore/add/remove/force + +# Add or remove space around boolean operators '&&' and '||' +# NOTE: is 2 worse than ignore +sp_bool = add # ignore/add/remove/force + +# Add or remove space around compare operator '<', '>', '==', etc +# NOTE: is 198 worse than ignore +sp_compare = add # ignore/add/remove/force + +# Add or remove space inside '(' and ')' +# NOTE: is 10 worse than ignore +sp_inside_paren = remove # ignore/add/remove/force + +# Add or remove space between nested parens +# NOTE: is 18 worse than ignore +sp_paren_paren = remove # ignore/add/remove/force + +# Whether to balance spaces inside nested parens +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 '*' +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_before_ptr_star = ignore # 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 = 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 = 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 = add # ignore/add/remove/force + +# Add or remove space after a pointer star '*', if followed by an open paren (function types). +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_ptr_star_paren = ignore # ignore/add/remove/force + +# Add or remove space before a pointer star '*', if followed by a func proto/def. +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 = add # ignore/add/remove/force + +# Add or remove space before the paren in the D constructs 'template Foo(' and 'class Foo('. +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_before_template_paren = ignore # 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 +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_angle_shift = ignore # ignore/add/remove/force + +# Permit removal of the space between '>>' in 'foo >' (C++11 only). Default=False +# sp_angle_shift cannot remove the space without this option. +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_permit_cpp11_shift = false # false/true + +# Add or remove space before '(' of 'if', 'for', 'switch', and 'while' +sp_before_sparen = remove # ignore/add/remove/force #force + +# Add or remove space inside if-condition '(' and ')' +# NOTE: is 42 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 #force + +# Add or remove space before if-condition '('. Overrides sp_inside_sparen. +sp_inside_sparen_open = ignore # ignore/add/remove/force #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' +sp_sparen_brace = add # ignore/add/remove/force + +# Add or remove space between 'invariant' and '(' in the D language. +sp_invariant_paren = ignore # ignore/add/remove/force #ignore + +# Add or remove space after the ')' in 'invariant (C) c' in the D language. +sp_after_invariant_paren = ignore # ignore/add/remove/force #ignore + +# 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 +# NOTE: is 2 worse than ignore +sp_before_semi = remove # ignore/add/remove/force + +# Add or remove space before ';' in non-empty 'for' statements +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 = add # ignore/add/remove/force + +# Add or remove space after ';', except when followed by a comment. Default=Add +# NOTE: is 56 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 = 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 = add # ignore/add/remove/force + +# Add or remove space before '[' (except '[]') +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 a non-empty '[' and ']' +sp_inside_square = remove # ignore/add/remove/force + +# Add or remove space after ',' +sp_after_comma = add # ignore/add/remove/force #force + +# Add or remove space before ',' +# NOTE: is 58 worse than ignore +sp_before_comma = remove # ignore/add/remove/force + +# Add or remove space between an open paren and comma: '(,' vs '( ,' +# 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 +sp_inside_paren_cast = remove # 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)' +sp_cpp_cast_paren = remove # 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) +sp_after_tag = ignore # ignore/add/remove/force #ignore + +# 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 = add # ignore/add/remove/force + +# Add or remove space inside '{}' +# NOTE: is 10 worse than ignore +sp_inside_braces_empty = remove # 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. +sp_type_func = add # ignore/add/remove/force + +# Add or remove space between function name and '(' on function declaration +# NOTE: is 30 worse than ignore +sp_func_proto_paren = remove # ignore/add/remove/force + +# Add or remove space between function name and '(' on function definition +# NOTE: is 400 worse than ignore +sp_func_def_paren = remove # ignore/add/remove/force + +# Add or remove space inside empty function '()' +sp_inside_fparens = remove # ignore/add/remove/force + +# Add or remove space inside function '(' and ')' +# NOTE: is 78 worse than ignore +sp_inside_fparen = remove # ignore/add/remove/force + +# Add or remove space inside the first parens in the function type: 'void (*x)(...)' +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_inside_tparen = ignore # ignore/add/remove/force + +# Add or remove between the parens in the function type: 'void (*x)(...)' +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_after_tparen_close = ignore # 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 +sp_fparen_brace = add # ignore/add/remove/force + +# Add or remove space between function name and '(' on function calls +# NOTE: is 940 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 = 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 = remove # ignore/add/remove/force + +# Add or remove space between a constructor/destructor and the open paren +sp_func_class_paren = remove # 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 'throw' and anything other than '(' as in '@throw [...];' +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_after_throw = ignore # ignore/add/remove/force + +# Add or remove space between 'catch' and '(' in 'catch (something) { }' +# If set to ignore, sp_before_sparen is used. +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_catch_paren = ignore # ignore/add/remove/force + +# Add or remove space between 'version' and '(' in 'version (something) { }' (D language) +# If set to ignore, sp_before_sparen is used. +sp_version_paren = ignore # ignore/add/remove/force #ignore + +# Add or remove space between 'scope' and '(' in 'scope (something) { }' (D language) +# If set to ignore, sp_before_sparen is used. +sp_scope_paren = ignore # ignore/add/remove/force #ignore + +# Add or remove space between macro and value +sp_macro = remove # ignore/add/remove/force #force + +# Add or remove space between macro function ')' and value +sp_macro_func = remove # ignore/add/remove/force #force + +# Add or remove space between 'else' and '{' if on the same line +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 +sp_brace_typedef = add # 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 +sp_d_array_colon = ignore # ignore/add/remove/force #ignore + +# Add or remove space after the '!' (not) operator. Default=Remove +sp_not = remove # ignore/add/remove/force + +# Add or remove space after the '~' (invert) operator. Default=Remove +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. +# 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 28 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. +# 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 4 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 #force + +# Add or remove space after the scope '+' or '-', as in '-(void) foo;' or '+(int) bar;' +sp_after_oc_scope = ignore # ignore/add/remove/force #ignore + +# Add or remove space after the colon in message specs +# '-(int) f:(int) x;' vs '-(int) f: (int) x;' +sp_after_oc_colon = ignore # ignore/add/remove/force #ignore + +# Add or remove space before the colon in message specs +# '-(int) f: (int) x;' vs '-(int) f : (int) x;' +sp_before_oc_colon = ignore # ignore/add/remove/force #ignore + +# Add or remove space after the colon in immutable dictionary expression +# 'NSDictionary *test = @{@"foo" :@"bar"};' +sp_after_oc_dict_colon = ignore # ignore/add/remove/force #ignore + +# Add or remove space before the colon in immutable dictionary expression +# 'NSDictionary *test = @{@"foo" :@"bar"};' +sp_before_oc_dict_colon = ignore # ignore/add/remove/force #ignore + +# Add or remove space after the colon in message specs +# '[object setValue:1];' vs '[object setValue: 1];' +sp_after_send_oc_colon = ignore # ignore/add/remove/force #ignore + +# Add or remove space before the colon in message specs +# '[object setValue:1];' vs '[object setValue :1];' +sp_before_send_oc_colon = ignore # ignore/add/remove/force #ignore + +# Add or remove space after the (type) in message specs +# '-(int)f: (int) x;' vs '-(int)f: (int)x;' +sp_after_oc_type = ignore # ignore/add/remove/force #ignore + +# Add or remove space after the first (type) in message specs +# '-(int) f:(int)x;' vs '-(int)f:(int)x;' +sp_after_oc_return_type = ignore # ignore/add/remove/force #ignore + +# Add or remove space between '@selector' and '(' +# '@selector(msgName)' vs '@selector (msgName)' +# Also applies to @protocol() constructs +sp_after_oc_at_sel = ignore # ignore/add/remove/force #ignore + +# Add or remove space between '@selector(x)' and the following word +# '@selector(foo) a:' vs '@selector(foo)a:' +sp_after_oc_at_sel_parens = ignore # ignore/add/remove/force #ignore + +# Add or remove space inside '@selector' parens +# '@selector(foo)' vs '@selector( foo )' +# Also applies to @protocol() constructs +sp_inside_oc_at_sel_parens = ignore # ignore/add/remove/force #ignore + +# Add or remove space before a block pointer caret +# '^int (int arg){...}' vs. ' ^int (int arg){...}' +sp_before_oc_block_caret = ignore # ignore/add/remove/force #ignore + +# Add or remove space after a block pointer caret +# '^int (int arg){...}' vs. '^ int (int arg){...}' +sp_after_oc_block_caret = ignore # ignore/add/remove/force #ignore + +# Add or remove space between the receiver and selector in a message. +# '[receiver selector ...]' +sp_after_oc_msg_receiver = ignore # ignore/add/remove/force #ignore + +# Add or remove space after @property. +sp_after_oc_property = ignore # ignore/add/remove/force #ignore + +# Add or remove space around the ':' in 'b ? t : f' +sp_cond_colon = add # ignore/add/remove/force + +# Add or remove space around the '?' in 'b ? t : f' +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 spacing after ':' in 'for (TYPE VAR : EXPR)' (Java) +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_after_for_colon = ignore # ignore/add/remove/force + +# Control the spacing before ':' in 'for (TYPE VAR : EXPR)' (Java) +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_before_for_colon = ignore # ignore/add/remove/force + +# Control the spacing in 'extern (C)' (D) +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_extern_paren = ignore # ignore/add/remove/force + +# Control the space after the opening of a C++ comment '// A' vs '//A' +sp_cmt_cpp_start = add # ignore/add/remove/force #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 + +# Controls the spaces after 'new', 'delete', and 'delete[]' +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_after_new = ignore # ignore/add/remove/force + +# Controls the spaces before a trailing or embedded comment +sp_before_tr_emb_cmt = force # ignore/add/remove/force #force + +# Number of spaces before a trailing or embedded comment +sp_num_before_tr_emb_cmt = 2 # number #force + +# Control space between a Java annotation and the open paren. +# WARNING: Code doesn't seem to use this feature - delete from the config? +sp_annotation_paren = ignore # ignore/add/remove/force + +# +# Code alignment (not left column spaces/tabs) +# + +# Whether to keep non-indenting tabs +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 +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. +# The function names must already be aligned with each other. +align_same_func_call_params = false # false/true + +# The span for aligning variable definitions (0=don't align) +align_var_def_span = 0 # number + +# How to align the star in variable definitions. +# 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) +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 = 2 # number + +# If aligning comments, mix with comments after '}' and #endif with less than 3 spaces before the comment +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: Best is not unique (0 1) +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: Best is not unique (1 2) +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) +align_oc_msg_spec_span = 0 # number #ignore + +# Whether to align macros wrapped with a backslash and a newline. +# This will not work right if the macro contains a multi-line comment. +align_nl_cont = false # false/true + +# # Align macro functions and variables together +# WARNING: Code doesn't seem to use this feature - delete from the config? +align_pp_define_together = 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 +# 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) +align_oc_msg_colon_span = 0 # number #ignore + +# If true, always align with the first parameter, even if it is too short. +align_oc_msg_colon_first = false # false/true #ignore + +# Aligning parameters in an Obj-C '+' or '-' declaration on the ':' +align_oc_decl_colon = false # false/true #ignore + +# +# Newline adding and removing options +# + +# Whether to collapse empty blocks between '{' and '}' +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 = true # false/true + +# Don't split one-line if/else statements - 'if(a) b++;' +nl_if_leave_one_liners = true # false/true + +# Don't split one-line OC messages +nl_oc_msg_leave_one_liner = false # false/true #ignore + +# Add or remove newlines at the start of the file +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' +nl_start_of_file_min = 0 # number #force + +# Add or remove newline at the end of the file +nl_end_of_file = add # ignore/add/remove/force #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 = 1 # number #force + +# 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 at the top of a function body +# 0 = No change (default) +nl_func_var_def_blk = 0 # number #force + +# The number of newlines before a block of typedefs +# 0 = No change (default) +nl_typedef_blk_start = 0 # number #force + +# The number of newlines after a block of typedefs +# 0 = No change (default) +nl_typedef_blk_end = 0 # number #force + +# The maximum consecutive newlines within a block of typedefs +# 0 = No change (default) +# WARNING: Best is not unique (0 2) +nl_typedef_blk_in = 0 # number + +# The number of newlines before a block of variable definitions not at the top of a function body +# 0 = No change (default) +# WARNING: Best is not unique (0 1) +nl_var_def_blk_start = 0 # number + +# The number of newlines after a block of variable definitions not at the top of a function body +# 0 = No change (default) +# WARNING: Best is not unique (0 1) +nl_var_def_blk_end = 0 # number + +# The maximum consecutive newlines within a block of variable definitions +# 0 = No change (default) +# WARNING: Best is not unique (0 3) +nl_var_def_blk_in = 0 # number + +# Add or remove newline between a function call's ')' and '{', as in: +# list_for_each(item, &list) { } +# NOTE: is 28 worse than ignore +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 '{' +nl_struct_brace = add # 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 '{' +# NOTE: is 231 worse than ignore +nl_if_brace = add # ignore/add/remove/force + +# Add or remove newline between '}' and 'else' +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 = add # ignore/add/remove/force + +# Add or remove newline between 'else' and '{' +nl_else_brace = add # ignore/add/remove/force + +# Add or remove newline between 'else' and 'if' +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 '{' +# NOTE: is 93 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 '{' +# NOTE: is 21 worse than ignore +nl_while_brace = add # ignore/add/remove/force + +# Add or remove newline between 'scope (x)' and '{' (D) +# WARNING: Code doesn't seem to use this feature - delete from the config? +nl_scope_brace = ignore # ignore/add/remove/force + +# Add or remove newline between 'unittest' and '{' (D) +# WARNING: Code doesn't seem to use this feature - delete from the config? +nl_unittest_brace = ignore # ignore/add/remove/force + +# Add or remove newline between 'version (x)' and '{' (D) +# WARNING: Code doesn't seem to use this feature - delete from the config? +nl_version_brace = ignore # 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. +nl_brace_brace = remove # ignore/add/remove/force + +# Add or remove newline between 'do' and '{' +# NOTE: is 3 worse than ignore +nl_do_brace = add # ignore/add/remove/force + +# Add or remove newline between '}' and 'while' of 'do' statement +nl_brace_while = add # ignore/add/remove/force #force + +# Add or remove newline between 'switch' and '{' +# NOTE: is 21 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. +nl_multi_line_define = false # false/true + +# Whether to put a newline before 'case' statement +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 + +# Add or remove a newline between a case ':' and '{'. Overrides nl_after_case. +# NOTE: is 27 worse than ignore +nl_case_colon_brace = add # ignore/add/remove/force + +# 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 = 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 +# NOTE: is 6 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 = remove # ignore/add/remove/force + +# Add or remove newline between a function name and the opening '(' in the definition +nl_func_def_paren = remove # ignore/add/remove/force + +# Add or remove newline after '(' in a function declaration +# NOTE: is 6 worse than ignore +nl_func_decl_start = remove # ignore/add/remove/force + +# Add or remove newline after '(' in a function definition +# NOTE: is 23 worse than ignore +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 #force + +# Overrides nl_func_def_start when there is only one parameter. +nl_func_def_start_single = ignore # ignore/add/remove/force #force + +# Add or remove newline after each ',' in a function declaration +# NOTE: is 38 worse than ignore +nl_func_decl_args = remove # ignore/add/remove/force + +# Add or remove newline after each ',' in a function definition +# NOTE: is 37 worse than ignore +nl_func_def_args = remove # ignore/add/remove/force + +# Add or remove newline before the ')' in a function declaration +nl_func_decl_end = remove # ignore/add/remove/force + +# Add or remove newline before the ')' in a function definition +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 #force + +# Overrides nl_func_def_end when there is only one parameter. +nl_func_def_end_single = ignore # ignore/add/remove/force #force + +# Add or remove newline between '()' in a function declaration. +nl_func_decl_empty = remove # ignore/add/remove/force + +# Add or remove newline between '()' in a function definition. +nl_func_def_empty = remove # ignore/add/remove/force + +# Whether to put each OC message parameter on a separate line +# See nl_oc_msg_leave_one_liner #ignore +nl_oc_msg_args = false # false/true #ignore + +# Add or remove newline between function signature and '{' +# NOTE: is 156 worse than ignore +nl_fdef_brace = add # ignore/add/remove/force + +# Add or remove a newline between the return keyword and return expression. +# NOTE: is 15 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 = 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 = 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 = 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 = false # false/true + +# Control the newline between the close brace and 'b' in: 'struct { int a; } b;' +# Affects enums, unions, and structures. If set to ignore, uses nl_after_brace_close +nl_brace_struct_var = remove # ignore/add/remove/force + +# Whether to alter newlines in '#define' macros +nl_define_macro = false # false/true + +# Whether to not put blanks after '#ifxx', '#elxx', or before '#endif' +nl_squeeze_ifdef = false # false/true + +# Add or remove blank line before 'if' +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 #force + +# Add or remove blank line before 'for' +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 #force + +# Add or remove blank line before 'while' +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 #force + +# Add or remove blank line before 'switch' +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 #force + +# Add or remove blank line before 'do' +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 #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 +# 'if(b)\n i++;' => 'if(b) i++;' +nl_create_if_one_liner = false # false/true + +# Change simple unbraced for statements into a one-liner +# 'for (i=0;i<5;i++)\n foo(i);' => 'for (i=0;i<5;i++) foo(i);' +nl_create_for_one_liner = false # false/true + +# Change simple unbraced while statements into a one-liner +# 'while (i<5)\n foo(i++);' => 'while (i<5) foo(i++);' +nl_create_while_one_liner = false # false/true + +# +# Positioning options +# + +# The position of arithmetic operators in wrapped expressions +pos_arith = lead # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force #force + +# The position of assignment in wrapped expressions. +# Do not affect '=' followed by '{' +pos_assign = trail # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force #force + +# The position of boolean operators in wrapped expressions +pos_bool = lead # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force #force + +# The position of comparison operators in wrapped expressions +pos_compare = lead # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force #force + +# The position of conditional (b ? t : f) operators in wrapped expressions +pos_conditional = lead # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force #force + +# The position of the comma in wrapped expressions +pos_comma = trail # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force #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/join/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/join/lead/lead_break/lead_force/trail/trail_break/trail_force + +# +# Line Splitting options +# + +# Try to limit code width to N number of columns +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 + +# Whether to split lines as close to code_width as possible and ignore some groupings +# WARNING: Code doesn't seem to use this feature - delete from the config? +ls_code_width = false # false/true + +# +# Blank line options +# + +# The maximum consecutive newlines +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 multi-line function body in a class declaration +# WARNING: Code doesn't seem to use this feature - delete from the config? +nl_after_func_body_class = 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: Best is not unique (0 1) +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 after '}' or ';' of a struct/enum/union definition +# WARNING: Code doesn't seem to use this feature - delete from the config? +nl_after_struct = 0 # number + +# The number of newlines after '}' or ';' of a class definition +# WARNING: Code doesn't seem to use this feature - delete from the config? +nl_after_class = 0 # number + +# 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. +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 + +# Add or remove newline between C# property and the '{' +# WARNING: Code doesn't seem to use this feature - delete from the config? +nl_property_brace = ignore # ignore/add/remove/force + +# Whether to remove blank lines after '{' +eat_blanks_after_open_brace = true # false/true #force + +# Whether to remove blank lines before '}' +eat_blanks_before_close_brace = true # false/true #force + +# How aggressively to remove extra newlines not in preproc. +# 0: No change +# 1: Remove most newlines not handled by other config +# 2: Remove all newlines and reformat completely by config +# ERROR: nl_remove_extra_newlines = 1 crashes with status 139. +# ERROR: nl_remove_extra_newlines = 2 crashes with status 139. +# WARNING: Best is not unique (0 indent_columns) +nl_remove_extra_newlines = 0 # number + +# Whether to put a blank line before 'return' statements, unless after an open brace. +nl_before_return = false # false/true #force + +# Whether to put a blank line after 'return' statements, unless followed by a close brace. +nl_after_return = false # false/true #force + +# Whether to put a newline after a Java annotation statement. +# Only affects annotations that are after a newline. +# WARNING: Code doesn't seem to use this feature - delete from the config? +nl_after_annotation = ignore # ignore/add/remove/force + +# Controls the newline between two annotations. +# WARNING: Code doesn't seem to use this feature - delete from the config? +nl_between_annotation = ignore # ignore/add/remove/force + +# +# Code modifying options (non-whitespace) +# + +# Add or remove braces on single-line 'do' statement +mod_full_brace_do = add # ignore/add/remove/force + +# Add or remove braces on single-line 'for' statement +# NOTE: is 5 worse than ignore +mod_full_brace_for = remove # ignore/add/remove/force + +# Add or remove braces on single-line function definitions. (Pawn) +mod_full_brace_function = ignore # ignore/add/remove/force #ignore + +# Add or remove braces on single-line 'if' statement. Will not remove the braces if they contain an 'else'. +mod_full_brace_if = add # 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 = true # false/true #force + +# Don't remove braces around statements that span N newlines +mod_full_brace_nl = 2 # number #force + +# Add or remove braces on single-line 'while' statement +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 +# NOTE: is 42 worse than ignore +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 +mod_remove_extra_semicolon = false # false/true + +# If a function body exceeds the specified number of newlines and doesn't have a comment after +# the close brace, a comment will be added. +mod_add_long_function_closebrace_comment = 0 # number + +# If a switch body exceeds the specified number of newlines and doesn't have a comment after +# the close brace, a comment will be added. +mod_add_long_switch_closebrace_comment = 0 # number + +# If an #ifdef body exceeds the specified number of newlines and doesn't have a comment after +# the #endif, a comment will be added. +mod_add_long_ifdef_endif_comment = 0 # number + +# If an #ifdef or #else body exceeds the specified number of newlines and doesn't have a comment after +# the #else, a comment will be added. +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. +mod_sort_include = false # false/true + +# If TRUE, it will move a 'break' that appears after a fully braced 'case' before the close brace. +# 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. +# NOTE: is 507 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 #force + +# +# Comment modifications +# + +# Try to wrap comments at cmt_width columns +cmt_width = 0 # number + +# Set the comment reflow mode (default: 0) +# 0: no reflowing (apart from the line wrapping due to cmt_width) +# 1: no touching at all +# 2: full reflow +# 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 = false # false/true + +# Whether to group c-comments that look like they are in a block +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 +# 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 + +# The filename that contains text to insert before a Obj-C message specification if the method isn't preceeded with a C/C++ comment. +# Will substitute $(message) with the function name and $(javaparam) with the javadoc @param and @return stuff. +cmt_insert_oc_msg_header = "" # string #ignore + +# 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_oc_msg_header, cmt_insert_func_header and cmt_insert_class_header. #ignore +# WARNING: Code doesn't seem to use this feature - delete from the config? +cmt_insert_before_preproc = false # false/true + +# +# Preprocessor options +# + +# 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. +# 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 +# NOTE: is 28 worse than ignore +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 +pp_if_indent_code = false # false/true + +# Whether to indent '#define' at the brace level (true) or from column 1 (false) +pp_define_at_level = true # false/true + +# You can force a token to be a type with the 'type' option. +# Example: +# type myfoo1 myfoo2 + +type void +type float +type vector +type entity +type string +type .void +type .float +type .vector +type .entity +type .string + +# +# You can create custom macro-based indentation using macro-open, +# macro-else and macro-close. +# Example: +# macro-open BEGIN_TEMPLATE_MESSAGE_MAP +# macro-open BEGIN_MESSAGE_MAP +# macro-close END_MESSAGE_MAP +# +# You can assign any keyword to any type with the set option. +# set func_call_user _ N_ + +# menu QC OO +macro-open CLASS +macro-else EXTENDS +macro-close ENDCLASS + +# translations +set func_call_user _ + +# +# The full syntax description of all custom definition config entries +# is shown below: +# +# define custom tokens as: +# - embed whitespace in token using '' escape character, or +# put token in quotes +# - these: ' " and ` are recognized as quote delimiters +# +# type token1 token2 token3 ... +# ^ optionally specify multiple tokens on a single line +# define def_token output_token +# ^ output_token is optional, then NULL is assumed +# macro-open token +# macro-close token +# macro-else token +# set id token1 token2 ... +# ^ optionally specify multiple tokens on a single line +# ^ id is one of the names in token_enum.h sans the CT_ prefix, +# e.g. PP_PRAGMA +# +# all tokens are separated by any mix of ',' commas, '=' equal signs +# and whitespace (space, tab) +# diff --git a/qcsrc/uncrustify.sh b/qcsrc/uncrustify.sh new file mode 100755 index 0000000000..2df39aa3a8 --- /dev/null +++ b/qcsrc/uncrustify.sh @@ -0,0 +1,22 @@ +fix_function_types() { + # Uncrustify handles QC function types (example: + # void(void) func; + # ) wrong and removes the space between type and variable. Fix this by + # a simple sed on ")letter" which should normally not occur. + sed -e 's/)\([A-Za-z0-9]\)/) \1/g' "$@" +} + +if [ -z "$UNCRUSTIFY_CONFIG" ]; then + UNCRUSTIFY_CONFIG=`git rev-parse --show-toplevel`/qcsrc/uncrustify.cfg +fi + +case "$#" in + 0) + uncrustify --frag -c "$UNCRUSTIFY_CONFIG" |\ + fix_function_types + ;; + *) + uncrustify --replace --no-backup -c "$UNCRUSTIFY_CONFIG" "$@" &&\ + fix_function_types -i "$@" + ;; +esac diff --git a/qcsrc/warpzonelib/client.qc b/qcsrc/warpzonelib/client.qc index 6f75612343..5370ba5198 100644 --- a/qcsrc/warpzonelib/client.qc +++ b/qcsrc/warpzonelib/client.qc @@ -25,7 +25,7 @@ void WarpZone_Read(float isnew) float f; warpzone_warpzones_exist = 1; - if not(self.enemy) + if (!self.enemy) { self.enemy = spawn(); self.enemy.classname = "warpzone_from"; diff --git a/qcsrc/warpzonelib/common.qc b/qcsrc/warpzonelib/common.qc index 386615247a..6db41d1339 100644 --- a/qcsrc/warpzonelib/common.qc +++ b/qcsrc/warpzonelib/common.qc @@ -113,7 +113,7 @@ float WarpZoneLib_BoxTouchesBrush_Recurse() return 0; } #endif - if not(trace_ent) + if (!trace_ent) return 0; if (trace_ent == WarpZoneLib_BoxTouchesBrush_ent) return 1; diff --git a/qcsrc/warpzonelib/server.qc b/qcsrc/warpzonelib/server.qc index 25bcd2901f..d25c769b08 100644 --- a/qcsrc/warpzonelib/server.qc +++ b/qcsrc/warpzonelib/server.qc @@ -56,7 +56,7 @@ float WarpZone_Teleport(entity wz, entity player, float f0, float f1) o10 = o1 = WarpZone_TransformOrigin(wz, o0); v1 = WarpZone_TransformVelocity(wz, v0); - if not(IS_NOT_A_CLIENT(player)) + if (!IS_NOT_A_CLIENT(player)) a1 = WarpZone_TransformVAngles(wz, player.v_angle); else a1 = WarpZone_TransformAngles(wz, a0); @@ -184,16 +184,16 @@ void WarpZone_Touch (void) save1 = self.target; self.target = string_null; save2 = self.target3; self.target3 = string_null; SUB_UseTargets(); - if not(self.target) self.target = save1; - if not(self.target3) self.target3 = save2; + if (!self.target) self.target = save1; + if (!self.target3) self.target3 = save2; oldself = self; self = self.enemy; save1 = self.target; self.target = string_null; save2 = self.target2; self.target2 = string_null; SUB_UseTargets(); - if not(self.target) self.target = save1; - if not(self.target2) self.target2 = save2; + if (!self.target) self.target = save1; + if (!self.target2) self.target2 = save2; self = oldself; } else @@ -348,15 +348,15 @@ float WarpZone_CheckProjectileImpact(entity player) save1 = self.target; self.target = string_null; save2 = self.target3; self.target3 = string_null; SUB_UseTargets(); - if not(self.target) self.target = save1; - if not(self.target3) self.target3 = save2; + if (!self.target) self.target = save1; + if (!self.target3) self.target3 = save2; self = self.enemy; save1 = self.target; self.target = string_null; save2 = self.target2; self.target2 = string_null; SUB_UseTargets(); - if not(self.target) self.target = save1; - if not(self.target2) self.target2 = save2; + if (!self.target) self.target = save1; + if (!self.target2) self.target2 = save2; self = oldself; } else @@ -537,7 +537,7 @@ void WarpZone_InitStep_UpdateTransform() for(i_s = 0; ; ++i_s) { tex = getsurfacetexture(self, i_s); - if not(tex) + if (!tex) break; // this is beyond the last one if(tex == "textures/common/trigger" || tex == "trigger") continue; @@ -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) diff --git a/tooltips.db.fr b/tooltips.db.fr index 34f0678066..2fc82b5b4f 100644 --- a/tooltips.db.fr +++ b/tooltips.db.fr @@ -1,78 +1,77 @@ 0 -\XonoticSingleplayerDialog\Jouer en mode un joueur contre des adversaires contrôlés par l'ordinateur +\XonoticSingleplayerDialog\Jouer tout seul contre des adversaires contrôlés par ordinateur -\XonoticMultiplayerDialog\Jouer en ligne avec des amis en réseau local ou sur Internet -\XonoticMultiplayerDialog/Serveurs\Trouver des serveurs pour y jouer dessus +\XonoticMultiplayerDialog\Jouer en ligne, en LAN avec vos amis, voir vos démos et modifier vos paramètres joueur +\XonoticMultiplayerDialog/Serveurs\Trouver des serveurs où jouer \menu_slist_showempty\Montrer les serveurs vides \menu_slist_showfull\Montrer les serveurs où toutes les places sont prises -\net_slist_pause\Ne met pas à jour la liste de serveurs pour éviter de "glisser" sur un autre serveur -\XonoticMultiplayerDialog/Info...\Montrer plus d'information sur le serveur séléctionné +\net_slist_pause\Ne pas mettre à jour la liste de serveurs pour éviter de "glisser" sur un autre serveur +\XonoticMultiplayerDialog/Info...\Montrer plus d'informations sur le serveur sélectionné \XonoticMultiplayerDialog/Marque-page\Mettre le serveur en haut de la liste pour pouvoir le repérer plus facilement plus tard \XonoticMultiplayerDialog/Créer\Héberger votre propre partie -\XonoticMultiplayerDialog/Vidéos\Regarder des Vidéos pré-enregistrées -\XonoticMultiplayerDialog/Player Setup\Personaliser vos paramètres +\XonoticMultiplayerDialog/Vidéos\Parcourir et regarder vos démos +\XonoticMultiplayerDialog/Player Setup\Personnaliser vos paramètres joueur -\XonoticTeamSelectDialog/join 'best' team (auto-select)\Auto-séléction de l'équipe qui a le plus besoin de vous (recommandé) -\XonoticTeamSelectDialog/rouge\Joindre l'équipe rouge -\XonoticTeamSelectDialog/bleu\Joindre l'équipe bleue -\XonoticTeamSelectDialog/jaune\Joindre l'équipe jaune -\XonoticTeamSelectDialog/rose\Joindre l'équipe rose +\XonoticTeamSelectDialog/join 'best' team (auto-select)\Auto-séléction de l'équipe (recommandé) +\XonoticTeamSelectDialog/rouge\Rejoindre l'équipe rouge +\XonoticTeamSelectDialog/bleu\Rejoindre l'équipe bleue +\XonoticTeamSelectDialog/jaune\Rejoindre l'équipe jaune +\XonoticTeamSelectDialog/rose\Rejoindre l'équipe rose -\timelimit_override\Limite de temps au match, le match se finit quand elle est atteinte -\fraglimit_override\Limite de tués pour le match, le match se finit quand elle est atteinte +\timelimit_override\Limite de temps, le match se termine lorsque celle-ci est atteinte +\fraglimit_override\Limite de frags pour le match, le match se termine lorsque celle-ci est atteinte \menu_maxplayers\Le nombre maximum de personnes pouvant jouer sur votre serveur en même temps -\bot_number\Nombre d'adversaires ordinateur +\bot_number\Nombre d'adversaires contrôlés par ordinateur \skill\Spécifier la difficulté des adversaires ordinateur \g_maplist_votable\Le nombre de cartes pouvant être votées à la fin du match -\sv_vote_simple_majority_factor\À partir de 51% de oui seulement, un vote est gagné -\XonoticMultiplayerDialog/Advanced settings...\Paramètres du serveur avancés -\XonoticMultiplayerDialog/Mutators...\Spéciales et arènes d'une seule arme -\g_dodging\Enable dodging +\sv_vote_simple_majority_factor\La majorité simple remporte un vote +\XonoticMultiplayerDialog/Advanced settings...\Paramètres serveur avancés +\XonoticMultiplayerDialog/Mutators...\Mutators et arènes avec une seule arme +\g_dodging\Activer les esquives \g_cloaked\Tous les joueurs sont presque invisibles -\g_footsteps\Activer les bruitages de pas -\g_midair\Il faut que votre adversaire soit en l'air pour lui faire mal -\g_vampire\Les dégâts faits à vos enemies vous font gagner de la santé -\g_bloodloss\Si vous avez moins de santé que spécifié ici, vous perdrez du sang et mourez progressivement -\sv_gravity\Vous tombez plus lentement, comme sur la lune +\g_footsteps\Activer les bruits de pas +\g_midair\Il faut que votre adversaire soit en l'air pour lui infliger des dégâts +\g_vampire\Les dégâts infligés à vos ennemis vous rendent la santé +\g_bloodloss\Si vous avez moins de santé que spécifié ici, vous perdrez du sang et mourrez progressivement +\sv_gravity\Vous tombez plus lentement, une valeur peu élevée correspond à une faible gravité \g_grappling_hook\Tous les joueurs ont un grappin \g_jetpack\Tous les joueurs ont un jetpack -\g_pinata\Tous les joueurs lâchent toutes leurs armes quand ils meurent -\g_weapon_stay\Les armes restent où elles sont quand elles sont prises sur la carte -\g_weaponarena\Séléctionner une arène d'une seule arme donne des munitions illimitées pour cette arme, et désactive toutes les autres armes -\menu_weaponarena_with_laser\Also enable the laser in the weapon arena -\g_minstagib\Tous les joueurs reçoivent un MinstaNex, qui est un sniper hyperpuissant qui tue d'un coup. Si vous n'avez plus de munitions, vous mourez progressivement. -\g_nix\No Items Xonotic; tous les joueurs ont la même arme en même temps, et on change d'arme régulièrement -\g_nix_with_laser\Porter le laser avec l'arme du No Items Xonotic -\XonoticMultiplayerDialog/Select all\Séléctionner toutes les cartes -\XonoticMultiplayerDialog/Select none\Déséléctionner toutes les cartes +\g_pinata\Les joueurs lâchent toutes leurs armes quand ils meurent +\g_weapon_stay\Les armes restent où elles sont lorsqu'elles sont ramassées +\g_weaponarena\Sélectionner une arène avec une seule arme fera apparaître les joueurs avec cette arme et des munitions illimitées, et désactive toutes les autres armes +\g_minstagib\Tous les joueurs reçoivent un Minstanex, qui est un fusil de précision d'une puissance infinie. Si vous êtes à court de munition, vous mourrez dans les 10 secondes à moins de parvenir à recharger votre arme. Le tir secondaire est un laser qui n'inflige aucun dégât et qui est utile pour sauter sur de longues distances. +\g_nix\No Items Xonotic - tous les joueurs jouent avec la même arme, et celle-ci change régulièrement. +\g_nix_with_laser\Autoriser le laser en plus de l'arme courante dans le mode Nix +\XonoticMultiplayerDialog/Select all\Sélectionner toutes les cartes +\XonoticMultiplayerDialog/Select none\Désélectionner toutes les cartes -\XonoticMultiplayerDialog/Test Performance\Faire un test de performance en utilisant la vidéo choisie +\XonoticMultiplayerDialog/Test Performance\Faire un test de performance en utilisant la démo sélectionnée \fov\Champ de vision en degrés, par défaut 90, certains joueurs préfèrent entre 110 et 130 -\cl_bobcycle\Effet de "tremblement" de la caméra en courant -\cl_zoomfactor\Facteur de Zoom -\cl_zoomsensitivity\Changer la sensitivité du Zoom: 0 est la plus basse, 1 ne comporte pas de changement par rapport au mode dézoomé -\cl_zoomspeed\Facteur "d'adoucissement" du Zoom, 0 désactive complètement +\cl_bobcycle\Effet de "tremblement" de la vue lorsque vous courez +\cl_zoomfactor\Facteur du zoom lorsque vous appuyez sur le bouton de zoom +\cl_zoomsensitivity\Changer la sensibilité du zoom : 0 est la valeur la plus basse, 1 correspond à l'absence de zoom +\cl_zoomspeed\Facteur "d'adoucissement" du zoom, 0 le désactive complètement \XonoticMultiplayerDialog/Weapon settings...\Paramétrer les armes (affichage, priorité) -\cl_weaponpriority_useforcycling\Utiliser la liste de priorité pour le changement d'armes à la molette -\cl_autoswitch\Automatiquement changer d'arme si vous avez une meilleure arme que celle que vous portez -\r_drawviewmodel\Afficher l'arme à la permière personne +\cl_weaponpriority_useforcycling\Utiliser la liste de priorité pour le changement d'armes avec la molette de la souris +\cl_autoswitch\Automatiquement changer d'arme si vous ramassez une meilleure arme que celle que vous portez +\r_drawviewmodel\Afficher l'arme à la première personne \cl_gunalign\Position de l'arme à l'écran, reconnection au serveur nécessaire pour prendre effet -\crosshair_per_weapon\Set a different crosshair for each weapon, good if you play without weapon models -\crosshair_color_per_weapon\Set the color of the crosshair depending on the weapon you are currently holding +\crosshair_per_weapon\Définir un viseur différent pour chaque arme, utile si vous jouez sans afficher l'arme +\crosshair_color_per_weapon\Définir la couleur du viseur selon l'arme que vous utilisez \crosshair_size\Ajuster la taille du viseur \crosshair_color_alpha\Ajuster l'opacité du viseur -\crosshair_color\Ajuster le couleur du viseur +\crosshair_color\Ajuster la couleur du viseur \sbar_hudselector\Utiliser l'ancienne interface HUD \XonoticMultiplayerDialog/Waypoints setup...\- \_cl_name\Pseudonyme utilisé pour vous reconnaître dans le jeu \XonoticSettingsDialog\Changer les paramètres du jeu -\XonoticCreditsDialog\Les Crédits de Xonotic +\XonoticCreditsDialog\Les crédits de Xonotic \XonoticTeamSelectDialog\- \XonoticMutatorsDialog\- \XonoticMapInfoDialog\- @@ -88,68 +87,69 @@ \XonoticQuitDialog/Non\'Faut que je fragge plus de monde! \XonoticSettingsDialog/Contrôles\Paramètres contrôle souris/clavier -\sensitivity\Sensitivité de la souris -\menu_mouse_speed\Sensitivité de la souris dans les menus, n'affecte pas le jeu -\m_filter\Adoucit le mouvement de souris, mais crée une légère latence de souris +\sensitivity\Sensibilité de la souris +\menu_mouse_speed\Sensibilité de la souris dans les menus, n'affecte pas le jeu +\m_filter\Adoucit le mouvement de souris, mais crée une légère latence \m_pitch\Inverser la souris sur l'axe vertical (mode jeu d'avion) \vid_dgamouse\Utiliser une souris DGA -\con_closeontoggleconsole\Autoriser la fermeture de console avec la touche d'ouverture de console (sinon, Shift+Échap) +\con_closeontoggleconsole\Permet de fermer la console avec le même raccourci utilisé pour l'ouvrir -\XonoticSettingsDialog/Vidéo\Video settings +\XonoticSettingsDialog/Vidéo\Paramètres vidéo \vid_width\Résolution de l'écran -\vid_bitsperpixel\Profondeur des couleurs: 16 bits est plus rapide, mais 32 bits est de meilleure qualité (recommandé) -\vid_fullscreen\Activer le mode plein écran (par défaut: activé) -\vid_vsync\Activer la syncronisation verticale pour éviter des problèmes d'affichage, limite le nombre maximum d'images par seconde (par défaut: désactivé) -\gl_texture_anisotropy\Qualité du filtrage anistrope (par défaut: 1x) -\r_glsl\Activer les Shaders OpenGL 2.0 pour des effets de lumière améliorés -\gl_vbo\Utiliser les VBOs pour stocker les modèles 3D statiques dans la mémoire pour une meilleure performance (par défaut: Points et Triangles) -\r_depthfirst\Éviter des problèmes de profondeur de rendu en faisant un rendu de profondeur de la carte/joueurs avant le rendu "standard" (par défaut: désactivé) -\gl_texturecompression\Compresser les textures pour économiser de la mémoire graphique (par défaut: aucun) -\gl_finish\Faire attendre le processeur que le rendu graphique se finisse pour éviter des problèmes d'affichage divers (par défaut: désactivé) -\v_brightness\Luminosité du noir (par défaut: 0) -\v_contrast\Luminosité du blanc (par défaut: 1) -\v_gamma\Correction du gamma ne changeant pas la luminosité du noir ou du blanc (par défaut: 1.125) -\v_contrastboost\Multiplier le constraste dans des salles sombres (par défaut: 1) -\r_glsl_saturation\Ajustement de la saturation (0 = noir et blanc, 1 = normal, 2 = saturé) des couleurs (par défaut: 1) -\v_glslgamma\Utiliser GLSL pour corriger le gamma, attention, cela risque d'augementer fortement l'utilisation de ressources (par défaut: désactivé) -\r_ambient\Lumière ambiente, si elle est trop élévée, les cartes auront un éclairage plus "plat" et moins contrasté -\r_hdr_scenebrightness\Éclairage du rendu global (par défaut: 1) -\vid_samples\Activer l'anticrénelage, réduit l'effet d'escalier sur les modèles 3D, mais augmente fortement l'utilisation des ressources -\v_flipped\Mode mirroir (par défaut: désactivé) +\vid_bitsperpixel\Profondeur des couleurs : 16 bits est plus rapide, mais 32 bits est de meilleure qualité (recommandé) +\vid_fullscreen\Activer le mode plein écran (par défaut : activé) +\vid_vsync\Activer la syncronisation verticale pour éviter des problèmes d'affichage, limite le nombre maximum d'images par seconde (par défaut : désactivé) +\gl_texture_anisotropy\Qualité du filtrage anistrope (par défaut : 1x) +\r_glsl\Activer les Shaders OpenGL 2.0 pour des effets de lumière améliorés (par défaut : désactivé) +\gl_vbo\Utiliser les VBOs pour stocker les modèles 3D statiques dans la mémoire pour une meilleure performance (par défaut : Points et Triangles) +\r_depthfirst\Éviter des problèmes de profondeur de rendu en faisant un rendu de profondeur de la carte/joueurs avant le rendu "standard" (par défaut : désactivé) +\gl_texturecompression\Compresser les textures pour économiser de la mémoire graphique (par défaut : aucun) +\gl_finish\Demander au processeur d'attendre la fin du rendu graphique afin éviter des problèmes d'affichage divers (par défaut : désactivé) +\v_brightness\Luminosité du noir (par défaut : 0) +\v_contrast\Luminosité du blanc (par défaut : 1) +\v_gamma\Correction du gamma n'affectant pas la luminosité du noir ou du blanc (par défaut : 1.125) +\v_contrastboost\Multiplier le constraste dans les salles sombres (par défaut : 1) +\r_glsl_saturation\Ajustement de la saturation (0 = noir et blanc, 1 = normal, 2 = saturé) des couleurs (par défaut : 1) +\v_glslgamma\Utiliser GLSL pour corriger le gamma, attention, cela risque d'augementer fortement l'utilisation de ressources (par défaut : désactivé) +\r_ambient\Lumière ambiante, si elle est trop élévée, les cartes auront un éclairage plus "plat" et moins contrasté (par défaut : 4) +\r_hdr_scenebrightness\Éclairage du rendu global (par défaut : 1) +\vid_samples\Activer l'anticrénelage, réduit l'effet d'escalier sur les modèles 3D, mais augmente fortement l'utilisation des ressources (par défaut : désactivé) +\v_flipped\Mode miroir (par défaut : désactivé) \XonoticSettingsDialog/Graphiques\Paramètres des effets graphiques -\r_subdivisions_tolerance\Ajuster la qualité des modèles 3D de carte (courbes, tuyaux) (par défaut: normal) -\gl_picmip\Ajuster la qualité des textures. La baisser diminue l'utilisation des ressources, mais rend les textures floues. (par défaut: normal) -\r_picmipworld\If set, only reduce the texture quality of models (default: enabled) -\mod_q3bsp_nolightmaps\Utiliser des lightmaps haute résolution, augmente l'utilisation des resources, mais rend les lightmaps plus nettes (par défaut: activé) -\cl_particles_quality\Nombre de particules; moins de particules consomment moins de ressources (par défaut: 1.0) -\r_drawparticles_drawdistance\Toutes les particules qui sont plus loin que cette distance ne seront pas affichées (par défaut: 1000) -\cl_decals\Activer les marques d'impacts et de sang (par défaut: activé) -\r_drawdecals_drawdistance\Toutes les marques d'impacts qui sont plus loin que cette distance ne seront pas affichées (par défaut: 300) -\cl_decals_time\Temps en secondes avant que les marques d'impacts disparaissent (par défaut: 2 secondes) -\cl_gentle\Remplacer les effets gore par des effets moins violents (par défaut: désactivé) -\cl_nogibs\Réduire le nombre de Gibs ou les désactiver totalement (par défaut: beaucoup) -\v_kicktime\Faire trembler la vue en recevant des dégâts (par défaut: 0) -\r_glsl_deluxemapping\Utiliser les effets lumineux avancés (par défaut: activé) -\r_shadow_gloss\Utiliser le reflet des textures (par défaut: activé) -\gl_flashblend\Enable faster but uglier dynamic lights by rendering bright coronas instead of real dynamic lights (default: disabled) -\r_shadow_realtime_dlight\Activer le rendu des lumières dynamiques en temps réel (par défaut: activé) -\r_shadow_realtime_dlight_shadows\Activer le rendu des ombres depuis les lumières dynamiques en temps réel (par défaut: désactivé) -\r_shadow_realtime_world\Activer le rendu des lumières carte en temps réel, a un gros impact sur la performance (par défaut: désactivé) -\r_shadow_realtime_world_shadows\Activer le rendu des ombres depuis les lumières carte en temps réel, a un impact sur la performance aussi (par défaut: désactivé) -\r_shadow_usenormalmap\Utiliser des effets d'ombrage de lumière sur les textures (par défaut: activé) -\r_showsurfaces\Désactiver les textures et les remplacer par des couleurs unies. Utile pour les configurations très faible, mais laid. (par défaut: désactivé) -\r_glsl_offsetmapping\Activer l'effet de relief sur les textures, a un léger impact sur la performance (par défaut: désactivé) -\r_glsl_offsetmapping_reliefmapping\Augmenter la qualité des effets de relief sur les textures, a un gros impact sur la performance (par défaut: désactivé) -\r_water\Activer des reflets de réflecion et de réfraction d'eau et des portails Warpzone (par défaut: désactivé) -\r_water_resolutionmultiplier\Qualité des reflets d'eau et des portails Warpzone, l'augmenter a un gros impact sur la performance (par défaut: bon) -\r_coronas\Activer des effets d'éblouissement peu gourmands (par défaut: activé) -\r_coronas_occlusionquery\Prendre en compte la visibilité pour les effets "Brillance Lumière" (par défaut: activé) -\r_bloom\Activer un effet d'éblouissement plus beau, mais gourmand (par défaut: désactivé) -\r_hdr\Activer un effet d'ébloissement encore plus beau, mais encore plus gourmand (par défaut: désactivé) +\r_subdivisions_tolerance\Ajuster la qualité des modèles 3D de la carte (courbes, tuyaux) (par défaut : normal) +\gl_picmip\Ajuster la qualité des textures. La baisser diminue l'utilisation des ressources, mais rend les textures floues. (par défaut : bon) +\r_picmipworld\Si activé, réduira uniquement la qualité des textures des joueurs (par défaut : activé) +\mod_q3bsp_nolightmaps\Utiliser des lightmaps haute résolution, augmente l'utilisation de la mémoire, mais rend les lightmaps plus nettes (par défaut : activé) +\cl_particles_quality\Nombre de particules ; moins de particules consomment moins de ressources (par défaut : 1) +\r_drawparticles_drawdistance\Toutes les particules situées au-delà de cette distance ne seront pas affichées (par défaut : 1000) +\cl_decals\Activer les marques d'impacts et de sang (par défaut : activé) +\r_drawdecals_drawdistance\Toutes les marques d'impacts qui sont plus loin que cette distance ne seront pas affichées (par défaut : 300) +\cl_decals_time\Durée en secondes avant que les marques d'impacts ne disparaissent (par défaut : 2) +\cl_gentle\Remplacer les effets gores par des effets moins violents (par défaut : désactivé) +\cl_nogibs\Réduire les effets gores ou les désactiver totalement (par défaut : beaucoup) +\v_kicktime\Faire trembler la vue lorsque vous êtes touché (durée par défaut : 0) +\r_glsl_deluxemapping\Utiliser les effets lumineux avancés (par défaut : activé) +\r_shadow_gloss\Utiliser le reflet des textures (par défaut : activé) +\gl_flashblend\Activer les lumières dynamiques rapides - mais plus laides - en affichant des couronnes de lumière à la place des vraies lumières dynamiques (par défaut : désactivé) +\r_shadow_realtime_dlight\Activer le rendu des lumières dynamiques des explosions et des roquettes (par défaut : activé) +\r_shadow_realtime_dlight_shadows\Activer le rendu des ombres depuis les lumières dynamiques en temps réel (par défaut : désactivé) +\r_shadow_realtime_world\Activer le rendu des lumières carte en temps réel, a un gros impact sur la performance (par défaut : désactivé) +\r_shadow_realtime_world_shadows\Activer le rendu des ombres depuis les lumières carte en temps réel (par défaut : désactivé) +\r_shadow_usenormalmap\Utiliser des effets d'ombrage de lumière sur les textures (par défaut : activé) +\r_showsurfaces\Désactiver les textures et les remplacer par des couleurs unies. Utile pour les configurations très légères, mais le rendu est très laid. (par défaut : désactivé) +\r_glsl_offsetmapping\Activer l'effet de relief sur les textures, a un léger impact sur la performance (par défaut : désactivé) +\r_glsl_offsetmapping_reliefmapping\Augmenter la qualité des effets de relief sur les textures, a un gros impact sur la performance (par défaut : désactivé) +\r_water\Qualité des reflets et de la réfraction de l'eau et des portails, a un gros impact sur la performance dans les cartes avec des surfaces réfléchissantes (par défaut : désactivé) +\r_water_resolutionmultiplier\Résolution des reflets/réfractions (par défaut : bon) +\r_coronas\Activer des effets d'éblouissement peu gourmands autour de certaines sources de lumière (par défaut : activé) +\r_coronas_occlusionquery\Estomper les effets d'éblouissement pour ne pas perdre en visibilité (par défaut : activé) +\r_bloom\Activer l'effet "bloom", qui éclaire les pixels situés au voisinage de pixels très brillants. A un gros impact sur la performance (par défaut : désactivé) +\r_hdr\Effet "bloom" de qualité encore supérieure, mais encore plus gourmand (par défaut : désactivé) \r_motionblur\Intensité du flou de mouvement - 0.4 est recommandé +\hud_postprocessing_maxbluralpha\Activer des effets de postprocessing spéciaux lorque vous êtes touché, lorsque vous êtes sous l'eau ou lorsque vous utilisez un bonus (par défaut : désactivé) -\XonoticSettingsDialog/Audio\Audio settings +\XonoticSettingsDialog/Audio\Paramètres audio \mastervolume\- \bgmvolume\- \snd_staticvolume\- @@ -162,40 +162,40 @@ \snd_channel1volume\- \snd_speed\Fréquence de la sortie audio \snd_channels\Nombre de canaux pour la sortie audio -\snd_swapstereo\Échanger les canneaux stéréo gauche/droite -\snd_spatialization_control\Essayer de diminuer le "constraste" entre la partie gauche et droite du casque audio pour un meilleur son -\cl_voice_directional\Activer les voix des personnages sur la carte -\cl_voice_directional_taunt_attenuation\Distance à laquelle les voix sont audibles -\cl_autotaunt\Automatiquement narguer les enemis quand vous les tuez -\cl_sound_maptime_warning\Voix (en anglais) qui vous dit le temps restant avant la fin du match -\cl_hitsound\Jouer un son quand vous touchez un enemi -\menu_sounds\Jouer des sons en cliquant ou en passant la souris sur des options - -\XonoticSettingsDialog/Réseau\Paramètres du jeu en réseau +\snd_swapstereo\Inverser les canaux stéréo gauche/droite +\snd_spatialization_control\Essayer de diminuer le "contraste" entre la partie gauche et droite du casque pour un meilleur son +\cl_voice_directional\Activer les voix directionnelles des personnages sur la carte +\cl_voice_directional_taunt_attenuation\Distance jusqu'à laquelle les voix demeurent audibles +\cl_autotaunt\Automatiquement narguer les ennemis lorsque vous les tuez +\cl_sound_maptime_warning\Voix (en anglais) qui annonce le temps restant avant la fin du match +\cl_hitsound\Jouer un son lorsque vous touchez un ennemi +\menu_sounds\Jouer des sons en cliquant ou en survolant des boutons + +\XonoticSettingsDialog/Réseau\Paramètres réseau \cl_movement\Activer la prédiction des mouvements du joueur pour éviter les saccades lors de parties en réseau \cl_nolerp\Algorithme pour éviter les saccades lors de parties en réseau -\shownetgraph\Show a graph of packet sizes and other information -\_cl_rate\Specify your network speed with this slider -\cl_netfps\Nombre maximum de paquets à envoyer au server chaque seconde -\cl_curl_maxdownloads\Nombre maximum de téléchargements simultanés -\cl_curl_maxspeed\Vitesse maximum de téléchargement -\cl_port\Forcer le client à passer par le port défini (UDP) s'il n'est pas 0 +\shownetgraph\Afficher la taille des paquets et d'autres informations dans un graphique +\_cl_rate\Spécifier la vitesse de votre réseau avec ce curseur +\cl_netfps\Nombre maximum de paquets à envoyer au serveur chaque seconde +\cl_curl_maxdownloads\Nombre maximum de téléchargements simultanés en HTTP/FTP +\cl_curl_maxspeed\Vitesse maximale de téléchargement +\cl_port\Forcer le client à passer par le port choisi sauf s'il est défini à 0 \XonoticSettingsDialog/Autres\Autres paramètres -\menu_tooltips\Menu tooltips: disabled, standard or advanced (also shows cvar or console command bound to the menu item) -\showtime\Montrer l'heure, utile pour les captures d'écran -\showdate\Montrer la date, utile pour les captures d'écran -\showfps\Montrer le nombre d'Images Par Seconde rendues (Frames Per Second = FPS) +\menu_tooltips\Info-bulles : désactivé, standard ou avancé (affiche aussi la cvar ou la commande associée) +\showtime\Afficher l'heure, utile pour les captures d'écran +\showdate\Afficher la date, utile pour les captures d'écran +\showfps\Afficher le nombre d'images par seconde actuel (FPS = Frames Per Second) \XonoticSettingsDialog/Advanced settings...\Paramètres avancés pour configuer le jeu dans ses moindres détails \g_friendlyfire\Pourcentage de dégâts infligés aux équipiers si vous les touchez \g_mirrordamage\Pourcentage de dégâts infligés aux équipiers qui vous sera renvoyé -\g_tdm_teams_override\Écraser le nombre d'équipes défini par la carte +\g_tdm_teams_override\Outrepasser le nombre d'équipes définies par la carte \viewsize\Enable/Désactiver l'arrière plan de l'interface -\cl_hidewaypoints\Montrer/Cacher les Waypoints (flèches 3D) -\g_waypointsprite_scale\Ajuster la taille des Waypoints -\g_waypointsprite_alpha\Ajuster l'opacité des Waypoints -\cl_shownames\Afficher le nom du joueur que vous pointez avec votre viseur +\cl_hidewaypoints\Afficher les waypoints (flèches 3D) +\g_waypointsprite_scale\Ajuster la taille des waypoints +\g_waypointsprite_alpha\Ajuster l'opacité des waypoints +\cl_shownames\Afficher le nom du joueur que vous avez dans votre viseur -\crosshair_hittest\Aucun: aucun effet de viseur - TrueAim: rendre le viseur flou si vous risquez de vous blesser vous même ou un équipier - Enemis: rendre le viseur plus grand si vous pouvez toucher un enemi +\crosshair_hittest\Aucun: aucun effet de viseur - TrueAim: rendre le viseur flou si vous risquez de tirer dans un mur - Ennemis: rendre le viseur plus grand si vous pouvez toucher un ennemi