From: terencehill Date: Fri, 7 Sep 2018 11:40:24 +0000 (+0200) Subject: Consistent indentation in player.qc X-Git-Tag: xonotic-v0.8.5~1900 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=51cf85e509fc393505091a160819ae3caad374e3;p=xonotic%2Fxonotic-data.pk3dir.git Consistent indentation in player.qc --- diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc index e211e16dd..6c64f2fea 100644 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@ -551,8 +551,8 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, if(this.classname != "body") Obituary (attacker, inflictor, this, deathtype, weaponentity); - // increment frag counter for used weapon type - Weapon w = DEATH_WEAPONOF(deathtype); + // increment frag counter for used weapon type + Weapon w = DEATH_WEAPONOF(deathtype); if(w != WEP_Null && accuracy_isgooddamage(attacker, this)) CS(attacker).accuracy.(accuracy_frags[w.m_id-1]) += 1; @@ -686,12 +686,12 @@ bool PlayerHeal(entity targ, entity inflictor, float amount, float limit) int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodcontrol) { if (!teamsay && !privatesay && substring(msgin, 0, 1) == " ") - msgin = substring(msgin, 1, -1); // work around DP say bug (say_team does not have this!) + msgin = substring(msgin, 1, -1); // work around DP say bug (say_team does not have this!) - if(source) + if (source) msgin = formatmessage(source, msgin); - string colorstr; + string colorstr; if (!(IS_PLAYER(source) || source.caplayer)) colorstr = "^0"; // black for spectators else if(teamplay) @@ -705,10 +705,10 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc if(game_stopped) teamsay = false; - if (!source) { + if (!source) { colorstr = ""; teamsay = false; - } + } if(msgin != "") msgin = trigger_magicear_processmessage_forallears(source, teamsay, privatesay, msgin); @@ -724,18 +724,17 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc } */ - string namestr = ""; - if (source) - namestr = playername(source, autocvar_g_chat_teamcolors); + string namestr = ""; + if (source) + namestr = playername(source, autocvar_g_chat_teamcolors); - string colorprefix = (strdecolorize(namestr) == namestr) ? "^3" : "^7"; + string colorprefix = (strdecolorize(namestr) == namestr) ? "^3" : "^7"; - string msgstr, cmsgstr; - string privatemsgprefix = string_null; - int privatemsgprefixlen = 0; - if (msgin == "") { - msgstr = cmsgstr = ""; - } else { + string msgstr = "", cmsgstr = ""; + string privatemsgprefix = string_null; + int privatemsgprefixlen = 0; + if (msgin != "") + { if(privatesay) { msgstr = strcat("\{1}\{13}* ", colorprefix, namestr, "^3 tells you: ^7"); @@ -767,10 +766,10 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc msgstr = strcat("\{1}^4* ", "^7", msgin); } else { - msgstr = "\{1}"; - msgstr = strcat(msgstr, (namestr != "") ? strcat(colorprefix, namestr, "^7: ") : "^7"); - msgstr = strcat(msgstr, msgin); - } + msgstr = "\{1}"; + msgstr = strcat(msgstr, (namestr != "") ? strcat(colorprefix, namestr, "^7: ") : "^7"); + msgstr = strcat(msgstr, msgin); + } cmsgstr = ""; } msgstr = strcat(strreplace("\n", " ", msgstr), "\n"); // newlines only are good for centerprint @@ -853,7 +852,7 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc source.(flood_field) = flood = 0; } - string sourcemsgstr, sourcecmsgstr; + string sourcemsgstr, sourcecmsgstr; if(flood == 2) // cannot happen for empty msgstr { if(autocvar_g_chat_flood_notify_flooder) @@ -888,7 +887,7 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc if(privatesay) sourcemsgstr = strcat(privatemsgprefix, substring(sourcemsgstr, privatemsgprefixlen, -1)); - int ret; + int ret; if(source && CS(source).muted) { // always fake the message @@ -942,7 +941,9 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc { sprint(source, sourcemsgstr); dedicated_print(msgstr); // send to server console too - FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != source && CS(it).active_minigame == CS(source).active_minigame && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), sprint(it, msgstr)); + FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != source && CS(it).active_minigame == CS(source).active_minigame && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), { + sprint(it, msgstr); + }); } else if(teamsay > 0) // team message, only sent to team mates { @@ -960,17 +961,21 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc { sprint(source, sourcemsgstr); dedicated_print(msgstr); // send to server console too - FOREACH_CLIENT(!(IS_PLAYER(it) || it.caplayer) && IS_REAL_CLIENT(it) && it != source && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), sprint(it, msgstr)); + FOREACH_CLIENT(!(IS_PLAYER(it) || it.caplayer) && IS_REAL_CLIENT(it) && it != source && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), { + sprint(it, msgstr); + }); } else { - if (source) { - sprint(source, sourcemsgstr); - dedicated_print(msgstr); // send to server console too - MX_Say(strcat(playername(source, true), "^7: ", msgin)); - } - FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != source && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), sprint(it, msgstr)); - } + if (source) { + sprint(source, sourcemsgstr); + dedicated_print(msgstr); // send to server console too + MX_Say(strcat(playername(source, true), "^7: ", msgin)); + } + FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != source && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), { + sprint(it, msgstr); + }); + } } return ret;