]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/Main.qc
try fixing issues with cl_gunalign
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / Main.qc
index b34e843793311ddfc9a13b9dcd3450daf24409a7..7f6b9ea238a18f22db08529b738e6fb7ace80da5 100644 (file)
@@ -183,6 +183,7 @@ void CSQC_Init(void)
        minimapname = strzone(minimapname);
 
        WarpZone_Init();
+       hud_configure_prev = -1;
 }
 
 // CSQC_Shutdown : Called every time the CSQC code is shutdown (changing maps, quitting, etc)
@@ -212,9 +213,9 @@ void CSQC_Shutdown(void)
        if not(isdemo())
        {
                if not(calledhooks & HOOK_START)
-                       localcmd("\n_cl_hook_gamestart nop;");
+                       localcmd("\n_cl_hook_gamestart nop\n");
                if not(calledhooks & HOOK_END)
-                       localcmd("\ncl_hook_gameend;");
+                       localcmd("\ncl_hook_gameend\n");
        }
 }
 
@@ -964,7 +965,7 @@ void Gamemode_Init()
 
        if not(isdemo())
        {
-               localcmd("\n_cl_hook_gamestart ", GametypeNameFromType(gametype), ";");
+               localcmd("\n_cl_hook_gamestart ", GametypeNameFromType(gametype), "\n");
                calledhooks |= HOOK_START;
        }
 }
@@ -1021,9 +1022,14 @@ void Ent_Init()
 
        nb_pb_period = ReadByte() / 32; //Accuracy of 1/32th
 
-       hook_shotorigin_x = ReadCoord();
-       hook_shotorigin_y = ReadCoord();
-       hook_shotorigin_z = ReadCoord();
+       hook_shotorigin[0] = decompressShotOrigin(ReadInt24_t());
+       hook_shotorigin[1] = decompressShotOrigin(ReadInt24_t());
+       hook_shotorigin[2] = decompressShotOrigin(ReadInt24_t());
+       hook_shotorigin[3] = decompressShotOrigin(ReadInt24_t());
+       electro_shotorigin[0] = decompressShotOrigin(ReadInt24_t());
+       electro_shotorigin[1] = decompressShotOrigin(ReadInt24_t());
+       electro_shotorigin[2] = decompressShotOrigin(ReadInt24_t());
+       electro_shotorigin[3] = decompressShotOrigin(ReadInt24_t());
 
        if(forcefog)
                strunzone(forcefog);
@@ -1223,13 +1229,13 @@ void Net_ReadPingPLReport()
 
 void Net_VoteDialog(float highlight) {
        if(highlight) {
-               vote_highlighted = ReadShort();
+               vote_highlighted = ReadByte();
                return;
        }
 
-       vote_yescount = ReadShort();
-       vote_nocount = ReadShort();
-       vote_needed = ReadShort();
+       vote_yescount = ReadByte();
+       vote_nocount = ReadByte();
+       vote_needed = ReadByte();
        vote_active = 1;
 }
 
@@ -1251,6 +1257,18 @@ void Net_Notify() {
        }
 }
 
+void Net_WeaponComplain() {
+       complain_weapon = ReadByte();
+
+       if(complain_weapon_name)
+               strunzone(complain_weapon_name);
+       complain_weapon_name = strzone(ReadString());
+
+       complain_weapon_type = ReadByte();
+
+       complain_weapon_time = time;
+}
+
 // CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer.
 // You must ALWAYS first acquire the temporary ID, which is sent as a byte.
 // Return value should be 1 if CSQC handled the temporary entity, otherwise return 0 to have the engine process the event.
@@ -1277,7 +1295,7 @@ float CSQC_Parse_TempEntity()
                        Net_ReadRace();
                        bHandled = true;
                        break;
-               case 13: // TE_BEAM
+               case TE_CSQC_BEAM:
                        Net_GrapplingHook();
                        bHandled = true;
                        break;
@@ -1321,6 +1339,10 @@ float CSQC_Parse_TempEntity()
                        Net_Notify();
                        bHandled = true;
                        break;
+               case TE_CSQC_WEAPONCOMPLAIN:
+                       Net_WeaponComplain();
+                       bHandled = true;
+                       break;
                default:
                        // No special logic for this temporary entity; return 0 so the engine can handle it
                        bHandled = false;