]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into mirceakitsune/nex_reticle
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 29 Jun 2010 10:53:07 +0000 (13:53 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 29 Jun 2010 10:53:07 +0000 (13:53 +0300)
14 files changed:
.gitattributes
defaultXonotic.cfg
qcsrc/common/constants.qh
qcsrc/menu/item/inputbox.c
qcsrc/menu/item/listbox.c
qcsrc/menu/item/slider.c
qcsrc/menu/xonotic/charmap.c
qcsrc/menu/xonotic/credits.c
qcsrc/server/arena.qc
qcsrc/server/cl_player.qc
qcsrc/server/w_common.qc
qcsrc/warpzonelib/common.qc
qcsrc/warpzonelib/server.qc
scripts/shaderlist.txt [new file with mode: 0644]

index fb9e9b14c20bf4ae9a2761ec1a61a5f628ce27a0..695d07e57d3951ba52488fca29bfe159de8a399e 100644 (file)
@@ -76,6 +76,7 @@ GPL crlf=input
 *.icns -crlf -diff
 *.ico -crlf -diff
 *.idsoftware crlf=input
+*.iqm -crlf -diff
 *.inc crlf=input
 *.instantaction crlf=input
 *.java crlf=input
index 526a57d448bf5157c75b0b04e31264a49184fdcf..45aa842cda5a0ce0d9661cb01a275c00b3887b5c 100644 (file)
@@ -1482,7 +1482,6 @@ set g_jump_grunt 0        "Do you make a grunting noise every time you jump? Is it the
 
 alias allready "sv_cmd allready"
 
-// note: these cvars use weapon NUMBERS. Use the menu to edit this cvar, or look the numbers up in qcsrc/common/constants.qh.
 seta cl_weaponpriority "minstanex rocketlauncher nex grenadelauncher fireball hlac hagar seeker crylink campingrifle uzi electro tuba shotgun laser hook porto" "weapon priority list"
 seta cl_weaponpriority_useforcycling 0 "when set, weapon cycling by the mouse wheel makes use of the weapon priority list (the special value 2 uses the weapon ID list for cycling)"
 seta cl_weaponpriority0 "rocketlauncher grenadelauncher hagar seeker fireball" "use impulse 200 for prev gun from this list, 210 for best gun, 220 for next gun.  Default value: explosives"
index 3e2cf69057766cefaa0199061feb050a96dcb148..29d2704fd43a3376387041408e084afb857530fe 100644 (file)
@@ -144,6 +144,7 @@ const float K_RIGHTARROW    =       131;
 const float K_ALT              =       132;
 const float K_CTRL     =       133;
 const float K_SHIFT    =       134;
+
 const float K_F1               =       135;
 const float K_F2               =       136;
 const float K_F3               =       137;
@@ -156,6 +157,7 @@ const float K_F9            =       143;
 const float K_F10              =       144;
 const float K_F11              =       145;
 const float K_F12              =       146;
+
 const float K_INS              =       147;
 const float K_DEL              =       148;
 const float K_PGDN     =       149;
@@ -163,21 +165,38 @@ const float K_PGUP        =       150;
 const float K_HOME     =       151;
 const float K_END              =       152;
 
-const float K_KP_HOME                  =       160;
-const float K_KP_UPARROW               =       161;
-const float K_KP_PGUP                  =       162;
-const float K_KP_LEFTARROW     =       163;
-const float K_KP_5                     =       164;
-const float K_KP_RIGHTARROW    =       165;
-const float K_KP_END                   =       166;
-const float K_KP_DOWNARROW     =       167;
-const float K_KP_PGDN                  =       168;
-const float K_KP_ENTER         =       169;
-const float K_KP_INS                   =       170;
-const float K_KP_DEL                   =       171;
-const float K_KP_SLASH         =       172;
-const float K_KP_MINUS         =       173;
-const float K_KP_PLUS                  =       174;
+const float K_NUMLOCK          =       154;
+const float K_CAPSLOCK         =       155;
+const float K_SCROLLOCK                =       156;
+
+const float K_KP_0                     =       157;
+const float K_KP_INS           =       K_KP_0;
+const float K_KP_1                     =       158;
+const float K_KP_END           =       K_KP_1;
+const float K_KP_2                     =       159;
+const float K_KP_DOWNARROW     =       K_KP_2;
+const float K_KP_3                     =       160;
+const float K_KP_PGDN          =       K_KP_3;
+const float K_KP_4                     =       161;
+const float K_KP_LEFTARROW     =       K_KP_4;
+const float K_KP_5                     =       162;
+const float K_KP_6                     =       163;
+const float K_KP_RIGHTARROW    =       K_KP_6;
+const float K_KP_7                     =       164;
+const float K_KP_HOME          =       K_KP_7;
+const float K_KP_8                     =       165;
+const float K_KP_UPARROW       =       K_KP_8;
+const float K_KP_9                     =       166;
+const float K_KP_PGUP          =       K_KP_9;
+const float K_KP_PERIOD                =       167;
+const float K_KP_DEL           =       K_KP_PERIOD;
+const float K_KP_DIVIDE                =       168;
+const float K_KP_SLASH         =       K_KP_DIVIDE;
+const float K_KP_MULTIPLY      =       169;
+const float K_KP_MINUS         =       170;
+const float K_KP_PLUS          =       171;
+const float K_KP_ENTER         =       172;
+const float K_KP_EQUALS                =       173;
 
 const float K_PAUSE            =       255;
 
index cb1b32e8b1c9a4225e9e3bb09885b935e3945491..2d64590306139cc97f1b860ac56c5e7a72de836a 100644 (file)
@@ -96,15 +96,19 @@ float InputBox_keyDown(entity me, float key, float ascii, float shift)
        }
        switch(key)
        {
+               case K_KP_LEFTARROW:
                case K_LEFTARROW:
                        me.cursorPos -= 1;
                        return 1;
+               case K_KP_RIGHTARROW:
                case K_RIGHTARROW:
                        me.cursorPos += 1;
                        return 1;
+               case K_KP_HOME:
                case K_HOME:
                        me.cursorPos = 0;
                        return 1;
+               case K_KP_END:
                case K_END:
                        me.cursorPos = strlen(me.text);
                        return 1;
@@ -115,6 +119,7 @@ float InputBox_keyDown(entity me, float key, float ascii, float shift)
                                me.setText(me, strcat(substring(me.text, 0, me.cursorPos), substring(me.text, me.cursorPos + 1, strlen(me.text) - me.cursorPos - 1)));
                        }
                        return 1;
+               case K_KP_DEL:
                case K_DEL:
                        if(shift & S_CTRL)
                                me.setText(me, "");
index 3dd873c33a23428e2acda977d9664fd50f563a1e..4d6174cc593cb4bacb484addb4ec9b551e019909 100644 (file)
@@ -68,20 +68,20 @@ float ListBox_keyDown(entity me, float key, float ascii, float shift)
                me.scrollPos = min(me.scrollPos + 0.5, me.nItems * me.itemHeight - 1);
                me.setSelected(me, max(me.selectedItem, ceil(me.scrollPos / me.itemHeight)));
        }
-       else if(key == K_PGUP)
+       else if(key == K_PGUP || key == K_KP_PGUP)
                me.setSelected(me, me.selectedItem - 1 / me.itemHeight);
-       else if(key == K_PGDN)
+       else if(key == K_PGDN || key == K_KP_PGDN)
                me.setSelected(me, me.selectedItem + 1 / me.itemHeight);
-       else if(key == K_UPARROW)
+       else if(key == K_UPARROW || key == K_KP_UPARROW)
                me.setSelected(me, me.selectedItem - 1);
-       else if(key == K_DOWNARROW)
+       else if(key == K_DOWNARROW || key == K_KP_DOWNARROW)
                me.setSelected(me, me.selectedItem + 1);
-       else if(key == K_HOME)
+       else if(key == K_HOME || key == K_KP_HOME)
        {
                me.scrollPos = 0;
                me.setSelected(me, 0);
        }
-       else if(key == K_END)
+       else if(key == K_END || key == K_KP_END)
        {
                me.scrollPos = max(0, me.nItems * me.itemHeight - 1);
                me.setSelected(me, me.nItems - 1);
index 92f3b55fe12b56516d08fa781f0a07e74b56bd79..1f01cb4e2efeab7b1e0357633fc7368995e52af0 100644 (file)
@@ -104,7 +104,7 @@ float Slider_keyDown(entity me, float key, float ascii, float shift)
        if(me.disabled)
                return 0;
        inRange = (almost_in_bounds(me.valueMin, me.value, me.valueMax));
-       if(key == K_LEFTARROW)
+       if(key == K_LEFTARROW || key == K_KP_LEFTARROW)
        {
                if(inRange)
                        me.setValue(me, median(me.valueMin, me.value - me.valueKeyStep, me.valueMax));
@@ -112,7 +112,7 @@ float Slider_keyDown(entity me, float key, float ascii, float shift)
                        me.setValue(me, me.valueMax);
                return 1;
        }
-       if(key == K_RIGHTARROW)
+       if(key == K_RIGHTARROW || key == K_KP_RIGHTARROW)
        {
                if(inRange)
                        me.setValue(me, median(me.valueMin, me.value + me.valueKeyStep, me.valueMax));
@@ -120,7 +120,7 @@ float Slider_keyDown(entity me, float key, float ascii, float shift)
                        me.setValue(me, me.valueMin);
                return 1;
        }
-       if(key == K_PGUP)
+       if(key == K_PGUP || key == K_KP_PGUP)
        {
                if(inRange)
                        me.setValue(me, median(me.valueMin, me.value - me.valuePageStep, me.valueMax));
@@ -128,7 +128,7 @@ float Slider_keyDown(entity me, float key, float ascii, float shift)
                        me.setValue(me, me.valueMax);
                return 1;
        }
-       if(key == K_PGDN)
+       if(key == K_PGDN || key == K_KP_PGDN)
        {
                if(inRange)
                        me.setValue(me, median(me.valueMin, me.value + me.valuePageStep, me.valueMax));
@@ -136,12 +136,12 @@ float Slider_keyDown(entity me, float key, float ascii, float shift)
                        me.setValue(me, me.valueMin);
                return 1;
        }
-       if(key == K_HOME)
+       if(key == K_HOME || key == K_KP_HOME)
        {
                me.setValue(me, me.valueMin);
                return 1;
        }
-       if(key == K_END)
+       if(key == K_END || key == K_KP_END)
        {
                me.setValue(me, me.valueMax);
                return 1;
index 21a4aad6f33fa77784fc49a1ab57173acdbdc10d..a448e3547e563f8eceae79086716a3b685c982df 100644 (file)
@@ -97,26 +97,33 @@ float XonoticCharmap_keyDown(entity me, float key, float ascii, float shift)
        switch(key)
        {
                case K_LEFTARROW:
+               case K_KP_LEFTARROW:
                        me.selectedCharacterCell = mod(me.selectedCharacterCell + 159, 160);
                        return 1;
                case K_RIGHTARROW:
+               case K_KP_RIGHTARROW:
                        me.selectedCharacterCell = mod(me.selectedCharacterCell + 1, 160);
                        return 1;
                case K_UPARROW:
+               case K_KP_UPARROW:
                        me.selectedCharacterCell = mod(me.selectedCharacterCell + 144, 160);
                        return 1;
                case K_DOWNARROW:
+               case K_KP_DOWNARROW:
                        me.selectedCharacterCell = mod(me.selectedCharacterCell + 16, 160);
                        return 1;
                case K_HOME:
+               case K_KP_HOME:
                        me.selectedCharacterCell = 0;
                        return 1;
                case K_END:
+               case K_KP_END:
                        me.selectedCharacterCell = 159;
                        return 1;
                case K_SPACE:
                case K_ENTER:
                case K_INS:
+               case K_KP_INS:
                        me.controlledTextbox.enterText(me.controlledTextbox, CharMap_CellToChar(me.selectedCharacterCell));
                        return 1;
                default:
index 5c2f1585c462479d2c47486599456d36beb09511..86609a659865c963c6485813867eaa53e0dd33ed 100644 (file)
@@ -87,22 +87,21 @@ void XonoticCreditsList_drawListBoxItem(entity me, float i, vector absSize, floa
        draw_CenterText(me.realUpperMargin * eY + 0.5 * eX, s, me.realFontSize, theColor, theAlpha, 0);
 }
 
-float XonoticCreditsList_keyDown(entity me, float scan, float ascii, float shift)
+float XonoticCreditsList_keyDown(entity me, float key, float ascii, float shift)
 {
        float i;
        me.dragScrollTimer = time;
        me.scrolling = 0;
-
-       if(scan == K_PGUP)
+       if(key == K_PGUP || key == K_KP_PGUP)
                me.scrollPos = max(me.scrollPos - 0.5, 0);
-       else if(scan == K_PGDN)
+       else if(key == K_PGDN || key == K_KP_PGDN)
                me.scrollPos = min(me.scrollPos + 0.5, me.nItems * me.itemHeight - 1);
-       else if(scan == K_UPARROW)
+       else if(key == K_UPARROW || key == K_KP_UPARROW)
                me.scrollPos = max(me.scrollPos - me.itemHeight, 0);
-       else if(scan == K_DOWNARROW)
+       else if(key == K_DOWNARROW || key == K_KP_DOWNARROW)
                me.scrollPos = min(me.scrollPos + me.itemHeight, me.nItems * me.itemHeight - 1);
        else
-               return SUPER(XonoticCreditsList).keyDown(me, scan, ascii, shift);
+               return SUPER(XonoticCreditsList).keyDown(me, key, ascii, shift);
 
        i = min(me.selectedItem, floor((me.scrollPos + 1) / me.itemHeight - 1));
        i = max(i, ceil(me.scrollPos / me.itemHeight));
index e68e295022f29ecfe2ef3e579f47caded8ecfdf8..ee4ce1b87ed9388ca2bf376f98a437866ef21bc3 100644 (file)
@@ -10,7 +10,7 @@ entity spawnqueue_last;
 entity champion;
 float warmup;
 float allowed_to_spawn;
-float player_cnt;
+float ca_players;
 float required_ca_players;
 .float caplayer;
 
@@ -123,7 +123,7 @@ void reset_map(float dorespawn)
                kh_Controller_SetThink(cvar("g_balance_keyhunt_delay_round")+(game_starttime - time), "", kh_StartRound);
 
        if(g_arena || g_ca)
-       if(champion && champion.classname == "player" && player_cnt > 1)
+       if(champion && champion.classname == "player" && player_count > 1)
                UpdateFrags(champion, +1);
 
        self = oldself;
@@ -183,7 +183,7 @@ void Spawnqueue_Mark(entity e)
  * player when player is waiting for the countdown to finish.
  * Blocks the players movement while countdown is active.
  * Unblocks the player once the countdown is over.
- * 
+ *
  * Called in PlayerPostThink()
  */
 float roundStartTime_prev; // prevent networkspam
@@ -199,7 +199,7 @@ void Arena_Warmup()
 
        allowed_to_spawn = 0;
 
-       if(g_ca && (player_cnt < required_ca_players || inWarmupStage))
+       if(g_ca && (ca_players < required_ca_players || inWarmupStage))
                allowed_to_spawn = 1;
 
        msg = NEWLINES;
@@ -242,15 +242,13 @@ void Arena_Warmup()
        {
                roundStartTime_prev = f;
                Announce("begin");
-               centerprint(self, "^1Begin!\n");        
+               centerprint(self, "^1Begin!\n");
 
                if(g_ca) {
-                       player_cnt = 0;
+                       ca_players = 0;
 
-                       FOR_EACH_CLIENT(self) {
-                       if (self.classname == "player")
-                               player_cnt += 1;
-                       }               
+                       FOR_EACH_PLAYER(self)
+                               ca_players += 1;
                }
        }
 
@@ -263,7 +261,7 @@ float next_round;
  * This function finds out whether an arena round is over 1 player is left.
  * It determines the last player who's still alive and saves it's entity reference
  * in the global variable 'champion'. Then the new enemy/enemies are put into the server.
- * 
+ *
  * Gets called in StartFrame()
  */
 void Spawnqueue_Check()
@@ -274,28 +272,25 @@ void Spawnqueue_Check()
        if(g_ca) {
                // check the amount of spawned players in each team
                float redspawned, bluespawned;
-               FOR_EACH_CLIENT(self) {
-                       if (self.classname == "player") {
-                               if (self.team == COLOR_TEAM1) redspawned += 1;
-                               else if (self.team == COLOR_TEAM2) bluespawned += 1;
-                       }
+               FOR_EACH_PLAYER(self) {
+                       if (self.team == COLOR_TEAM1) redspawned += 1;
+                       else if (self.team == COLOR_TEAM2) bluespawned += 1;
                }
 
                required_ca_players = max(2, fabs(cvar("bot_vs_human") + 1));
 
-               if(player_cnt < required_ca_players && (redspawned && bluespawned)) {
+               if(ca_players < required_ca_players && (redspawned && bluespawned)) {
                        reset_map(TRUE);
                }
-               else if(player_cnt < required_ca_players) {
-                       FOR_EACH_CLIENT(self) 
-                       if(self.classname == "player")
+               else if(ca_players < required_ca_players) {
+                       FOR_EACH_PLAYER(self)
                                centerprint(self, strcat("^1Need at least 1 player in each team to play CA", "^7\n"));
 
                        allowed_to_spawn = 1;
                        return;
                }
-               else if(!next_round)
-                       if((redspawned && bluespawned == 0) || (bluespawned && redspawned == 0)) {
+               else if(!next_round) {
+                       if((redspawned && !bluespawned) || (bluespawned && !redspawned)) {
                                next_round = time + 5;
 
                                champion = find(world, classname, "player");
@@ -308,7 +303,8 @@ void Spawnqueue_Check()
                                        champion_team = "^4Blue team";
                                        play2all("ctf/blue_capture.wav");
                                }
-                               FOR_EACH_CLIENT(self) centerprint(self, strcat(champion_team, "^7 wins the round.", "^7\n"));   
+                               FOR_EACH_CLIENT(self) centerprint(self, strcat(champion_team, "^7 wins the round.", "^7\n"));
+                       }
                        else if(!redspawned && !bluespawned) {
                                FOR_EACH_CLIENT(self) centerprint(self, strcat("^7Round tied.", "^7\n"));
                                next_round = time + 5;
index 3911ffecb89a5db3921992c8f729f91808f08dfa..2fe7d512089e9e655b9d5a51491d03bb5ff53a73 100644 (file)
@@ -433,7 +433,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
        else
                Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, self, attacker);
 
-       if((g_arena && numspawned < 2) || (g_ca && player_cnt < required_ca_players) && !inWarmupStage)
+       if((g_arena && numspawned < 2) || (g_ca && ca_players < required_ca_players) && !inWarmupStage)
                return;
 
        if (!g_minstagib)
index 8f2de4e8ce27b777624ea583860d081df599e830..4427320586988352ab039c04810e2fbeeced5fdf 100644 (file)
@@ -270,7 +270,7 @@ float W_BallisticBullet_LeaveSolid(entity e, vector vel, float constant)
 
        self.W_BallisticBullet_LeaveSolid_origin = trace_endpos;
 
-       dst = vlen(trace_endpos - self.origin);
+       dst = max(cvar("g_ballistics_mindistance"), vlen(trace_endpos - self.origin));
        // E(s) = E0 - constant * s, constant = area of bullet circle * material constant / mass
        Es_m = E0_m - constant * dst;
        if(Es_m <= 0)
index e4acfb1693a2d86586cd3fb53cda548547b83f7b..5cf155642bd6019d1d4587f0881093a7466171ca 100644 (file)
@@ -200,6 +200,7 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end,
                if(--i < 1)
                {
                        dprint("Too many warpzones in sequence, aborting trace.\n");
+                       trace_ent = world;
                        break;
                }
                tracebox(org, mi, ma, end, nomonsters, forent);
@@ -216,6 +217,7 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end,
                if(trace_ent == wz)
                {
                        dprint("I transformed into the same zone again, wtf, aborting the trace\n");
+                       trace_ent = world;
                        break;
                }
                wz = trace_ent;
@@ -281,6 +283,7 @@ void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZo
                if(--i < 1)
                {
                        dprint("Too many warpzones in sequence, aborting trace.\n");
+                       trace_ent = world;
                        break;
                }
                tracetoss(e, forent);
@@ -297,6 +300,7 @@ void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZo
                if(trace_ent == wz)
                {
                        dprint("I transformed into the same zone again, wtf, aborting the trace\n");
+                       trace_ent = world;
                        break;
                }
                wz = trace_ent;
index 6388fbaade6c847d3ac8a1200285519aae27509d..c156299c6967c96bddf44661b8c1f32f6fe203c3 100644 (file)
@@ -394,21 +394,29 @@ void WarpZone_InitStep_ClearTarget()
        self.enemy = world;
 }
 
+entity warpzone_first; .entity warpzone_next;
 void WarpZone_InitStep_FindTarget()
 {
        float i;
        entity e, e2;
 
+       if(self.enemy)
+               return;
+
        // this way only one of the two ents needs to target
        if(self.target != "")
        {
+               self.enemy = self; // so the if(!e.enemy) check also skips self, saves one IF
+
                e2 = world;
-               for(e = world; (e = find(e, targetname, self.target)); )
+               for(e = world, i = 0; (e = find(e, targetname, self.target)); )
                        if(!e.enemy)
-                               if(random() * ++i < 1)
-                                       e2 = e;
+                               if(e.classname == self.classname) // possibly non-warpzones may use the same targetname!
+                                       if(random() * ++i < 1)
+                                               e2 = e;
                if(!e2)
                {
+                       self.enemy = world;
                        error("Warpzone with non-existing target");
                        return;
                }
@@ -538,7 +546,7 @@ void WarpZone_StartFrame()
                WarpZone_StoreProjectileData(e);
 }
 
-void target_warpzone_reconnect_use()
+void trigger_warpzone_reconnect_use()
 {
        entity e;
        e = self;
@@ -556,7 +564,12 @@ void target_warpzone_reconnect_use()
        self = e;
 }
 
-void trigger_warpzone_reconnect()
+void spawnfunc_trigger_warpzone_reconnect()
+{
+       self.use = trigger_warpzone_reconnect_use;
+}
+
+void spawnfunc_target_warpzone_reconnect()
 {
-       self.use = target_warpzone_reconnect_use;
+       spawnfunc_trigger_warpzone_reconnect(); // both names make sense here :(
 }
diff --git a/scripts/shaderlist.txt b/scripts/shaderlist.txt
new file mode 100644 (file)
index 0000000..8a7b04a
--- /dev/null
@@ -0,0 +1,15 @@
+electro
+fireball
+flags
+hlac
+model-common
+onslaught
+portals
+pyria
+shotgun
+spiderbot
+teamfx
+tree
+tuba
+turrets
+weapons