]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'origin/master' into morosophos/server-current4
authorNikolay S <nick@teichisma.info>
Thu, 21 Sep 2023 20:32:21 +0000 (23:32 +0300)
committerNikolay S <nick@teichisma.info>
Thu, 21 Sep 2023 20:32:21 +0000 (23:32 +0300)
16 files changed:
.tx/merge-base
common.ru.po
qcsrc/client/hud/panel/strafehud.qc
qcsrc/client/hud/panel/weapons.qc
qcsrc/client/main.qc
qcsrc/common/effects/qc/casings.qc
qcsrc/common/mapobjects/func/door.qc
qcsrc/common/mapobjects/func/door.qh
qcsrc/common/mapobjects/func/plat.qc
qcsrc/common/mapobjects/platforms.qc
qcsrc/common/weapons/weapon/electro.qc
qcsrc/common/weapons/weapon/minelayer.qc
qcsrc/menu/menu.qc
qcsrc/server/bot/default/waypoints.qc
qcsrc/server/items/items.qc
qcsrc/server/main.qc

index 37eb6d28067ee7ff709e2a3ffb57f12a0e44f171..ac00185287316cf9e391e5ed78297ff56b1d3b4c 100644 (file)
@@ -1 +1 @@
-Wed 06 Sep 2023 07:22:58 AM CEST
+Fri 15 Sep 2023 07:26:17 AM CEST
index 907ea92bae3b85819cdf0a531180a20da389c301..4b805ce0da1849ee55591fb37903e8adeb8ebd8c 100644 (file)
@@ -11,7 +11,7 @@
 # Artem Vorotnikov <artem@vorotnikov.me>, 2015
 # Blueberryy <igory.ygr200@gmail.com>, 2021,2023
 # Blueberryy <igory.ygr200@gmail.com>, 2021
-# Blueberryy <igory.ygr200@gmail.com>, 2021
+# Blueberryy <igory.ygr200@gmail.com>, 2021,2023
 # Blueberryy <igory.ygr200@gmail.com>, 2021
 # Lord Canistra <lordcanistra@gmail.com>, 2011
 # Mirio <opivy@hotmail.de>, 2017
index 1e28a2570801c45671c412fab2e481364af09d41..cde7f660103db964dc3211a47006a52f639653a4 100644 (file)
@@ -215,7 +215,7 @@ void HUD_StrafeHUD()
                        {
                                trace_dphitq3surfaceflags = 0;
                                tracebox(strafeplayer.origin, strafeplayer.mins, strafeplayer.maxs, strafeplayer.origin - '0 0 1', MOVE_NOMONSTERS, strafeplayer);
-                               onslick = (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK);
+                               onslick = trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK;
                        }
                        real_onslick = onslick;
 
index dde130da8a2b94420007d646c839e8243c44de38..2863f62d9fe160f50797762a34120c37c2b803a5 100644 (file)
@@ -500,10 +500,8 @@ void HUD_Weapons()
                else
                {
                        if ((it.spawnflags & (WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_SPECIALATTACK))
-                               && !(weapons_stat & WepSet_FromWeapon(it)))
-                       {
+                       && !(weapons_stat & WepSet_FromWeapon(it)))
                                continue;
-                       }
                }
 
                // figure out the drawing position of weapon
index 5f2332c69096896ce639fce443df27d95eca1362..58d497aab77b176a9ef60b951762e60d7eecac95 100644 (file)
@@ -744,7 +744,7 @@ NET_HANDLE(ENT_CLIENT_NAGGER, bool isnew)
                for(int i = 0; i < maxclients;)
                        for(int f = ReadByte(), b = 0; b < 8 && i < maxclients; ++b, ++i)
                                if(playerslots[i])
-                                       playerslots[i].ready = (f & BIT(b));
+                                       playerslots[i].ready = f & BIT(b);
 
        return = true;
 
index a61a8bd093b3ec039bc817d2982a71b854c0bdc8..a0923184b0a04a6a998641d2b530df9e86253ddc 100644 (file)
@@ -164,7 +164,7 @@ NET_HANDLE(casings, bool isNew)
 
     return = true;
 
-    casing.silent = (casing.state & 0x80);
+    casing.silent = casing.state & 0x80;
     if ((casing.state & 0x40) && !autocvar_chase_active)
         casing.origin += autocvar_cl_gunoffset.x * v_forward
                        - autocvar_cl_gunoffset.y * v_right
index 9afe3aaded7a6bd2794f53010fc8a785c7cc653f..1316c3283003e6ce5b5a573e47960eebdb9c2020 100644 (file)
@@ -29,7 +29,6 @@ void door_blocked(entity this, entity blocker)
 {
        bool reverse = false;
        if((this.spawnflags & DOOR_CRUSH)
-               && !Q3COMPAT_COMMON
 #ifdef SVQC
                && (blocker.takedamage != DAMAGE_NO)
 #elif defined(CSQC)
@@ -44,46 +43,46 @@ void door_blocked(entity this, entity blocker)
        else
        {
 #ifdef SVQC
-               if(this.dmg && blocker.takedamage != DAMAGE_NO)    // Shall we bite?
+               if((this.dmg) && (blocker.takedamage == DAMAGE_YES))    // Shall we bite?
                        Damage (blocker, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, DMG_NOWEP, blocker.origin, '0 0 0');
 #endif
 
-               // don't change direction for dead or dying stuff
-               if(!IS_DEAD(blocker)
+                // don't change direction for dead or dying stuff
+               if(IS_DEAD(blocker)
 #ifdef SVQC
-                       && blocker.takedamage != DAMAGE_NO
+                       && (blocker.takedamage == DAMAGE_NO)
 #endif
-                       && this.wait >= 0
-                       && !(Q3COMPAT_COMMON && (this.spawnflags & Q3_DOOR_CRUSHER))
                )
                {
-                       if (this.state == STATE_DOWN)
-                       {
-                               if (this.classname == "door")
-                                       door_go_up(this, NULL, NULL);
-                               else
-                                       door_rotating_go_up(this, blocker);
-                       }
-                       else
+                       if (this.wait >= 0)
                        {
-                               if (this.classname == "door")
-                                       door_go_down(this);
+                               if (this.state == STATE_DOWN)
+                               {
+                                       if (this.classname == "door")
+                                               door_go_up(this, NULL, NULL);
+                                       else
+                                               door_rotating_go_up(this, blocker);
+                               }
                                else
-                                       door_rotating_go_down(this);
+                               {
+                                       if (this.classname == "door")
+                                               door_go_down(this);
+                                       else
+                                               door_rotating_go_down(this);
+                               }
+                               reverse = true;
                        }
-                       reverse = true;
                }
 #ifdef SVQC
                else
                {
                        //gib dying stuff just to make sure
-                       if(this.dmg && blocker.takedamage != DAMAGE_NO && IS_DEAD(blocker))    // Shall we bite?
+                       if((this.dmg) && (blocker.takedamage != DAMAGE_NO))    // Shall we bite?
                                Damage (blocker, this, this, 10000, DEATH_HURTTRIGGER.m_id, DMG_NOWEP, blocker.origin, '0 0 0');
                }
 #endif
        }
-       // if we didn't change direction and are using a non-linear movement controller, we must pause it
-       if (!reverse && this.classname == "door" && this.move_controller)
+       if (!reverse && this.classname == "door")
                SUB_CalcMovePause(this);
 }
 
@@ -213,13 +212,10 @@ bool door_check_keys(entity door, entity player)
        return false;
 }
 
-void door_use(entity this, entity actor, entity trigger)
+void door_fire(entity this, entity actor, entity trigger)
 {
-       //dprint("door_use (model: ");dprint(this.model);dprint(")\n");
-
-       if (!this.owner)
-               return;
-       this = this.owner;
+       if (this.owner != this)
+               objerror (this, "door_fire: this.owner != this");
 
        if (this.spawnflags & DOOR_TOGGLE)
        {
@@ -260,6 +256,14 @@ void door_use(entity this, entity actor, entity trigger)
        } while ((e != this) && (e != NULL));
 }
 
+void door_use(entity this, entity actor, entity trigger)
+{
+       //dprint("door_use (model: ");dprint(this.model);dprint(")\n");
+
+       if (this.owner)
+               door_fire(this.owner, actor, trigger);
+}
+
 void door_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
 {
        if(this.spawnflags & NOSPLASH)
@@ -365,25 +369,14 @@ void door_trigger_touch(entity this, entity toucher)
 #endif
                        return;
 
-       if (this.owner.state == STATE_UP)
+       if (time < this.door_finished)
                return;
 
        // check if door is locked
        if (!door_check_keys(this, toucher))
                return;
 
-       if (this.owner.state == STATE_TOP)
-       {
-               if (this.owner.nextthink < this.owner.ltime + this.owner.wait)
-               {
-                       entity e = this.owner;
-                       do {
-                               e.nextthink = e.ltime + e.wait;
-                               e = e.enemy;
-                       } while (e != this.owner);
-               }
-               return;
-       }
+       this.door_finished = time + 1;
 
        door_use(this.owner, toucher, NULL);
 }
@@ -415,9 +408,7 @@ LinkDoors
 
 entity LinkDoors_nextent(entity cur, entity near, entity pass)
 {
-       while((cur = find(cur, classname, pass.classname))
-       && (((cur.spawnflags & DOOR_DONT_LINK) && !Q3COMPAT_COMMON) 
-       || cur.enemy))
+       while((cur = find(cur, classname, pass.classname)) && ((cur.spawnflags & DOOR_DONT_LINK) || cur.enemy))
        {
        }
        return cur;
@@ -425,9 +416,6 @@ entity LinkDoors_nextent(entity cur, entity near, entity pass)
 
 bool LinkDoors_isconnected(entity e1, entity e2, entity pass)
 {
-       if(Q3COMPAT_COMMON)
-               return e1.team == e2.team;
-
        float DELTA = 4;
        if((e1.absmin_x > e2.absmax_x + DELTA)
        || (e1.absmin_y > e2.absmax_y + DELTA)
@@ -453,10 +441,7 @@ void LinkDoors(entity this)
 
        if (this.enemy)
                return;         // already linked by another door
-
-       // Q3 door linking is done for teamed doors only and is not affected by spawnflags or bmodel proximity
-       if (((this.spawnflags & DOOR_DONT_LINK) && !Q3COMPAT_COMMON)
-       || (Q3COMPAT_COMMON && !this.team))
+       if (this.spawnflags & DOOR_DONT_LINK)
        {
                this.owner = this.enemy = this;
 
@@ -559,7 +544,7 @@ SILVER_KEY causes the door to open only if the activator holds a silver key.
 "speed"                movement speed (100 default)
 "wait"         wait before returning (3 default, -1 = never return)
 "lip"          lip remaining at end of move (8 default)
-"dmg"          damage to inflict when blocked (0 default)
+"dmg"          damage to inflict when blocked (2 default)
 "sounds"
 0)     no sound
 1)     stone
@@ -624,12 +609,9 @@ void door_init_startopen(entity this)
        this.pos2 = this.pos1;
        this.pos1 = this.origin;
 
-// no longer needed: not using delayed initialisation for door_init_startopen()
-#if 0
 #ifdef SVQC
        this.SendFlags |= SF_TRIGGER_UPDATE;
 #endif
-#endif
 }
 
 void door_reset(entity this)
@@ -684,28 +666,14 @@ void door_init_shared(entity this)
 
        if (q3compat)
        {
-               // CPMA adds these fields for overriding the Q3 default sounds
+               // CPMA adds these fields for overriding the engine sounds
                string s = GetField_fullspawndata(this, "sound_start", true);
                string e = GetField_fullspawndata(this, "sound_end", true);
 
                if (s)
                        this.noise2 = strzone(s);
-               else
-               {
-                       // PK3s supporting Q3A sometimes include custom sounds at Q3 default paths
-                       s = "sound/movers/doors/dr1_strt.wav";
-                       if (FindFileInMapPack(s))
-                               this.noise2 = s;
-               }
-
                if (e)
                        this.noise1 = strzone(e);
-               else
-               {
-                       e = "sound/movers/doors/dr1_end.wav";
-                       if (FindFileInMapPack(e))
-                               this.noise1 = e;
-               }
        }
 
        // sound when door stops moving
@@ -725,7 +693,7 @@ void door_init_shared(entity this)
        }
        else if (!this.wait)
        {
-               this.wait = q3compat ? 2 : 3;
+               this.wait = 3;
        }
 
        if (!this.lip)
@@ -770,19 +738,15 @@ spawnfunc(func_door)
        if(this.spawnflags & DOOR_NONSOLID)
                this.solid = SOLID_NOT;
 
-       door_init_shared(this);
-
-       this.pos1 = this.origin;
-       vector absmovedir;
-       absmovedir.x = fabs(this.movedir.x);
-       absmovedir.y = fabs(this.movedir.y);
-       absmovedir.z = fabs(this.movedir.z);
-       this.pos2 = this.pos1 + this.movedir * (absmovedir * this.size - this.lip);
-
 // DOOR_START_OPEN is to allow an entity to be lighted in the closed position
 // but spawn in the open position
        if (this.spawnflags & DOOR_START_OPEN)
-               door_init_startopen(this);
+               InitializeEntity(this, door_init_startopen, INITPRIO_SETLOCATION);
+
+       door_init_shared(this);
+
+       this.pos1 = this.origin;
+       this.pos2 = this.pos1 + this.movedir*(fabs(this.movedir*this.size) - this.lip);
 
        if(autocvar_sv_doors_always_open)
        {
@@ -796,19 +760,6 @@ spawnfunc(func_door)
                        this.speed = 100;
        }
 
-       if (q3compat)
-       {
-               if (!this.dmg)
-                       this.dmg = 2;
-
-               if (!this.team)
-               {
-                       string t = GetField_fullspawndata(this, "team");
-                       // bones_was_here: same hack as used to support teamed items on Q3 maps
-                       if(t) this.team = crc16(false, t);
-               }
-       }
-
        settouch(this, door_touch);
 
 // LinkDoors can't be done until all of the doors have been spawned, so
index ce7025dd5488854e741bb166c9c3e2db8b1a8f2a..f185f4be8fc96e307ae05ee89078b3174396fb44 100644 (file)
@@ -4,7 +4,7 @@
 bool autocvar_sv_doors_always_open;
 #endif
 
-const int DOOR_START_OPEN = BIT(0); // has same meaning in Q3: reverse position 1 and 2
+const int DOOR_START_OPEN = BIT(0);
 const int DOOR_DONT_LINK = BIT(2);
 const int SPAWNFLAGS_GOLD_KEY = BIT(3); // Quake 1 compat, can only be used with func_door!
 const int SPAWNFLAGS_SILVER_KEY = BIT(4); // Quake 1 compat, can only be used with func_door!
@@ -13,7 +13,6 @@ const int DOOR_TOGGLE = BIT(5);
 const int DOOR_NONSOLID = BIT(10);
 const int DOOR_CRUSH = BIT(11); // can't use CRUSH cause that is the same as DOOR_DONT_LINK
 
-#define Q3_DOOR_CRUSHER BIT(2) // in Q3 this disables the auto reverse so the blocking player takes damage every frame
 
 #ifdef CSQC
 // stuff for preload
index 08faae9ebef1a1ca05f9c5b380ac41254d54c7b6..2376c5956de1adbdc227654e30b819c8d5137b0f 100644 (file)
@@ -7,9 +7,7 @@ void plat_link(entity this);
 void plat_delayedinit(entity this)
 {
        plat_link(this);
-       // Q3 uses only a truth check of .targetname to decide whether to spawn a trigger
-       if(!Q3COMPAT_COMMON || this.targetname == "")
-               plat_spawn_inside_trigger(this); // the "start moving" trigger
+       plat_spawn_inside_trigger(this); // the "start moving" trigger
 }
 
 float plat_send(entity this, entity to, float sf)
@@ -58,12 +56,7 @@ void plat_link(entity this)
 
 spawnfunc(func_plat)
 {
-       if (q3compat)
-       {
-               this.spawnflags = 0; // Q3 plats have no spawnflags
-               if (!this.dmg) this.dmg = 2;
-       }
-       else if (this.spawnflags & CRUSH)
+       if (this.spawnflags & CRUSH)
        {
                this.dmg = 10000;
        }
@@ -98,28 +91,14 @@ spawnfunc(func_plat)
 
        if (q3compat)
        {
-               // CPMA adds these fields for overriding the Q3 default sounds
+               // CPMA adds these fields for overriding the engine sounds
                string s = GetField_fullspawndata(this, "sound_start", true);
                string e = GetField_fullspawndata(this, "sound_end", true);
 
                if (s)
                        this.noise = strzone(s);
-               else
-               {
-                       // PK3s supporting Q3A sometimes include custom sounds at Q3 default paths
-                       s = "sound/movers/plats/pt1_strt.wav";
-                       if (FindFileInMapPack(s))
-                               this.noise = s;
-               }
-
                if (e)
                        this.noise1 = strzone(e);
-               else
-               {
-                       e = "sound/movers/plats/pt1_end.wav";
-                       if (FindFileInMapPack(e))
-                               this.noise1 = e;
-               }
        }
 
        if(this.noise && this.noise != "")
@@ -143,8 +122,8 @@ spawnfunc(func_plat)
 
        setblocked(this, plat_crush);
 
-       if (!this.speed) this.speed = q3compat ? 200 : 150;
-       if (!this.lip) this.lip = q3compat ? 8 : 16;
+       if (!this.speed) this.speed = 150;
+       if (!this.lip) this.lip = 16;
        if (!this.height) this.height = this.size.z - this.lip;
 
        this.pos1 = this.origin;
@@ -207,8 +186,7 @@ NET_HANDLE(ENT_CLIENT_PLAT, bool isnew)
                set_movetype(this, MOVETYPE_PUSH);
                this.move_time = time;
 
-               if(!Q3COMPAT_COMMON || this.targetname == "")
-                       plat_spawn_inside_trigger(this);
+               plat_spawn_inside_trigger(this);
        }
 
        if(sf & SF_TRIGGER_RESET)
index 9e1f635b32c9982ab594d10c3036bad243f6e00e..28b420b20ab4f2ed6c49bde68e5383d365de1b6b 100644 (file)
@@ -173,21 +173,13 @@ void plat_use(entity this, entity actor, entity trigger)
        plat_go_down(this);
 }
 
-void plat_target_use(entity this, entity actor, entity trigger)
-{
-       if (this.state == STATE_TOP)
-               this.nextthink = this.ltime + 1;
-       else if (this.state != STATE_UP)
-               plat_go_up(this);
-}
-
 // WARNING: backwards compatibility because people don't use already existing fields :(
 // TODO: Check if any maps use these fields and remove these fields if it doesn't break maps
 .string sound1, sound2;
 
 void plat_reset(entity this)
 {
-       if(this.targetname && this.targetname != "" && !Q3COMPAT_COMMON)
+       if(this.targetname && this.targetname != "")
        {
                setorigin(this, this.pos1);
                this.state = STATE_UP;
@@ -197,7 +189,7 @@ void plat_reset(entity this)
        {
                setorigin(this, this.pos2);
                this.state = STATE_BOTTOM;
-               this.use = (this.targetname != "" && Q3COMPAT_COMMON) ? plat_target_use : plat_trigger_use;
+               this.use = plat_trigger_use;
        }
 
 #ifdef SVQC
index 2c03871ce54580335fe95adff435d86d4a555818..280267a9ad3de6368294cb332cc34a829c261720 100644 (file)
@@ -305,6 +305,7 @@ void W_Electro_Orb_Stick(entity this, entity to)
 
        newproj.owner = this.owner;
        newproj.realowner = this.realowner;
+       PROJECTILE_MAKETRIGGER(newproj);
        setorigin(newproj, this.origin);
        setmodel(newproj, MDL_PROJECTILE_ELECTRO);
        setsize(newproj, this.mins, this.maxs);
index c73db2bc28f1d9e634d87b36fc4a21b5146b6e39..63c7b9e44395cb62e21a3930e21ffb18704e765f 100644 (file)
@@ -18,6 +18,7 @@ void W_MineLayer_Stick(entity this, entity to)
 
        newmine.owner = this.owner;
        newmine.realowner = this.realowner;
+       PROJECTILE_MAKETRIGGER(newmine);
        setorigin(newmine, this.origin);
        setmodel(newmine, MDL_MINELAYER_MINE);
        setsize(newmine, '-4 -4 -4', '4 4 4');
index 300be79d87f282359f9d42f7bce7d6409639b4a3..7796cbccaa1de271031755ca8f1d7a6316aaa647 100644 (file)
@@ -126,7 +126,8 @@ void UpdateConWidthHeight(float w, float h, float p)
 {
        if (w != vidwidth_s || h != vidheight_s || p != vidpixelheight_s)
        {
-               if (updateConwidths(w, h, p)) localcmd(sprintf("\nexec %s\n", cvar_string("menu_font_cfg")));
+               if (updateConwidths(w, h, p) && menuNotTheFirstFrame)
+                       localcmd(sprintf("\nexec %s\n", cvar_string("menu_font_cfg")));
                vidwidth_s = w;
                vidheight_s = h;
                vidpixelheight_s = p;
index d6bc1e6708eefcb4459cbe9eabeeb4b405ce380c..8618dad98859fb7576550a4eb2e9bfabd649e920 100644 (file)
@@ -1563,9 +1563,9 @@ void waypoint_load_hardwiredlinks()
                {
                        waypoint_addlink(wp_from, wp_to);
                        waypoint_mark_hardwiredlink(wp_from, wp_to);
-               } else if ((wp_from.wpflags & WPFLAGMASK_NORELINK)
-                       && ((wp_from.wpflags & (WAYPOINTFLAG_JUMP | WAYPOINTFLAG_SUPPORT))
-                               || (wp_from.wpisbox && (wp_from.wpflags & WAYPOINTFLAG_TELEPORT))))
+               }
+               else if ((wp_from.wpflags & WPFLAGMASK_NORELINK) && ((wp_from.wpflags & (WAYPOINTFLAG_JUMP | WAYPOINTFLAG_SUPPORT))
+               || (wp_from.wpisbox && (wp_from.wpflags & WAYPOINTFLAG_TELEPORT))))
                {
                        waypoint_addlink(wp_from, wp_to);
                }
index ed8ba9a52e7dbe79a801f088dec2a5a3cc2c845b..23e11ec0098fd2187a863371593fed2f9de3c1c2 100644 (file)
@@ -577,8 +577,8 @@ bool Item_GiveTo(entity item, entity player)
                        Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_ITEM_JETPACK_GOT);
        }
 
-       int its;
-       if((its = (item.items - ((item.items & player.items)) & IT_PICKUPMASK)))
+       int its = (item.items - (item.items & player.items)) & IT_PICKUPMASK;
+       if (its)
        {
                pickedup = true;
                player.items |= its;
index ee35cedc51a55a4d56b244d829e513edd9e39b92..f6f451bce975246bdf8686f7f7dc683964b42a01 100644 (file)
@@ -468,32 +468,6 @@ string GetField_fullspawndata(entity e, string f, ...)
        return v;
 }
 
-/*
-=============
-FindFileInMapPack
-
-Returns the first matching VFS file path that exists in the current map's pack.
-Returns string_null if no files match or the map isn't packaged.
-=============
-*/
-string FindFileInMapPack(string pattern)
-{
-       if(!checkextension("DP_QC_FS_SEARCH_PACKFILE"))
-               return string_null;
-
-       string base_pack = whichpack(strcat("maps/", mapname, ".bsp"));
-       if(base_pack == "" || !base_pack) // this map isn't packaged or there was an error
-               return string_null;
-
-       int glob = search_packfile_begin(pattern, true, true, base_pack);
-       if(glob < 0)
-               return string_null;
-
-       string file = search_getfilename(glob, 0);
-       search_end(glob);
-       return file;
-}
-
 void WarpZone_PostInitialize_Callback()
 {
        // create waypoint links for warpzones