X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2FMain.qc;h=d6b00ec9f55182fdee763ce20adb3a7a0639d275;hb=40446bc724449798458a701c5311b9dba1ea161f;hp=7d85532ba54e51a84f4756ab0ecc65a26f574e23;hpb=29885aa67f14a0fd7d7bc66b134eb7a2e5dfcba4;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 7d85532ba..d6b00ec9f 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -28,41 +28,19 @@ void menu_sub_null() { } -#ifdef USE_FTE -float __engine_check; -#endif - string forcefog; void WaypointSprite_Load(); void ConsoleCommand_macro_init(); void CSQC_Init(void) { prvm_language = cvar_string("prvm_language"); -#ifdef USE_FTE -#pragma target ID - __engine_check = checkextension("DP_SV_WRITEPICTURE"); - if(!__engine_check) - { - print(_("^3Your engine build is outdated\n^3This Server uses a newer QC VM. Please update!\n")); - localcmd("\ndisconnect\n"); - return; - } -#pragma target FTE -#endif - - check_unacceptable_compiler_bugs(); #ifdef WATERMARK - printf(_("^4CSQC Build information: ^1%s\n"), WATERMARK); + dprintf("^4CSQC Build information: ^1%s\n", WATERMARK); #endif float i; -#ifdef COMPAT_XON050_ENGINE - // old engine lacks implementation of player_localnum - player_localnum = player_localentnum - 1; -#endif - binddb = db_create(); tempdb = db_create(); ClientProgsDB = db_load("client.db"); @@ -96,6 +74,8 @@ void CSQC_Init(void) for(i = 0; i < MAX_HUD_FIELDS; ++i) hud_title[i] = strzone("(null)"); + Cmd_HUD_SetFields(0); + postinit = false; calledhooks = 0; @@ -165,13 +145,6 @@ void CSQC_Init(void) // CSQC_Shutdown : Called every time the CSQC code is shutdown (changing maps, quitting, etc) void Shutdown(void) { -#ifdef USE_FTE -#pragma TARGET id - if(!__engine_check) - return 0; -#pragma TARGET fte -#endif - WarpZone_Shutdown(); remove(teams); @@ -315,8 +288,6 @@ void Porto_Init(); void TrueAim_Init(); void PostInit(void) { - localcmd(strcat("\nscoreboard_columns_set ", autocvar_scoreboard_columns, ";\n")); - entity playerchecker; playerchecker = spawn(); playerchecker.think = Playerchecker_Think; @@ -547,7 +518,7 @@ void Ent_ClientData() } spectatee_status = newspectatee_status; - // non-COMPAT_XON050_ENGINE: we could get rid of spectatee_status, and derive it from player_localentnum and player_localnum + // we could get rid of spectatee_status, and derive it from player_localentnum and player_localnum } void Ent_Nagger() @@ -605,6 +576,27 @@ void Ent_Nagger() warmup_stage = (nags & 16); } +void Ent_EliminatedPlayers() +{ + float sf, i, j, b, f; + + sf = ReadByte(); + if(sf & 1) + { + for(j = 0; j < maxclients; ++j) + if(playerslots[j]) + playerslots[j].eliminated = 1; + for(i = 1; i <= maxclients; i += 8) + { + f = ReadByte(); + for(j = i-1, b = 1; b < 256; b *= 2, ++j) + if (!(f & b)) + if(playerslots[j]) + playerslots[j].eliminated = 0; + } + } +} + void Ent_RandomSeed() { float s; @@ -803,6 +795,7 @@ void CSQC_Ent_Update(float bIsNewEntity) case ENT_CLIENT_RAINSNOW: Ent_RainOrSnow(); break; case ENT_CLIENT_LASER: Ent_Laser(); break; case ENT_CLIENT_NAGGER: Ent_Nagger(); break; + case ENT_CLIENT_ELIMINATEDPLAYERS: Ent_EliminatedPlayers(); break; case ENT_CLIENT_WAYPOINT: Ent_WaypointSprite(); break; case ENT_CLIENT_RADARLINK: Ent_RadarLink(); break; case ENT_CLIENT_PROJECTILE: Ent_Projectile(); break; @@ -836,7 +829,7 @@ void CSQC_Ent_Update(float bIsNewEntity) default: //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)); + 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; } @@ -940,11 +933,15 @@ void Ent_ScoresInfo() HUD_ModIcons_SetFunc(); for(i = 0; i < MAX_SCORE; ++i) { + if(scores_label[i]) + strunzone(scores_label[i]); scores_label[i] = strzone(ReadString()); scores_flags[i] = ReadByte(); } for(i = 0; i < MAX_TEAMSCORE; ++i) { + if(teamscores_label[i]) + strunzone(teamscores_label[i]); teamscores_label[i] = strzone(ReadString()); teamscores_flags[i] = ReadByte(); } @@ -973,8 +970,8 @@ void Ent_Init() armorblockpercent = ReadByte() / 255.0; - g_balance_grenadelauncher_bouncefactor = ReadCoord(); - g_balance_grenadelauncher_bouncestop = ReadCoord(); + g_balance_mortar_bouncefactor = ReadCoord(); + g_balance_mortar_bouncestop = ReadCoord(); g_balance_electro_secondary_bouncefactor = ReadCoord(); g_balance_electro_secondary_bouncestop = ReadCoord(); @@ -1300,7 +1297,7 @@ string getcommandkey(string text, string command) return text; } else if (autocvar_hud_showbinds > 1) - return sprintf(_("%s (%s)"), text, keys); + return sprintf("%s (%s)", text, keys); else return keys; }