X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_world.qc;h=f97a4254dff37f194d242f65119cfe6f55e624b8;hb=e3c57d4e706a9ee1342e25a178955162f4f5925f;hp=bd685ba1f032c60546b8eac92db68d307665ebae;hpb=2b89f5bdd3be253aa44320dc71f70f283df3b5ee;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index bd685ba1f..f97a4254d 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -81,32 +81,6 @@ void SetDefaultAlpha() } } -void fteqcc_testbugs() -{ - float a, b; - - if(!autocvar_developer_fteqccbugs) - return; - - dprint("*** fteqcc test: checking for bugs...\n"); - - a = 1; - b = 5; - if(sqrt(a) - sqrt(b - a) == 0) - dprint("*** fteqcc test: found same-function-twice bug\n"); - else - dprint("*** fteqcc test: same-function-twice bug got FINALLY FIXED! HOORAY!\n"); - - world.cnt = -10; - world.enemy = world; - world.enemy.cnt += 10; - if(world.cnt > 0.2 || world.cnt < -0.2) // don't error out if it's just roundoff errors - dprint("*** fteqcc test: found += bug\n"); - else - dprint("*** fteqcc test: += bug got FINALLY FIXED! HOORAY!\n"); - world.cnt = 0; -} - void GotoFirstMap() { float n; @@ -420,7 +394,7 @@ void cvar_changes_init() BADPREFIX("sv_ready_restart_"); // mutators that announce themselves properly to the server browser - BADCVAR("g_minstagib"); + BADCVAR("g_instagib"); BADCVAR("g_new_toys"); BADCVAR("g_nix"); BADCVAR("g_grappling_hook"); @@ -572,8 +546,6 @@ void spawnfunc_worldspawn (void) remove = remove_safely; // during spawning, watch what you remove! - check_unacceptable_compiler_bugs(); - cvar_changes_init(); // do this very early now so it REALLY matches the server config compressShortVector_init(); @@ -647,7 +619,7 @@ void spawnfunc_worldspawn (void) Map_MarkAsRecent(mapname); - PlayerStats_Init(); // we need this to be initiated before InitGameplayMode + PlayerStats_GameReport_Init(); // we need this to be initiated before InitGameplayMode precache_model ("null"); // we need this one before InitGameplayMode InitGameplayMode(); @@ -722,8 +694,6 @@ void spawnfunc_worldspawn (void) if(autocvar_g_campaign) CampaignPostInit(); - fteqcc_testbugs(); - Ban_LoadBans(); MapInfo_Enumerate(); @@ -771,7 +741,7 @@ void spawnfunc_worldspawn (void) addstat(STAT_SWITCHINGWEAPON, AS_INT, switchingweapon); addstat(STAT_GAMESTARTTIME, AS_FLOAT, stat_game_starttime); addstat(STAT_ROUNDSTARTTIME, AS_FLOAT, stat_round_starttime); - addstat(STAT_ALLOW_OLDNEXBEAM, AS_INT, stat_allow_oldnexbeam); + addstat(STAT_ALLOW_OLDVORTEXBEAM, AS_INT, stat_allow_oldvortexbeam); Nagger_Init(); addstat(STAT_STRENGTH_FINISHED, AS_FLOAT, strength_finished); @@ -785,7 +755,7 @@ void spawnfunc_worldspawn (void) addstat(STAT_WEAPON_CLIPLOAD, AS_INT, clip_load); addstat(STAT_WEAPON_CLIPSIZE, AS_INT, clip_size); addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup); - addstat(STAT_HIT_TIME, AS_FLOAT, hit_time); + addstat(STAT_DAMAGE_DEALT_TOTAL, AS_INT, damage_dealt_total); addstat(STAT_TYPEHIT_TIME, AS_FLOAT, typehit_time); addstat(STAT_LAYED_MINES, AS_INT, minelayer_mines); @@ -793,6 +763,8 @@ void spawnfunc_worldspawn (void) addstat(STAT_VORTEX_CHARGEPOOL, AS_FLOAT, vortex_chargepool_ammo); addstat(STAT_HAGAR_LOAD, AS_INT, hagar_load); + + addstat(STAT_ARC_HEAT, AS_FLOAT, arc_heat_percent); // freeze attacks addstat(STAT_FROZEN, AS_INT, frozen); @@ -1527,11 +1499,7 @@ void NextLevel() DumpStats(TRUE); // send statistics - entity e; - PlayerStats_EndMatch(1); - FOR_EACH_CLIENT(e) - PlayerStats_AddGlobalInfo(e); - PlayerStats_Shutdown(); + PlayerStats_GameReport(TRUE); WeaponStats_Shutdown(); Kill_Notification(NOTIF_ALL, world, MSG_CENTER, 0); // kill all centerprints now @@ -2235,19 +2203,21 @@ void EndFrame() float altime; FOR_EACH_REALCLIENT(self) { + self.damage_dealt_total = 0; + if(IS_SPEC(self)) { if(self.enemy.typehitsound) self.typehit_time = time; - else if(self.enemy.hitsound) - self.hit_time = time; + else if(self.enemy.damage_dealt) + self.damage_dealt_total = ceil(self.enemy.damage_dealt); } else { if(self.typehitsound) self.typehit_time = time; - else if(self.hitsound) - self.hit_time = time; + else if(self.damage_dealt) + self.damage_dealt_total = ceil(self.damage_dealt); } } altime = time + frametime * (1 + autocvar_g_antilag_nudge); @@ -2258,10 +2228,12 @@ void EndFrame() // needed! FOR_EACH_CLIENT(self) { - self.hitsound = FALSE; self.typehitsound = FALSE; + self.damage_dealt = 0; antilag_record(self, altime); } + FOR_EACH_MONSTER(self) + antilag_record(self, altime); } @@ -2333,8 +2305,6 @@ void RestoreGame() void Shutdown() { - entity e; - gameover = 2; if(world_initialized > 0) @@ -2343,10 +2313,8 @@ void Shutdown() print("Saving persistent data...\n"); Ban_SaveBans(); - PlayerStats_EndMatch(0); - FOR_EACH_CLIENT(e) - PlayerStats_AddGlobalInfo(e); - PlayerStats_Shutdown(); + // playerstats with unfinished match + PlayerStats_GameReport(FALSE); if(!cheatcount_total) {