X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2FMain.qc;h=0cc1563916a035793579d15b412c98f10af3e3df;hb=7f2227f07a84c570ba8e289d313c7da3453fb55f;hp=ddace6382ac4a0db186730d120af9303fcfde33d;hpb=2547fdbb338d37427cc482fbfad58f524835dbec;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index ddace6382..0cc156391 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -91,10 +91,6 @@ void CSQC_Init(void) registercmd("hud_save"); //registercmd("menu_action"); - registercmd("+button3"); - registercmd("-button3"); - registercmd("+button4"); - registercmd("-button4"); registercmd("+showscores");registercmd("-showscores"); registercmd("+showaccuracy");registercmd("-showaccuracy"); @@ -373,29 +369,6 @@ float CSQC_ConsoleCommand(string strMessage) else HUD_Panel_ExportCfg(argv(1)); return true; - } else if(strCmd == "+button4") { // zoom - // return false, because the message shall be sent to the server anyway (for demos/speccing) - if(ignore_plus_zoom) - { - --ignore_plus_zoom; - return false; - } - button_zoom = 1; - return true; - } else if(strCmd == "-button4") { // zoom - if(ignore_minus_zoom) - { - --ignore_minus_zoom; - return false; - } - button_zoom = 0; - return true; - } else if(strCmd == "+button3") { // secondary - button_attack2 = 1; - return false; - } else if(strCmd == "-button3") { // secondary - button_attack2 = 0; - return false; } else if(strCmd == "+showscores") { scoreboard_showscores = true; return true; @@ -681,17 +654,38 @@ float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary) // -------------------------------------------------------------------------- // BEGIN OPTIONAL CSQC FUNCTIONS +void Ent_RemoveEntCS() +{ + entcs_receiver[self.sv_entnum] = world; +} void Ent_ReadEntCS() { + float sf; InterpolateOrigin_Undo(); self.classname = "entcs_receiver"; - self.sv_entnum = ReadByte() - 1; - self.origin_x = ReadShort(); - self.origin_y = ReadShort(); - self.origin_z = ReadShort(); - self.angles_y = ReadByte() * 360.0 / 256; - self.origin_z = self.angles_x = self.angles_z = 0; + sf = ReadByte(); + + if(sf & 1) + self.sv_entnum = ReadByte(); + if(sf & 2) + { + self.origin_x = ReadShort(); + self.origin_y = ReadShort(); + self.origin_z = ReadShort(); + } + if(sf & 4) + { + self.angles_y = ReadByte() * 360.0 / 256; + self.angles_x = self.angles_z = 0; + } + if(sf & 8) + self.healthvalue = ReadByte() * 10; + if(sf & 16) + self.armorvalue = ReadByte() * 10; + + entcs_receiver[self.sv_entnum] = self; + self.entremove = Ent_RemoveEntCS; InterpolateOrigin_Note(); } @@ -725,7 +719,8 @@ void Ent_ReadPlayerScore() #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED if(!isNew && n != self.sv_entnum) { - print(_("A CSQC entity changed its owner!\n")); + //print(_("A CSQC entity changed its owner!\n")); + print(sprintf(_("A CSQC entity changed its owner! (edict: %d, classname: %s)\n"), num_for_edict(self), self.classname)); isNew = true; Ent_Remove(); self.enttype = ENT_CLIENT_SCORES; @@ -797,10 +792,6 @@ void Ent_ReadTeamScore() HUD_UpdateTeamPos(o); } -void Net_Reset() -{ -} - void Ent_ClientData() { float f; @@ -920,41 +911,6 @@ void Ent_ReadAccuracy(void) } } -void Ent_ShowNames() -{ - float sf; - - // entity init, TODO can this be done only once somehow? - self.the_entnum = ReadByte(); // TODO: fixme to only send once somehow - self.draw2d = Draw_ShowNames; - //self.movetype = MOVETYPE_FLY; // movetype needed so we can traceline? - self.mins = '-20 -20 -24'; - self.maxs = '20 20 45'; - self.classname = "shownames_tag"; - - sf = ReadByte(); - - if(sf & 1) - { - self.origin_x = ReadShort(); - self.origin_y = ReadShort(); - self.origin_z = ReadShort(); - } - if(sf & 2) - { - self.healthvalue = ReadByte(); - } - if(sf & 4) - { - self.armorvalue = ReadByte(); - } - - if(sf & 128) // same team - self.sameteam = TRUE; - else - self.sameteam = FALSE; -} - // CSQC_Ent_Update : Called every frame that the server has indicated an update to the SSQC / CSQC entity has occured. // The only parameter reflects if the entity is "new" to the client, meaning it just came into the client's PVS. void Ent_RadarLink(); @@ -983,7 +939,8 @@ void(float bIsNewEntity) CSQC_Ent_Update = if(self.enttype) if(t != self.enttype) { - print(_("A CSQC entity changed its type!\n")); + //print(_("A CSQC entity changed its type!\n")); + print(sprintf(_("A CSQC entity changed its type! (edict: %d, classname: %s)\n"), num_for_edict(self), self.classname)); Ent_Remove(); bIsNewEntity = 1; } @@ -1020,9 +977,9 @@ void(float bIsNewEntity) CSQC_Ent_Update = case ENT_CLIENT_LGBEAM: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_LGBEAM); break; case ENT_CLIENT_GAUNTLET: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_GAUNTLET); break; case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break; - case ENT_CLIENT_SHOWNAMES: Ent_ShowNames(); break; default: - error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype)); + //error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype)); + error(sprintf(_("Unknown entity type in CSQC_Ent_Update (enttype: %d, edict: %d, classname: %s)\n"), self.enttype, num_for_edict(self), self.classname)); break; } @@ -1138,12 +1095,14 @@ void Ent_Init() g_balance_electro_secondary_bouncestop = ReadCoord(); nex_scope = !ReadByte(); - sniperrifle_scope = !ReadByte(); + rifle_scope = !ReadByte(); serverflags = ReadByte(); minelayer_maxmines = ReadByte(); + hagar_maxrockets = ReadByte(); + g_trueaim_minrange = ReadCoord(); if(!postinit)