]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
Added strlcat and strlcpy, from OpenBSD. They are smart replacements for strncat...
[xonotic/darkplaces.git] / cl_parse.c
index 38de3397371a68e4c877cb6478c2139ced42c77c..c5f78db044bb4411ed7e3f2b329286379a364d75 100644 (file)
@@ -807,11 +807,14 @@ void CL_ParseClientdata (int bits)
        cl.stats[STAT_CELLS] = MSG_ReadByte();
 
        i = MSG_ReadByte ();
-
        if (gamemode == GAME_HIPNOTIC || gamemode == GAME_ROGUE)
-               cl.stats[STAT_ACTIVEWEAPON] = (1<<i);
-       else
-               cl.stats[STAT_ACTIVEWEAPON] = i;
+               i = (1<<i);
+       // GAME_NEXUIZ hud needs weapon change time
+       // GAME_NEXUIZ uses a bit number as it's STAT_ACTIVEWEAPON, not a bitfield
+       // like other modes
+       if (cl.stats[STAT_ACTIVEWEAPON] != i)
+               cl.weapontime = cl.time;
+       cl.stats[STAT_ACTIVEWEAPON] = i;
 
        cl.viewzoomold = cl.viewzoomnew; // for interpolation
        if (bits & SU_VIEWZOOM)