]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'martin-t/bits' into 'master'
authorterencehill <piuntn@gmail.com>
Fri, 25 Jan 2019 17:32:55 +0000 (17:32 +0000)
committerterencehill <piuntn@gmail.com>
Fri, 25 Jan 2019 17:32:55 +0000 (17:32 +0000)
Warn about bit ops

See merge request xonotic/xonotic-data.pk3dir!630

25 files changed:
.tx/merge-base
common.pt_BR.po
hud_luma.cfg
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_minimal_xhair.cfg
hud_luminos_old.cfg
hud_nexuiz.cfg
languages.txt
notifications.cfg
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/hud/panel/modicons.qc
qcsrc/client/hud/panel/pressedkeys.qc
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/common/effects/qc/damageeffects.qc
qcsrc/common/ent_cs.qc
qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc
qcsrc/common/mapinfo.qc
qcsrc/common/mapobjects/func/ladder.qc
qcsrc/common/notifications/all.inc
qcsrc/common/physics/player.qc
qcsrc/lib/csqcmodel/cl_player.qc
qcsrc/server/client.qc
qcsrc/server/command/getreplies.qc
qcsrc/server/teamplay.qc

index e21e87920aab30a85fdcffe8b91327fbfc40c4c2..6db991ba094f8479b8e3e39a297078b93d5fb17d 100644 (file)
@@ -1 +1 @@
-Sat Jan 12 07:24:11 CET 2019
+Tue Jan 15 07:24:12 CET 2019
index 7d293d946e27ae87b497f691e015d4b368175ec9..b9f8dcf7fdc13ffada0846a77da321103bee0c86 100644 (file)
@@ -4,7 +4,7 @@
 #
 # Translators:
 # Ivan Paulos Tomé <greylica@gmail.com>, 2016
-# Jean Trindade Pereira <jean_trindade2@hotmail.com>, 2018
+# Jean Trindade Pereira <jean_trindade2@hotmail.com>, 2018-2019
 # Mirio <opivy@hotmail.de>, 2017
 # NotThatPrivate Yes <henriqueferreira2009@gmail.com>, 2015
 # Ricardo Manuel da Cruz Coelho da Silva <ricardo.mccs@gmail.com>, 2015
@@ -14,7 +14,7 @@ msgstr ""
 "Project-Id-Version: Xonotic\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2018-12-13 15:42+0100\n"
-"PO-Revision-Date: 2018-12-19 09:40+0000\n"
+"PO-Revision-Date: 2019-01-15 02:59+0000\n"
 "Last-Translator: Jean Trindade Pereira <jean_trindade2@hotmail.com>\n"
 "Language-Team: Portuguese (Brazil) (http://www.transifex.com/team-xonotic/"
 "xonotic/language/pt_BR/)\n"
@@ -1837,7 +1837,7 @@ msgstr "Granada de armadilha"
 
 #: qcsrc/common/mutators/mutator/nades/nades.inc:74
 msgid "Veil grenade"
-msgstr ""
+msgstr "Granada de véu"
 
 #: qcsrc/common/mutators/mutator/nades/nades.qh:34
 msgid "Grenade"
@@ -3250,11 +3250,13 @@ msgstr ""
 msgid ""
 "^BG%s%s^K1 was riddled full of holes by ^BG%s^K1's Overkill Machine Gun%s%s"
 msgstr ""
+"^BG%s%s^K1 ficou cheio de buracos por causa da Metralhadora Suprema de ^BG"
+"%s^K1%s%s"
 
 #: qcsrc/common/notifications/all.inc:494
 #, c-format
 msgid "^BG%s%s^K1 has been vaporized by ^BG%s^K1's Overkill Nex%s%s"
-msgstr ""
+msgstr "^BG%s%s^K1 foi vaporizado pela Vortex Suprema de ^BG%s^K1%s%s"
 
 #: qcsrc/common/notifications/all.inc:495
 #, c-format
@@ -3262,29 +3264,31 @@ msgid ""
 "^BG%s%s^K1 was sawn in half by ^BG%s^K1's Overkill Rocket Propelled Chainsaw"
 "%s%s"
 msgstr ""
+"^BG%s%s^K1 foi serrado ao meio pelo Lança-motosserras Supremo de ^BG%s^K1%s%s"
 
 #: qcsrc/common/notifications/all.inc:496
 #, c-format
 msgid ""
 "^BG%s%s^K1 almost dodged ^BG%s^K1's Overkill Rocket Propelled Chainsaw%s%s"
-msgstr ""
+msgstr "^BG%s%s^K1 quase desviou do Lança-motosserras Supremo de ^BG%s^K1%s%s"
 
 #: qcsrc/common/notifications/all.inc:497
 #, c-format
 msgid ""
 "^BG%s^K1 was sawn in half by their own Overkill Rocket Propelled Chainsaw%s%s"
 msgstr ""
+"^BG%s^K1 foi serrado ao meio pelo seu próprio Lança-motosserras Supremo%s%s"
 
 #: qcsrc/common/notifications/all.inc:498
 #, c-format
 msgid ""
 "^BG%s^K1 blew themself up with their Overkill Rocket Propelled Chainsaw%s%s"
-msgstr ""
+msgstr "^BG%s^K1 se explodiu com seu próprio Lança-motosserras Supremo%s%s"
 
 #: qcsrc/common/notifications/all.inc:500
 #, c-format
 msgid "^BG%s%s^K1 was gunned down by ^BG%s^K1's Overkill Shotgun%s%s"
-msgstr ""
+msgstr "^BG%s%s^K1 foi baleado pela Escopeta Suprema de ^BG%s^K1%s%s"
 
 #: qcsrc/common/notifications/all.inc:501
 #, c-format
@@ -3334,12 +3338,12 @@ msgstr "^BG%s%s^K1 deu uns tapas em ^BG%s^K1 com uma grande Shockwave%s%s"
 #: qcsrc/common/notifications/all.inc:510
 #, c-format
 msgid "^BG%s%s^K1 was gunned down by ^BG%s^K1's Shotgun%s%s"
-msgstr "^BG%s%s^K1 foi baleado pela Shotgun de ^BG%s^K1%s%s"
+msgstr "^BG%s%s^K1 foi baleado pela Escopeta de ^BG%s^K1%s%s"
 
 #: qcsrc/common/notifications/all.inc:511
 #, c-format
 msgid "^BG%s%s^K1 slapped ^BG%s^K1 around a bit with a large Shotgun%s%s"
-msgstr "^BG%s%s^K1 deu uns tapas em ^BG%s^K1 com uma grande Shotgun%s%s"
+msgstr "^BG%s%s^K1 deu uns tapas em ^BG%s^K1 com uma grande Escopeta%s%s"
 
 #: qcsrc/common/notifications/all.inc:512
 #, c-format
@@ -4786,7 +4790,7 @@ msgstr "Shockwave"
 
 #: qcsrc/common/weapons/weapon/shotgun.qh:18
 msgid "Shotgun"
-msgstr "Shotgun"
+msgstr "Escopeta"
 
 #: qcsrc/common/weapons/weapon/tuba.qh:18
 #, no-c-format
@@ -8561,7 +8565,7 @@ msgstr "Exibir data e hora atual"
 
 #: qcsrc/menu/xonotic/dialog_settings_misc.qc:144
 msgid "Show current date and time of day, useful on screenshots"
-msgstr "Exibe a data e hora atual do dia, útil para capturas de tela"
+msgstr "Exibe a data e hora atual, útil para capturas de tela"
 
 #: qcsrc/menu/xonotic/dialog_settings_misc.qc:147
 msgid "Enable developer mode"
index 9dcfe0629a03a1e249d4b9f2e37f8e65f673b40e..813ecbaef0df64396789d8115bce2c758deaec4d 100644 (file)
@@ -207,7 +207,7 @@ seta hud_panel_pressedkeys_bg_color_team ""
 seta hud_panel_pressedkeys_bg_alpha ""
 seta hud_panel_pressedkeys_bg_border ""
 seta hud_panel_pressedkeys_bg_padding "1"
-seta hud_panel_pressedkeys_aspect "1.6"
+seta hud_panel_pressedkeys_aspect "1.8"
 seta hud_panel_pressedkeys_attack "0"
 
 seta hud_panel_chat_pos "0.010000 0.700000"
index 3f4fe39fabf84f5ca284a92daa19b42a20fefc30..c5cfe4ac548fdc62e070ac1cda9ed08d4a9c3524 100644 (file)
@@ -207,7 +207,7 @@ seta hud_panel_pressedkeys_bg_color_team ""
 seta hud_panel_pressedkeys_bg_alpha ""
 seta hud_panel_pressedkeys_bg_border ""
 seta hud_panel_pressedkeys_bg_padding ""
-seta hud_panel_pressedkeys_aspect "1.6"
+seta hud_panel_pressedkeys_aspect "1.8"
 seta hud_panel_pressedkeys_attack "0"
 
 seta hud_panel_chat_pos "0.010000 0.700000"
index 609ab766de832baf1f9824963913af9994403639..b7282584637aba28087bec61f8c071f5ac97df68 100644 (file)
@@ -207,7 +207,7 @@ seta hud_panel_pressedkeys_bg_color_team ""
 seta hud_panel_pressedkeys_bg_alpha ""
 seta hud_panel_pressedkeys_bg_border ""
 seta hud_panel_pressedkeys_bg_padding ""
-seta hud_panel_pressedkeys_aspect "1.6"
+seta hud_panel_pressedkeys_aspect "1.8"
 seta hud_panel_pressedkeys_attack "0"
 
 seta hud_panel_chat_pos "0 0.775000"
index b7a7d20ab2d69e566c2dec5bdcaa8bebd5d60d55..3bfd694b19cf2f0977c36c437ed7ee5c8220d5f9 100644 (file)
@@ -207,7 +207,7 @@ seta hud_panel_pressedkeys_bg_color_team ""
 seta hud_panel_pressedkeys_bg_alpha ""
 seta hud_panel_pressedkeys_bg_border ""
 seta hud_panel_pressedkeys_bg_padding ""
-seta hud_panel_pressedkeys_aspect "1.6"
+seta hud_panel_pressedkeys_aspect "1.8"
 seta hud_panel_pressedkeys_attack "0"
 
 seta hud_panel_chat_pos "0 0.775000"
index ce818681191a21abeec552cf46522a092028e9d9..c808f62fb5b10ca9f430153f3260821fc0280ff9 100644 (file)
@@ -207,7 +207,7 @@ seta hud_panel_pressedkeys_bg_color_team ""
 seta hud_panel_pressedkeys_bg_alpha ""
 seta hud_panel_pressedkeys_bg_border ""
 seta hud_panel_pressedkeys_bg_padding ""
-seta hud_panel_pressedkeys_aspect "1.6"
+seta hud_panel_pressedkeys_aspect "1.8"
 seta hud_panel_pressedkeys_attack "0"
 
 seta hud_panel_chat_pos "0.020000 0.780000"
index 4159b01c7ddcc1fa0107dc399a29512f554ef460..b0b02d080c6e6517407ca8706a8315bca9160f46 100644 (file)
@@ -207,7 +207,7 @@ seta hud_panel_pressedkeys_bg_color_team ""
 seta hud_panel_pressedkeys_bg_alpha ""
 seta hud_panel_pressedkeys_bg_border ""
 seta hud_panel_pressedkeys_bg_padding ""
-seta hud_panel_pressedkeys_aspect "1.6"
+seta hud_panel_pressedkeys_aspect "1.8"
 seta hud_panel_pressedkeys_attack "0"
 
 seta hud_panel_chat_pos "0 0.760000"
index 7887f4490c33030f1dd42bf7ac173c1a13ad1deb..03b1697ab0828263743c0452d0e3226008a6405a 100644 (file)
@@ -11,7 +11,7 @@ hu    "Hungarian" "Magyar" 51%
 nl    "Dutch" "Nederlands" 66%
 pl    "Polish" "Polski" 76%
 pt    "Portuguese" "Português" 91%
-pt_BR "Portuguese (Brazil)" "Português (Brasil)" 99%
+pt_BR "Portuguese (Brazil)" "Português (Brasil)" 100%
 ro    "Romanian" "Romana" 78%
 fi    "Finnish" "Suomi" 32%
 el    "Greek" "Ελληνική" 48%
index 07423e3aac74c1034b1587c1b69febcd78eae0d3..5e9cb3fcd843f2e5ddc0e96f75ce5d7a84f7569b 100644 (file)
@@ -235,7 +235,7 @@ seta notification_INFO_ITEM_WEAPON_PRIMORSEC "0" "0 = off, 1 = print to console,
 seta notification_INFO_ITEM_WEAPON_UNAVAILABLE "0" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_JETPACK_NOFUEL "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_JOIN_CONNECT "2" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
-seta notification_INFO_JOIN_PLAY "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_JOIN_PLAY "2" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_JOIN_PLAY_TEAM "2" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_KEEPAWAY_DROPPED "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_KEEPAWAY_PICKUP "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
@@ -245,7 +245,7 @@ seta notification_INFO_KEYHUNT_DROP "1" "0 = off, 1 = print to console, 2 = prin
 seta notification_INFO_KEYHUNT_LOST "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_KEYHUNT_PICKUP "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_KEYHUNT_PUSHED "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
-seta notification_INFO_LMS_FORFEIT "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_LMS_FORFEIT "2" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_LMS_NOLIVES "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_MINIGAME_INVITE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_MONSTERS_DISABLED "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
index 961fc77572d2faea847fbefc8f2ec4d614b01736..c33c271fa21d52306bd46d92dc093c5166970b3a 100644 (file)
@@ -441,7 +441,7 @@ void CSQCModel_AutoTagIndex_Apply(entity this)
                                                        LOG_TRACE("h_ model lacks weapon attachment, but v_ model is attached to it");
                                                }
                                        }
-                                       else if(this.tag_entity.isplayermodel)
+                                       else if((this.tag_entity.isplayermodel & ISPLAYER_MODEL))
                                        {
                                                skeleton_loadinfo(this.tag_entity);
                                                this.tag_index = this.tag_entity.bone_weapon;
@@ -606,7 +606,7 @@ void CSQCModel_Hook_PreDraw(entity this, bool isplayer)
        else
                this.drawmask = MASK_NORMAL;
 
-       if(this.isplayermodel && this.drawmask) // this checks if it's a player MODEL!
+       if((this.isplayermodel & ISPLAYER_MODEL) && this.drawmask) // this checks if it's a player MODEL!
        {
                CSQCPlayer_ModelAppearance_Apply(this, (this.isplayermodel & ISPLAYER_LOCAL));
                CSQCPlayer_LOD_Apply(this);
@@ -697,7 +697,7 @@ void CSQCModel_Hook_PreUpdate(entity this, bool isnew, bool isplayer, bool isloc
        this.iflags |= IFLAG_V_ANGLE_X;
        // revert to values from server
        CSQCModel_Effects_PreUpdate(this);
-       if(this.isplayermodel)
+       if((this.isplayermodel & ISPLAYER_MODEL))
        {
                if(!isplayer)
                        CSQCPlayer_FallbackFrame_PreUpdate(this);
@@ -713,7 +713,7 @@ void CSQCModel_Hook_PostUpdate(entity this, bool isnew, bool isplayer, bool islo
        this.isplayermodel = BITSET(this.isplayermodel, ISPLAYER_MODEL, is_playermodel);
 
        // save values set by server
-       if(this.isplayermodel)
+       if((this.isplayermodel & ISPLAYER_MODEL))
        {
                CSQCPlayer_ModelAppearance_PostUpdate(this);
                if(isplayer)
index 4d1691a7fd57798ac639b7023f6a04f81e476a36..f4e63043054b12a2a8a3d18105e9c0013ba7e64f 100644 (file)
@@ -41,8 +41,8 @@ void DrawCAItem(vector myPos, vector mySize, float aspect_ratio, int layout, int
 
        if(layout)
        {
-               drawpic_aspect_skin(myPos, pic, vec2(0.7 * mySize.x, mySize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-               drawstring_aspect(myPos + eX * 0.7 * mySize.x, ftos(stat), vec2(0.3 * mySize.x, mySize.y), color, panel_fg_alpha, DRAWFLAG_NORMAL);
+               drawpic_aspect_skin(myPos, pic, vec2(0.5 * mySize.x, mySize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+               drawstring_aspect(myPos + eX * 0.5 * mySize.x, ftos(stat), vec2(0.5 * mySize.x, mySize.y), color, panel_fg_alpha, DRAWFLAG_NORMAL);
        }
        else
                drawstring_aspect(myPos, ftos(stat), mySize, color, panel_fg_alpha, DRAWFLAG_NORMAL);
@@ -496,11 +496,16 @@ string race_status_name_prev;
 // Check if the given name already exist in race rankings? In that case, where? (otherwise return 0)
 int race_CheckName(string net_name)
 {
-       int i;
-       for (i=RANKINGS_CNT-1;i>=0;--i)
-               if(strdecolorize(grecordholder[i]) == strdecolorize(net_name))
-                       return i+1;
-       return 0;
+       int rank = 0;
+       string zoned_name = strzone(strdecolorize(entcs_GetName(player_localnum)));
+       for (int i = RANKINGS_CNT - 1; i >= 0; --i)
+               if (strdecolorize(grecordholder[i]) == zoned_name)
+               {
+                       rank = i + 1;
+                       break;
+               }
+       strfree(zoned_name);
+       return rank;
 }
 
 void race_showTime(string text, vector pos, vector timeText_ofs, float theTime, vector textSize, float f)
index b4da1dd7d69ce1e867524405b8dd53f9ecd6f0ce..0bf9b8dd0543c6f0cb1a59cb10592baccc093a4d 100644 (file)
@@ -52,21 +52,21 @@ void HUD_PressedKeys()
                mySize = newSize;
        }
 
-       vector keysize = vec2(mySize.x / 3, mySize.y / (3 - !autocvar_hud_panel_pressedkeys_attack));
+       vector keysize = vec2(mySize.x / (14/4), mySize.y / (3 - !autocvar_hud_panel_pressedkeys_attack));
        int pressedkeys = STAT(PRESSED_KEYS);
 
        if(autocvar_hud_panel_pressedkeys_attack)
        {
-               drawpic_aspect_skin(pos + eX * keysize.x * 0.5, ((pressedkeys & KEY_ATCK) ? "key_atck_inv.tga" : "key_atck.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-               drawpic_aspect_skin(pos + eX * keysize.x * 1.5, ((pressedkeys & KEY_ATCK2) ? "key_atck_inv.tga" : "key_atck.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+               drawpic_aspect_skin(pos + eX * (3/4 * keysize.x), ((pressedkeys & KEY_ATCK) ? "key_atck_inv.tga" : "key_atck.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+               drawpic_aspect_skin(pos + eX * (7/4 * keysize.x), ((pressedkeys & KEY_ATCK2) ? "key_atck2_inv.tga" : "key_atck2.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
                pos.y += keysize.y;
        }
 
        drawpic_aspect_skin(pos, ((pressedkeys & KEY_CROUCH) ? "key_crouch_inv.tga" : "key_crouch.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-       drawpic_aspect_skin(pos + eX * keysize.x, ((pressedkeys & KEY_FORWARD) ? "key_forward_inv.tga" : "key_forward.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-       drawpic_aspect_skin(pos + eX * keysize.x * 2, ((pressedkeys & KEY_JUMP) ? "key_jump_inv.tga" : "key_jump.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+       drawpic_aspect_skin(pos + eX * (5/4 * keysize.x), ((pressedkeys & KEY_FORWARD) ? "key_forward_inv.tga" : "key_forward.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+       drawpic_aspect_skin(pos + eX * (10/4 * keysize.x), ((pressedkeys & KEY_JUMP) ? "key_jump_inv.tga" : "key_jump.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
        pos.y += keysize.y;
-       drawpic_aspect_skin(pos, ((pressedkeys & KEY_LEFT) ? "key_left_inv.tga" : "key_left.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-       drawpic_aspect_skin(pos + eX * keysize.x, ((pressedkeys & KEY_BACKWARD) ? "key_backward_inv.tga" : "key_backward.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-       drawpic_aspect_skin(pos + eX * keysize.x * 2, ((pressedkeys & KEY_RIGHT) ? "key_right_inv.tga" : "key_right.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+       drawpic_aspect_skin(pos + eX * (1/4 * keysize.x), ((pressedkeys & KEY_LEFT) ? "key_left_inv.tga" : "key_left.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+       drawpic_aspect_skin(pos + eX * (5/4 * keysize.x), ((pressedkeys & KEY_BACKWARD) ? "key_backward_inv.tga" : "key_backward.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+       drawpic_aspect_skin(pos + eX * (9/4 * keysize.x), ((pressedkeys & KEY_RIGHT) ? "key_right_inv.tga" : "key_right.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
 }
index 4989aac508cdb221238a6593ad28fbfd677e7ccc..c48390bcdb0f4c2b9a0c4a6ade3a6cc01c7cec80 100644 (file)
@@ -74,52 +74,65 @@ bool autocvar_hud_panel_scoreboard_spectators_showping = true;
 bool autocvar_hud_panel_scoreboard_spectators_aligned = false;
 float autocvar_hud_panel_scoreboard_minwidth = 0.4;
 
-// wrapper to put all possible scores titles through gettext
-string TranslateScoresLabel(string l)
+// mode 0: returns translated label
+// mode 1: prints name and description of all the labels
+string Label_getInfo(string label, int mode)
 {
-       switch(l)
+       if (mode == 1)
+               label = "bckills"; // first case in the switch
+
+       switch(label)
        {
-               case "bckills": return CTX(_("SCO^bckills"));
-               case "bctime": return CTX(_("SCO^bctime"));
-               case "caps": return CTX(_("SCO^caps"));
-               case "captime": return CTX(_("SCO^captime"));
-               case "deaths": return CTX(_("SCO^deaths"));
-               case "destroyed": return CTX(_("SCO^destroyed"));
-               case "dmg": return CTX(_("SCO^damage"));
-               case "dmgtaken": return CTX(_("SCO^dmgtaken"));
-               case "drops": return CTX(_("SCO^drops"));
-               case "faults": return CTX(_("SCO^faults"));
-               case "fckills": return CTX(_("SCO^fckills"));
-               case "goals": return CTX(_("SCO^goals"));
-               case "kckills": return CTX(_("SCO^kckills"));
-               case "kdratio": return CTX(_("SCO^kdratio"));
-               case "kd": return CTX(_("SCO^k/d"));
-               case "kdr": return CTX(_("SCO^kdr"));
-               case "kills": return CTX(_("SCO^kills"));
-               case "teamkills": return CTX(_("SCO^teamkills"));
-               case "laps": return CTX(_("SCO^laps"));
-               case "lives": return CTX(_("SCO^lives"));
-               case "losses": return CTX(_("SCO^losses"));
-               case "name": return CTX(_("SCO^name"));
-               case "sum": return CTX(_("SCO^sum"));
-               case "nick": return CTX(_("SCO^nick"));
-               case "objectives": return CTX(_("SCO^objectives"));
-               case "pickups": return CTX(_("SCO^pickups"));
-               case "ping": return CTX(_("SCO^ping"));
-               case "pl": return CTX(_("SCO^pl"));
-               case "pushes": return CTX(_("SCO^pushes"));
-               case "rank": return CTX(_("SCO^rank"));
-               case "returns": return CTX(_("SCO^returns"));
-               case "revivals": return CTX(_("SCO^revivals"));
-               case "rounds": return CTX(_("SCO^rounds won"));
-               case "score": return CTX(_("SCO^score"));
-               case "suicides": return CTX(_("SCO^suicides"));
-               case "takes": return CTX(_("SCO^takes"));
-               case "ticks": return CTX(_("SCO^ticks"));
-               default: return l;
+               case "bckills":      if (!mode) return CTX(_("SCO^bckills"));      else LOG_INFO(strcat("^3", "bckills", "            ^7", _("Number of ball carrier kills")));
+               case "bctime":       if (!mode) return CTX(_("SCO^bctime"));       else LOG_INFO(strcat("^3", "bctime", "             ^7", _("Total amount of time holding the ball in Keepaway")));
+               case "caps":         if (!mode) return CTX(_("SCO^caps"));         else LOG_INFO(strcat("^3", "caps", "               ^7", _("How often a flag (CTF) or a key (KeyHunt) was captured")));
+               case "captime":      if (!mode) return CTX(_("SCO^captime"));      else LOG_INFO(strcat("^3", "captime", "            ^7", _("Time of fastest capture (CTF)")));
+               case "deaths":       if (!mode) return CTX(_("SCO^deaths"));       else LOG_INFO(strcat("^3", "deaths", "             ^7", _("Number of deaths")));
+               case "destroyed":    if (!mode) return CTX(_("SCO^destroyed"));    else LOG_INFO(strcat("^3", "destroyed", "          ^7", _("Number of keys destroyed by pushing them into void")));
+               case "dmg":          if (!mode) return CTX(_("SCO^damage"));       else LOG_INFO(strcat("^3", "dmg", "                ^7", _("The total damage done")));
+               case "dmgtaken":     if (!mode) return CTX(_("SCO^dmgtaken"));     else LOG_INFO(strcat("^3", "dmgtaken", "           ^7", _("The total damage taken")));
+               case "drops":        if (!mode) return CTX(_("SCO^drops"));        else LOG_INFO(strcat("^3", "drops", "              ^7", _("Number of flag drops")));
+               case "elo":          if (!mode) return CTX(_("SCO^elo"));          else LOG_INFO(strcat("^3", "elo", "                ^7", _("Player ELO")));
+               case "fastest":      if (!mode) return CTX(_("SCO^fastest"));      else LOG_INFO(strcat("^3", "fastest", "            ^7", _("Time of fastest lap (Race/CTS)")));
+               case "faults":       if (!mode) return CTX(_("SCO^faults"));       else LOG_INFO(strcat("^3", "faults", "             ^7", _("Number of faults committed")));
+               case "fckills":      if (!mode) return CTX(_("SCO^fckills"));      else LOG_INFO(strcat("^3", "fckills", "            ^7", _("Number of flag carrier kills")));
+               case "fps":          if (!mode) return CTX(_("SCO^fps"));          else LOG_INFO(strcat("^3", "fps", "                ^7", _("FPS")));
+               case "frags":        if (!mode) return CTX(_("SCO^frags"));        else LOG_INFO(strcat("^3", "frags", "              ^7", _("Number of kills minus suicides")));
+               case "goals":        if (!mode) return CTX(_("SCO^goals"));        else LOG_INFO(strcat("^3", "goals", "              ^7", _("Number of goals scored")));
+               case "kckills":      if (!mode) return CTX(_("SCO^kckills"));      else LOG_INFO(strcat("^3", "kckills", "            ^7", _("Number of keys carrier kills")));
+               case "kd":           if (!mode) return CTX(_("SCO^k/d"));          else LOG_INFO(strcat("^3", "kd", "                 ^7", _("The kill-death ratio")));
+               case "kdr":          if (!mode) return CTX(_("SCO^kdr"));          else LOG_INFO(strcat("^3", "kdr", "                ^7", _("The kill-death ratio")));
+               case "kdratio":      if (!mode) return CTX(_("SCO^kdratio"));      else LOG_INFO(strcat("^3", "kdratio", "            ^7", _("The kill-death ratio")));
+               case "kills":        if (!mode) return CTX(_("SCO^kills"));        else LOG_INFO(strcat("^3", "kills", "              ^7", _("Number of kills")));
+               case "laps":         if (!mode) return CTX(_("SCO^laps"));         else LOG_INFO(strcat("^3", "laps", "               ^7", _("Number of laps finished (Race/CTS)")));
+               case "lives":        if (!mode) return CTX(_("SCO^lives"));        else LOG_INFO(strcat("^3", "lives", "              ^7", _("Number of lives (LMS)")));
+               case "losses":       if (!mode) return CTX(_("SCO^losses"));       else LOG_INFO(strcat("^3", "losses", "             ^7", _("Number of times a key was lost")));
+               case "name":         if (!mode) return CTX(_("SCO^name"));         else LOG_INFO(strcat("^3", "name", "               ^7", _("Player name")));
+               case "nick":         if (!mode) return CTX(_("SCO^nick"));         else LOG_INFO(strcat("^3", "nick", "               ^7", _("Player name")));
+               case "objectives":   if (!mode) return CTX(_("SCO^objectives"));   else LOG_INFO(strcat("^3", "objectives", "         ^7", _("Number of objectives destroyed")));
+               case "pickups":      if (!mode) return CTX(_("SCO^pickups"));      else LOG_INFO(strcat("^3", "pickups", "            ^7", _("How often a flag (CTF) or a key (KeyHunt) or a ball (Keepaway) was picked up")));
+               case "ping":         if (!mode) return CTX(_("SCO^ping"));         else LOG_INFO(strcat("^3", "ping", "               ^7", _("Ping time")));
+               case "pl":           if (!mode) return CTX(_("SCO^pl"));           else LOG_INFO(strcat("^3", "pl", "                 ^7", _("Packet loss")));
+               case "pushes":       if (!mode) return CTX(_("SCO^pushes"));       else LOG_INFO(strcat("^3", "pushes", "             ^7", _("Number of players pushed into void")));
+               case "rank":         if (!mode) return CTX(_("SCO^rank"));         else LOG_INFO(strcat("^3", "rank", "               ^7", _("Player rank")));
+               case "returns":      if (!mode) return CTX(_("SCO^returns"));      else LOG_INFO(strcat("^3", "returns", "            ^7", _("Number of flag returns")));
+               case "revivals":     if (!mode) return CTX(_("SCO^revivals"));     else LOG_INFO(strcat("^3", "revivals", "           ^7", _("Number of revivals")));
+               case "rounds":       if (!mode) return CTX(_("SCO^rounds won"));   else LOG_INFO(strcat("^3", "rounds", "             ^7", _("Number of rounds won")));
+               case "score":        if (!mode) return CTX(_("SCO^score"));        else LOG_INFO(strcat("^3", "score", "              ^7", _("Total score")));
+               case "suicides":     if (!mode) return CTX(_("SCO^suicides"));     else LOG_INFO(strcat("^3", "suicides", "           ^7", _("Number of suicides")));
+               case "sum":          if (!mode) return CTX(_("SCO^sum"));          else LOG_INFO(strcat("^3", "sum", "                ^7", _("Number of kills minus deaths")));
+               case "takes":        if (!mode) return CTX(_("SCO^takes"));        else LOG_INFO(strcat("^3", "takes", "              ^7", _("Number of domination points taken (Domination)")));
+               case "teamkills":    if (!mode) return CTX(_("SCO^teamkills"));    else LOG_INFO(strcat("^3", "teamkills", "          ^7", _("Number of teamkills")));
+               case "ticks":        if (!mode) return CTX(_("SCO^ticks"));        else LOG_INFO(strcat("^3", "ticks", "              ^7", _("Number of ticks (Domination)")));
+               case "time":         if (!mode) return CTX(_("SCO^time"));         else LOG_INFO(strcat("^3", "time", "               ^7", _("Total time raced (Race/CTS)")));
+               default: return label;
        }
+       return label;
 }
 
+void PrintScoresLabels() { Label_getInfo(string_null, 1); }
+string TranslateScoresLabel(string label) { return Label_getInfo(label, 0); }
+
 void Scoreboard_InitScores()
 {
        int i, f;
@@ -306,41 +319,7 @@ void Cmd_Scoreboard_Help()
        LOG_INFO(_("The following field names are recognized (case insensitive):"));
        LOG_INFO("");
 
-       LOG_INFO(strcat("^3name^7                     ", _("Name of a player")));
-       LOG_INFO(strcat("^3nick^7                     ", _("Name of a player")));
-       LOG_INFO(strcat("^3ping^7                     ", _("Ping time")));
-       LOG_INFO(strcat("^3pl^7                       ", _("Packet loss")));
-       LOG_INFO(strcat("^3elo^7                      ", _("Player ELO")));
-       LOG_INFO(strcat("^3fps^7                      ", _("Player FPS")));
-       LOG_INFO(strcat("^3kills^7                    ", _("Number of kills")));
-       LOG_INFO(strcat("^3deaths^7                   ", _("Number of deaths")));
-       LOG_INFO(strcat("^3suicides^7                 ", _("Number of suicides")));
-       LOG_INFO(strcat("^3frags^7                    ", _("kills - suicides")));
-       LOG_INFO(strcat("^3teamkills^7                ", _("Number of teamkills")));
-       LOG_INFO(strcat("^3kd^7                       ", _("The kill-death ratio")));
-       LOG_INFO(strcat("^3dmg^7                      ", _("The total damage done")));
-       LOG_INFO(strcat("^3dmgtaken^7                 ", _("The total damage taken")));
-       LOG_INFO(strcat("^3sum^7                      ", _("kills - deaths")));
-       LOG_INFO(strcat("^3caps^7                     ", _("How often a flag (CTF) or a key (KeyHunt) was captured")));
-       LOG_INFO(strcat("^3pickups^7                  ", _("How often a flag (CTF) or a key (KeyHunt) or a ball (Keepaway) was picked up")));
-       LOG_INFO(strcat("^3captime^7                  ", _("Time of fastest cap (CTF)")));
-       LOG_INFO(strcat("^3fckills^7                  ", _("Number of flag carrier kills")));
-       LOG_INFO(strcat("^3returns^7                  ", _("Number of flag returns")));
-       LOG_INFO(strcat("^3drops^7                    ", _("Number of flag drops")));
-       LOG_INFO(strcat("^3lives^7                    ", _("Number of lives (LMS)")));
-       LOG_INFO(strcat("^3rank^7                     ", _("Player rank")));
-       LOG_INFO(strcat("^3pushes^7                   ", _("Number of players pushed into void")));
-       LOG_INFO(strcat("^3destroyed^7                ", _("Number of keys destroyed by pushing them into void")));
-       LOG_INFO(strcat("^3kckills^7                  ", _("Number of keys carrier kills")));
-       LOG_INFO(strcat("^3losses^7                   ", _("Number of times a key was lost")));
-       LOG_INFO(strcat("^3laps^7                     ", _("Number of laps finished (race/cts)")));
-       LOG_INFO(strcat("^3time^7                     ", _("Total time raced (race/cts)")));
-       LOG_INFO(strcat("^3fastest^7                  ", _("Time of fastest lap (race/cts)")));
-       LOG_INFO(strcat("^3ticks^7                    ", _("Number of ticks (DOM)")));
-       LOG_INFO(strcat("^3takes^7                    ", _("Number of domination points taken (DOM)")));
-       LOG_INFO(strcat("^3bckills^7                  ", _("Number of ball carrier kills")));
-       LOG_INFO(strcat("^3bctime^7                   ", _("Total amount of time holding the ball in Keepaway")));
-       LOG_INFO(strcat("^3score^7                    ", _("Total score")));
+       PrintScoresLabels();
        LOG_INFO("");
 
        LOG_INFO(_("Before a field you can put a + or - sign, then a comma separated list\n"
@@ -845,7 +824,7 @@ void Scoreboard_DrawItem(vector item_pos, vector rgb, entity pl, bool is_self, i
 {
        TC(bool, is_self); TC(int, pl_number);
        string str;
-       bool is_spec = (entcs_GetTeam(pl.sv_entnum) == NUM_SPECTATOR);
+       bool is_spec = entcs_IsSpectating(pl.sv_entnum);
 
        vector h_pos = item_pos;
        vector h_size = vec2(panel_size.x, hud_fontsize.y * 1.25);
@@ -1459,6 +1438,7 @@ vector Scoreboard_Rankings_Draw(vector pos, entity pl, vector rgb, vector bg_siz
        vector text_ofs = vec2(0.5 * hud_fontsize.x, (1.25 - 1) / 2 * hud_fontsize.y); // center text vertically
        string str = "";
        int column = 0, j = 0;
+       string zoned_name_self = strzone(strdecolorize(entcs_GetName(player_localnum)));
        for(i = 0; i < RANKINGS_RECEIVED_CNT; ++i)
        {
                float t;
@@ -1466,7 +1446,7 @@ vector Scoreboard_Rankings_Draw(vector pos, entity pl, vector rgb, vector bg_siz
                if (t == 0)
                        continue;
 
-               if(strdecolorize(grecordholder[i]) == strdecolorize(entcs_GetName(player_localnum)))
+               if(strdecolorize(grecordholder[i]) == zoned_name_self)
                        drawfill(pos, columnsize, hl_rgb, sbt_highlight_alpha_self, DRAWFLAG_NORMAL);
                else if(!((j + column) & 1) && sbt_highlight)
                        drawfill(pos, columnsize, hl_rgb, sbt_highlight_alpha, DRAWFLAG_NORMAL);
@@ -1489,6 +1469,7 @@ vector Scoreboard_Rankings_Draw(vector pos, entity pl, vector rgb, vector bg_siz
                        pos.y = panel_pos.y;
                }
        }
+       strfree(zoned_name_self);
 
        panel_size.x += panel_bg_padding * 2; // restore initial width
        return end_pos;
index 7ab6697c34830a8a19d6874912c0c83681081cc4..9090977dad3a25a6fa894c00fe8c619905712db6 100644 (file)
@@ -78,7 +78,7 @@ void DamageEffect_Think(entity this)
                return;
        }
        this.state = this.owner.csqcmodel_isdead;
-       if(this.owner.isplayermodel && (this.owner.isplayermodel & ISPLAYER_LOCAL) && !autocvar_chase_active)
+       if((this.owner.isplayermodel & ISPLAYER_LOCAL) && !autocvar_chase_active)
                return; // if we aren't using a third person camera, hide our own effects
 
        // now generate the particles
@@ -153,7 +153,7 @@ void DamageEffect(entity this, vector hitorg, float thedamage, int type, int spe
 
        if(substring(effectname, strlen(effectname) - 5, 5) == "BLOOD")
        {
-               if(this.isplayermodel)
+               if((this.isplayermodel & ISPLAYER_MODEL))
                {
                        specstr = species_prefix(specnum);
                        specstr = substring(specstr, 0, strlen(specstr) - 1);
@@ -250,7 +250,7 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew)
 
                DamageEffect(it, w_org, thisdmg, w_deathtype, species);
 
-               if(it.isplayermodel)
+               if((it.isplayermodel & ISPLAYER_MODEL))
                        hitplayer = true; // this impact damaged a player
        });
 
index 7b4c54f9f6b16271fa584a917e72ddcff139b7fc..36b8b587edea078fec656450ba5bb8acd1259383 100644 (file)
@@ -19,8 +19,7 @@ STATIC_INIT(RegisterEntCSProps_renumber) { FOREACH(EntCSProps, true, it.m_id = i
 .void(entity ent) m_receive;
 
 #ifdef SVQC
-#define ENTCS_PROP(id, ispublic, checkprop, setprop, svsend, clreceive) \
-       bool id##_check(entity ent, entity player) { return (ent.(checkprop) != player.(checkprop)); } \
+#define _ENTCS_PROP(id, ispublic, checkprop, setprop, svsend, clreceive) \
        void id##_set(entity ent, entity player) { setprop(ent.(checkprop), player.(checkprop)); } \
        void id##_send(int chan, entity ent) { LAMBDA(svsend); } \
        REGISTER(EntCSProps, ENTCS_PROP, id, m_id, new_pure(entcs_prop)) { \
@@ -29,6 +28,17 @@ STATIC_INIT(RegisterEntCSProps_renumber) { FOREACH(EntCSProps, true, it.m_id = i
                this.m_set = id##_set; \
                this.m_send = id##_send; \
        }
+
+#define ENTCS_PROP(id, ispublic, checkprop, setprop, svsend, clreceive) \
+       bool id##_check(entity ent, entity player) { return (ent.(checkprop) != player.(checkprop)); } \
+       _ENTCS_PROP(id, ispublic, checkprop, setprop, svsend, clreceive)
+
+#define ENTCS_PROP_CODED(id, ispublic, checkprop, setprop, decfactor, svsend, clreceive) \
+       bool id##_check(entity ent, entity player) { \
+               return (floor(ent.(checkprop)) / decfactor != floor(player.(checkprop)) * decfactor); \
+       } \
+       _ENTCS_PROP(id, ispublic, checkprop, setprop, svsend, clreceive)
+
 #elif defined(CSQC)
 #define ENTCS_PROP(id, ispublic, checkprop, setprop, svsend, clreceive) \
        void id##_receive(entity ent) { LAMBDA(clreceive); } \
@@ -36,11 +46,16 @@ STATIC_INIT(RegisterEntCSProps_renumber) { FOREACH(EntCSProps, true, it.m_id = i
                this.m_public = ispublic; \
                this.m_receive = id##_receive; \
        }
+
+#define ENTCS_PROP_CODED(id, ispublic, checkprop, setprop, decfactor, svsend, clreceive) \
+       ENTCS_PROP(id, ispublic, checkprop, setprop, svsend, clreceive)
 #endif
 
 #ifdef SVQC
-#define ENTCS_PROP_RESOURCE(id, ispublic, checkprop, setprop, svsend, clreceive) \
-       bool id##_check(entity ent, entity player) { return (GetResourceAmount(ent, checkprop) != GetResourceAmount(player, checkprop)); } \
+#define ENTCS_PROP_RESOURCE(id, ispublic, checkprop, setprop, decfactor, svsend, clreceive) \
+       bool id##_check(entity ent, entity player) { \
+               return (floor(GetResourceAmount(ent, checkprop) / decfactor) != floor(GetResourceAmount(player, checkprop) / decfactor)); \
+       } \
        void id##_set(entity ent, entity player) { SetResourceAmountExplicit(ent, checkprop, GetResourceAmount(player, checkprop)); } \
        void id##_send(int chan, entity ent) { LAMBDA(svsend); } \
        REGISTER(EntCSProps, ENTCS_PROP, id, m_id, new_pure(entcs_prop)) { \
@@ -50,7 +65,7 @@ STATIC_INIT(RegisterEntCSProps_renumber) { FOREACH(EntCSProps, true, it.m_id = i
                this.m_send = id##_send; \
        }
 #elif defined(CSQC)
-#define ENTCS_PROP_RESOURCE(id, ispublic, checkprop, setprop, svsend, clreceive) \
+#define ENTCS_PROP_RESOURCE(id, ispublic, checkprop, setprop, decfactor, svsend, clreceive) \
        void id##_receive(entity ent) { LAMBDA(clreceive); } \
        REGISTER(EntCSProps, ENTCS_PROP, id, m_id, new_pure(entcs_prop)) { \
                this.m_public = ispublic; \
@@ -73,17 +88,22 @@ ENTCS_PROP(ORIGIN, false, origin, ENTCS_SET_NORMAL,
        { WriteVector(chan, ent.origin); },
        { ent.has_sv_origin = true; vector v = ReadVector(); setorigin(ent, v); })
 
-ENTCS_PROP(ANGLES, false, angles_y, ENTCS_SET_NORMAL,
-       { WriteByte(chan, ent.angles.y / 360 * 256); },
-       { vector v = '0 0 0'; v.y = ReadByte() / 256 * 360; ent.angles = v; })
-
-ENTCS_PROP_RESOURCE(HEALTH, false, RESOURCE_HEALTH, ENTCS_SET_NORMAL,
-       { WriteByte(chan, bound(0, GetResourceAmount(ent, RESOURCE_HEALTH) / 10, 255));  /* FIXME: use a better scale? */ },
-       { ent.healthvalue = ReadByte() * 10; })
-
-ENTCS_PROP_RESOURCE(ARMOR, false, RESOURCE_ARMOR, ENTCS_SET_NORMAL,
-       { WriteByte(chan, bound(0, GetResourceAmount(ent, RESOURCE_ARMOR) / 10, 255));  /* FIXME: use a better scale? */ },
-       { SetResourceAmountExplicit(ent, RESOURCE_ARMOR, ReadByte() * 10); })
+#define DEC_FACTOR (360 / 256)
+ENTCS_PROP_CODED(ANGLES, false, angles_y, ENTCS_SET_NORMAL, DEC_FACTOR,
+       { WriteByte(chan, ent.angles.y / DEC_FACTOR); },
+       { vector v = '0 0 0'; v.y = ReadByte() * DEC_FACTOR; ent.angles = v; })
+#undef DEC_FACTOR
+
+// FIXME: use a better scale?
+#define DEC_FACTOR 10
+ENTCS_PROP_RESOURCE(HEALTH, false, RESOURCE_HEALTH, ENTCS_SET_NORMAL, DEC_FACTOR,
+       { WriteByte(chan, bound(0, GetResourceAmount(ent, RESOURCE_HEALTH) / DEC_FACTOR, 255)); },
+       { ent.healthvalue = ReadByte() * DEC_FACTOR; })
+
+ENTCS_PROP_RESOURCE(ARMOR, false, RESOURCE_ARMOR, ENTCS_SET_NORMAL, DEC_FACTOR,
+       { WriteByte(chan, bound(0, GetResourceAmount(ent, RESOURCE_ARMOR) / DEC_FACTOR, 255)); },
+       { SetResourceAmountExplicit(ent, RESOURCE_ARMOR, ReadByte() * DEC_FACTOR); })
+#undef DEC_FACTOR
 
 ENTCS_PROP(NAME, true, netname, ENTCS_SET_MUTABLE_STRING,
        { WriteString(chan, ent.netname); },
index 2bbed4a9abb78f5cb8fd73ecbdf5d9a9a68474f7..cdcb0d0d0fbedd16efa54e6a36f4d224f3a011a2 100644 (file)
@@ -421,7 +421,8 @@ MUTATOR_HOOKFUNCTION(ca, SpectateNext)
 {
        entity client = M_ARGV(0, entity);
 
-       if (!autocvar_g_ca_spectate_enemies && client.caplayer)
+       if (!autocvar_g_ca_spectate_enemies && client.caplayer
+               && Team_GetNumberOfAlivePlayers(Entity_GetTeam(client)))
        {
                entity targ = M_ARGV(1, entity);
                M_ARGV(1, entity) = CA_SpectateNext(client, targ);
@@ -435,7 +436,8 @@ MUTATOR_HOOKFUNCTION(ca, SpectatePrev)
        entity targ = M_ARGV(1, entity);
        entity first = M_ARGV(2, entity);
 
-       if (!autocvar_g_ca_spectate_enemies && client.caplayer)
+       if (!autocvar_g_ca_spectate_enemies && client.caplayer
+               && Team_GetNumberOfAlivePlayers(Entity_GetTeam(client)))
        {
                do { targ = targ.chain; }
                while(targ && DIFF_TEAM(targ, client));
@@ -448,6 +450,8 @@ MUTATOR_HOOKFUNCTION(ca, SpectatePrev)
                                return MUT_SPECPREV_RETURN;
                }
        }
+       else
+               return MUT_SPECPREV_CONTINUE;
 
        M_ARGV(1, entity) = targ;
 
index 68c548aaef9ea5034a7b1914c6aa056c905e931a..8c381fb6067bd9cd29c9b362f7dd287ecaafeb99 100644 (file)
 #endif
 
 bool autocvar_g_mapinfo_ignore_warnings;
+#ifdef MENUQC
+#define WARN_COND !autocvar_g_mapinfo_ignore_warnings
+#else
+#define WARN_COND (!autocvar_g_mapinfo_ignore_warnings && MapInfo_Map_bspname == mi_shortname)
+#endif
 
 // generic string stuff
 
@@ -528,7 +533,7 @@ void _MapInfo_Map_ApplyGametypeEx(string s, Gametype pWantedType, Gametype pThis
                if (sa == "") continue;
                int p = strstrofs(sa, "=", 0);
                if (p < 0) {
-                       if(!autocvar_g_mapinfo_ignore_warnings)
+                       if(WARN_COND)
                                LOG_WARNF("Invalid gametype setting in mapinfo for gametype %s: %s", MapInfo_Type_ToString(pWantedType), sa);
                        continue;
                }
@@ -568,7 +573,7 @@ void _MapInfo_Map_ApplyGametypeEx(string s, Gametype pWantedType, Gametype pThis
                        }
                }
                FOREACH(Gametypes, true, handled |= it.m_parse_mapinfo(k, v));
-               if (!handled && !autocvar_g_mapinfo_ignore_warnings)
+               if (!handled && WARN_COND)
             LOG_WARNF("Invalid gametype setting in mapinfo for gametype %s: %s", MapInfo_Type_ToString(pWantedType), sa);
        }
 
@@ -589,7 +594,7 @@ Gametype MapInfo_Type_FromString(string t)
 #define deprecate(from, to) MACRO_BEGIN { \
        if (t == #from) { \
                string replacement = #to; \
-               if(!autocvar_g_mapinfo_ignore_warnings) \
+               if(WARN_COND) \
                        LOG_WARNF("MapInfo_Type_FromString (probably %s): using deprecated name '%s'. Should use '%s'.", MapInfo_Map_bspname, t, replacement); \
                t = replacement; \
        } \
@@ -660,7 +665,8 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s,
                {
                        fh = fopen(s, FILE_READ);
                        if(fh < 0)
-                               LOG_WARN("Map ", pFilename, " references not existing config file ", s);
+                               if(WARN_COND)
+                                       LOG_WARN("Map ", pFilename, " references not existing config file ", s);
                        else
                        {
                                for (;;)
@@ -688,19 +694,22 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s,
                                fclose(fh);
                        }
                }
-               else
+               else if(WARN_COND)
                        LOG_WARN("Map ", pFilename, " uses too many levels of inclusion");
        }
-       else if(t == "")
-               LOG_WARN("Map ", pFilename, " contains a potentially harmful setting, ignored");
-       else if (!cvar_value_issafe(t))
-               LOG_WARN("Map ", pFilename, " contains a potentially harmful setting, ignored");
-       else if (!cvar_value_issafe(s))
-               LOG_WARN("Map ", pFilename, " contains a potentially harmful setting, ignored");
-       else if(matchacl(MAPINFO_SETTEMP_ACL_SYSTEM, t) <= 0)
-               LOG_WARN("Map ", pFilename, " contains a potentially harmful setting, ignored");
+       else if(t == ""
+               || !cvar_value_issafe(t)
+               || !cvar_value_issafe(s)
+               || matchacl(MAPINFO_SETTEMP_ACL_SYSTEM, t) <= 0)
+       {
+               if (WARN_COND)
+                       LOG_WARN("Map ", pFilename, " contains a potentially harmful setting, ignored");
+       }
        else if(matchacl(acl, t) <= 0)
-               LOG_WARN("Map ", pFilename, " contains a denied setting, ignored");
+       {
+               if (WARN_COND)
+                       LOG_WARN("Map ", pFilename, " contains a denied setting, ignored");
+       }
        else
        {
                if(type == 0) // server set
@@ -850,7 +859,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, Gamet
                                error("... but I just wrote it!");
                }
 
-               if(!autocvar_g_mapinfo_ignore_warnings)
+               if(WARN_COND)
                        LOG_WARN("autogenerated mapinfo file ", fn, " has been loaded; please edit that file and move it to maps/", pFilename, ".mapinfo");
        }
 
@@ -889,7 +898,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, Gamet
                        else if(t == "vehicles") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_VEHICLES;
                        else if(t == "monsters") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_MONSTERS;
                        else if(t == "new_toys") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_WEAPONS;
-                       else
+                       else if(WARN_COND)
                                LOG_WARN("Map ", pFilename, " supports unknown feature ", t, ", ignored");
                }
                else if(t == "hidden")
@@ -917,11 +926,11 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, Gamet
                {
                        t = car(s); s = cdr(s);
                        Gametype f = MapInfo_Type_FromString(t);
-                       //if(!autocvar_g_mapinfo_ignore_warnings)
+                       //if(WARN_COND)
                                //LOG_WARN("Map ", pFilename, " contains the legacy 'type' keyword which is deprecated and will be removed in the future. Please migrate the mapinfo file to 'gametype'.");
                        if(f)
                                _MapInfo_Map_ApplyGametype (s, pGametypeToSet, f, true);
-                       else if(!autocvar_g_mapinfo_ignore_warnings)
+                       else if(WARN_COND)
                                LOG_DEBUG("Map ", pFilename, " supports unknown game type ", t, ", ignored");
                }
                else if(t == "gametype")
@@ -930,7 +939,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, Gamet
                        Gametype f = MapInfo_Type_FromString(t);
                        if(f)
                                _MapInfo_Map_ApplyGametypeEx (s, pGametypeToSet, f);
-                       else if(!autocvar_g_mapinfo_ignore_warnings)
+                       else if(WARN_COND)
                                LOG_DEBUG("Map ", pFilename, " supports unknown game type ", t, ", ignored");
                }
                else if(t == "size")
@@ -942,16 +951,19 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, Gamet
                        t = car(s); s = cdr(s); d = stof(t);
                        t = car(s); s = cdr(s); e = stof(t);
                        if(s == "")
-                               LOG_WARN("Map ", pFilename, " contains an incorrect size line (not enough params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z");
+                               if(WARN_COND)
+                                       LOG_WARN("Map ", pFilename, " contains an incorrect size line (not enough params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z");
                        else
                        {
                                t = car(s); s = cdr(s); f = stof(t);
                                if(s != "")
-                                       LOG_WARN("Map ", pFilename, " contains an incorrect size line (too many params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z");
+                                       if(WARN_COND)
+                                               LOG_WARN("Map ", pFilename, " contains an incorrect size line (too many params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z");
                                else
                                {
                                        if(a >= d || b >= e || c >= f)
-                                               LOG_WARN("Map ", pFilename, " contains an incorrect size line, mins have to be < maxs");
+                                               if(WARN_COND)
+                                                       LOG_WARN("Map ", pFilename, " contains an incorrect size line, mins have to be < maxs");
                                        else
                                        {
                                                MapInfo_Map_mins.x = a;
@@ -1001,7 +1013,8 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, Gamet
                else if(t == "fog")
                {
                        if (!cvar_value_issafe(s))
-                               LOG_WARN("Map ", pFilename, " contains a potentially harmful fog setting, ignored");
+                               if(WARN_COND)
+                                       LOG_WARN("Map ", pFilename, " contains a potentially harmful fog setting, ignored");
                        else
                                MapInfo_Map_fog = s;
                }
@@ -1017,14 +1030,15 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, Gamet
                        if(pGametypeToSet)
                        {
                                if (!cvar_value_issafe(t))
-                                       LOG_WARN("Map ", pFilename, " contains a potentially harmful cdtrack, ignored");
+                                       if(WARN_COND)
+                                               LOG_WARN("Map ", pFilename, " contains a potentially harmful cdtrack, ignored");
                                else
                                        MapInfo_Map_clientstuff = strcat(
                                                MapInfo_Map_clientstuff, "cd loop \"", t, "\"\n"
                                        );
                        }
                }
-               else if(!autocvar_g_mapinfo_ignore_warnings)
+               else if(WARN_COND)
                        LOG_WARN("Map ", pFilename, " provides unknown info item ", t, ", ignored");
        }
        fclose(fh);
@@ -1039,7 +1053,8 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, Gamet
        MapInfo_Cache_Store();
        if(MapInfo_Map_supportedGametypes != 0)
                return r;
-       LOG_WARN("Map ", pFilename, " supports no game types, ignored");
+       if (WARN_COND)
+               LOG_WARN("Map ", pFilename, " supports no game types, ignored");
        return 0;
 }
 int MapInfo_Get_ByName(string pFilename, float pAllowGenerate, Gametype pGametypeToSet)
index 020ecca0855beb2260ad48608fd77bf917286b39..6fb3a435aa59b7b557cf04b521f2e77a01367665 100644 (file)
@@ -9,7 +9,7 @@ void func_ladder_touch(entity this, entity toucher)
        if(IS_VEHICLE(toucher))
                return;
 #elif defined(CSQC)
-       if(!toucher.isplayermodel)
+       if(!IS_PLAYER(toucher)) // don't allow non-player predicted entities!
                return;
 #endif
 
index 1b93cbf35986f4e62cdb127486095f8cd5f55b89..412521272398e87680d6f793471cf17c1f456ad9 100644 (file)
 
     MSG_INFO_NOTIF(CONNECTING,                              N_CONSOLE,  1, 0, "s1", "",         "",     _("^BG%s^BG is connecting..."), "")
     MSG_INFO_NOTIF(JOIN_CONNECT,                            N_CHATCON,  1, 0, "s1", "",         "",     _("^BG%s^F3 connected"), "")
-    MSG_INFO_NOTIF(JOIN_PLAY,                               N_CONSOLE,  1, 0, "s1", "",         "",     _("^BG%s^F3 is now playing"), "")
+    MSG_INFO_NOTIF(JOIN_PLAY,                               N_CHATCON,  1, 0, "s1", "",         "",     _("^BG%s^F3 is now playing"), "")
     MULTITEAM_INFO(JOIN_PLAY_TEAM, 4,                       N_CHATCON,  1, 0, "s1", "",         "",     _("^BG%s^F3 is now playing on the ^TC^TT team"), "", NAME)
 
     MSG_INFO_NOTIF(KEEPAWAY_DROPPED,                        N_CONSOLE,  1, 0, "s1", "s1",       "notify_balldropped",       _("^BG%s^BG has dropped the ball!"), "")
     MULTITEAM_INFO(KEYHUNT_DESTROYED, 4,                    N_CONSOLE,  1, 0, "s1", "",         "",     _("^BG%s^BG destroyed the ^TC^TT Key"), "", KEY)
     MULTITEAM_INFO(KEYHUNT_PICKUP, 4,                       N_CONSOLE,  1, 0, "s1", "",         "",     _("^BG%s^BG picked up the ^TC^TT Key"), "", KEY)
 
-    MSG_INFO_NOTIF(LMS_FORFEIT,                             N_CONSOLE,  1, 0, "s1", "",         "",     _("^BG%s^F3 forfeited"), "")
+    MSG_INFO_NOTIF(LMS_FORFEIT,                             N_CHATCON,  1, 0, "s1", "",         "",     _("^BG%s^F3 forfeited"), "")
     MSG_INFO_NOTIF(LMS_NOLIVES,                             N_CONSOLE,  1, 0, "s1", "",         "",     _("^BG%s^F3 has no more lives left"), "")
 
     MSG_INFO_NOTIF(MONSTERS_DISABLED,                       N_CONSOLE,  0, 0, "", "",           "",     _("^BGMonsters are currently disabled"), "")
index 87d456c018fb4ad7b5f52243b73d9e13c4f7c569..c38254982b13287d8d64c9a0ed4c8de451fbcf96 100644 (file)
@@ -132,7 +132,7 @@ void PM_ClientMovement_UpdateStatus(entity this)
                //do_crouch = false;
        } else if (PHYS_INVEHICLE(this)) {
                do_crouch = false;
-       } else if (STAT(FROZEN, this)) {
+       } else if (STAT(FROZEN, this) || IS_DEAD(this)) {
                do_crouch = false;
     }
 
index 268b591264208458dcada567c028fbdf102be052..04b96bc9974974cf98656754bf9aeb1b0583502a 100644 (file)
@@ -98,7 +98,7 @@ void CSQCPlayer_Unpredict(entity this)
 
 void CSQCPlayer_SetMinsMaxs(entity this)
 {
-       if (IS_DUCKED(this) || !this.isplayermodel)
+       if (IS_DUCKED(this) || !(this.isplayermodel & ISPLAYER_PLAYER))
        {
                this.mins = PHYS_PL_CROUCH_MIN(this);
                this.maxs = PHYS_PL_CROUCH_MAX(this);
index fe0c04179ddcec573cb03e0fa7511ab039dc97c8..c5d985401968a2d79e830d07c3ea17d7fc917494 100644 (file)
@@ -381,7 +381,7 @@ void PutObserverInServer(entity this)
                if(axh.owner == this && axh != NULL && !wasfreed(axh))
                        delete(axh);
        }
-       
+
        if (mutator_returnvalue)
        {
                // mutator prevents resetting teams+score
@@ -390,7 +390,9 @@ void PutObserverInServer(entity this)
        {
                SetPlayerTeam(this, -1, TEAM_CHANGE_SPECTATOR);
                this.frags = FRAGS_SPECTATOR;
-    }
+       }
+       if (CS(this).just_joined)
+               CS(this).just_joined = false;
 }
 
 int player_getspecies(entity this)
index e67625a307caac26580d06c7491f3299f8f5e255..b768ccb7e8510355d99068660661fd901dd96054 100644 (file)
@@ -36,8 +36,9 @@ string getrecords(int page)  // 50 records per page
 
        MapInfo_ClearTemps();
 
-       if (s == "" && page == 0) return "No records are available on this server.\n";
-       else return s;
+       if (s == "" && page == 0)
+               return "No records are available on this server for the current game mode.\n";
+       return s;
 }
 
 string getrankings()
index a30103645d344a640b4c08751d65ef6dd239dcaa..c19b85fe21bdf6bb0c892570bc77270cb3235d5a 100644 (file)
@@ -181,7 +181,7 @@ bool Player_SetTeamIndex(entity player, int index)
                {
                        // This is important when players join the game and one of their
                        // color matches the team color while other doesn't. For example
-                       // [BOT]Lion.
+                       // [BOT]Lion: color 0 4.
                        SetPlayerColors(player, new_team - 1);
                }
                return true;
@@ -227,10 +227,6 @@ bool SetPlayerTeam(entity player, int team_index, int type)
                                Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_SPECTATE,
                                        player.netname);
                        }
-                       else
-                       {
-                               CS(player).just_joined = false;
-                       }
                }
                KillPlayerForTeamChange(player);
                if (!IS_BOT_CLIENT(player))
@@ -238,6 +234,11 @@ bool SetPlayerTeam(entity player, int team_index, int type)
                        TeamBalance_AutoBalanceBots();
                }
        }
+       else if (team_index == -1)
+       {
+               if (!CS(player).just_joined && player.frags != FRAGS_SPECTATOR)
+                       Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_SPECTATE, player.netname);
+       }
        return true;
 }