From: Mario Date: Sat, 14 Nov 2015 13:33:59 +0000 (+1000) Subject: Port 10 more X-Git-Tag: xonotic-v0.8.2~1609^2~13 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b9d31ef4dc4c897713b9b7bd211b04142353a091;p=xonotic%2Fxonotic-data.pk3dir.git Port 10 more --- diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 8fdefe0ec..55347c64d 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -475,12 +475,12 @@ void UpdateDamage() { // accumulate damage with each stat update static float damage_total_prev = 0; - float damage_total = getstati(STAT_DAMAGE_DEALT_TOTAL); + float damage_total = STAT(DAMAGE_DEALT_TOTAL); float unaccounted_damage_new = COMPARE_INCREASING(damage_total, damage_total_prev); damage_total_prev = damage_total; static float damage_dealt_time_prev = 0; - float damage_dealt_time = getstatf(STAT_HIT_TIME); + float damage_dealt_time = STAT(HIT_TIME); if (damage_dealt_time != damage_dealt_time_prev) { unaccounted_damage += unaccounted_damage_new; @@ -536,7 +536,7 @@ void HitSound() } static float typehit_time_prev = 0; - float typehit_time = getstatf(STAT_TYPEHIT_TIME); + float typehit_time = STAT(TYPEHIT_TIME); if (COMPARE_INCREASING(typehit_time, typehit_time_prev) > autocvar_cl_hitsound_antispam_time) { sound(world, CH_INFO, SND_TYPEHIT, VOL_BASE, ATTN_NONE); @@ -712,7 +712,7 @@ void HUD_Crosshair() if(autocvar_crosshair_pickup) { - float stat_pickup_time = getstatf(STAT_LAST_PICKUP); + float stat_pickup_time = STAT(LAST_PICKUP); if(pickup_crosshair_time < stat_pickup_time) { @@ -827,8 +827,8 @@ void HUD_Crosshair() ok_ammo_chargepool = getstatf(STAT_OK_AMMO_CHARGEPOOL); float vortex_charge, vortex_chargepool; - vortex_charge = getstatf(STAT_VORTEX_CHARGE); - vortex_chargepool = getstatf(STAT_VORTEX_CHARGEPOOL); + vortex_charge = STAT(VORTEX_CHARGE); + vortex_chargepool = STAT(VORTEX_CHARGEPOOL); float arc_heat = STAT(ARC_HEAT); @@ -859,14 +859,14 @@ void HUD_Crosshair() } else if (autocvar_crosshair_ring && activeweapon == WEP_MINE_LAYER.m_id && minelayer_maxmines && autocvar_crosshair_ring_minelayer) { - ring_value = bound(0, getstati(STAT_LAYED_MINES) / minelayer_maxmines, 1); // if you later need to use the count of bullets in another place, then add a float for it. For now, no need to. + ring_value = bound(0, STAT(LAYED_MINES) / minelayer_maxmines, 1); // if you later need to use the count of bullets in another place, then add a float for it. For now, no need to. ring_alpha = autocvar_crosshair_ring_minelayer_alpha; ring_rgb = wcross_color; ring_image = "gfx/crosshair_ring.tga"; } - else if (activeweapon == WEP_HAGAR.m_id && getstati(STAT_HAGAR_LOAD) && autocvar_crosshair_ring_hagar) + else if (activeweapon == WEP_HAGAR.m_id && STAT(HAGAR_LOAD) && autocvar_crosshair_ring_hagar) { - ring_value = bound(0, getstati(STAT_HAGAR_LOAD) / hagar_maxrockets, 1); + ring_value = bound(0, STAT(HAGAR_LOAD) / hagar_maxrockets, 1); ring_alpha = autocvar_crosshair_ring_hagar_alpha; ring_rgb = wcross_color; ring_image = "gfx/crosshair_ring.tga"; @@ -1065,7 +1065,7 @@ void CSQC_UpdateView(float w, float h) ++framecount; stats_get(); - hud = getstati(STAT_HUD); + hud = STAT(HUD); if(hud != HUD_NORMAL && lasthud == HUD_NORMAL) vh_notice_time = time + autocvar_cl_vehicles_notify_time; @@ -1389,7 +1389,7 @@ void CSQC_UpdateView(float w, float h) ColorTranslateMode = autocvar_cl_stripcolorcodes; // currently switching-to weapon (for crosshair) - switchingweapon = getstati(STAT_SWITCHINGWEAPON); + switchingweapon = STAT(SWITCHINGWEAPON); // actually active weapon (for zoom) activeweapon = getstati(STAT_ACTIVEWEAPON); diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index 5e29b2f9d..084a00155 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -89,7 +89,7 @@ enum { STAT_LAST_VECTOR }; -const int REGISTERED_STATS = 14; +const int REGISTERED_STATS = 24; REGISTER_STAT(KH_KEYS, int) /** weapon requested to switch to; next WANTED weapon (for HUD) */ @@ -110,19 +110,20 @@ REGISTER_STAT(LEADLIMIT, float) REGISTER_STAT(WEAPON_CLIPLOAD, int) REGISTER_STAT(WEAPON_CLIPSIZE, int) +REGISTER_STAT(VORTEX_CHARGE, float) +REGISTER_STAT(LAST_PICKUP, float) +REGISTER_STAT(HUD, int) +REGISTER_STAT(VORTEX_CHARGEPOOL, float) +REGISTER_STAT(HIT_TIME, float) +REGISTER_STAT(DAMAGE_DEALT_TOTAL, int) +REGISTER_STAT(TYPEHIT_TIME, float) +REGISTER_STAT(LAYED_MINES, int) +REGISTER_STAT(HAGAR_LOAD, int) +REGISTER_STAT(SWITCHINGWEAPON, int) + enum { STAT_FIRST_MAIN = (STAT_LAST_VECTOR - 1) + REGISTERED_STATS, - STAT_VORTEX_CHARGE, - STAT_LAST_PICKUP, - STAT_HUD, - STAT_VORTEX_CHARGEPOOL, - STAT_HIT_TIME, - STAT_DAMAGE_DEALT_TOTAL, - STAT_TYPEHIT_TIME, - STAT_LAYED_MINES, - STAT_HAGAR_LOAD, - STAT_SWITCHINGWEAPON, STAT_SUPERWEAPONS_FINISHED, STAT_VEHICLESTAT_HEALTH, STAT_VEHICLESTAT_SHIELD, diff --git a/qcsrc/common/vehicles/all.qc b/qcsrc/common/vehicles/all.qc index c7b845822..f737f4a42 100644 --- a/qcsrc/common/vehicles/all.qc +++ b/qcsrc/common/vehicles/all.qc @@ -7,7 +7,6 @@ STATIC_INIT(vehicles_common_initialize) { #ifdef SVQC - addstat(STAT_HUD, AS_INT, hud); addstat(STAT_VEHICLESTAT_HEALTH, AS_INT, vehicle_health); addstat(STAT_VEHICLESTAT_SHIELD, AS_INT, vehicle_shield); addstat(STAT_VEHICLESTAT_ENERGY, AS_INT, vehicle_energy); diff --git a/qcsrc/common/vehicles/sv_vehicles.qh b/qcsrc/common/vehicles/sv_vehicles.qh index b3f252e3b..6da75bf60 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qh +++ b/qcsrc/common/vehicles/sv_vehicles.qh @@ -61,7 +61,7 @@ const float SVC_UPDATEENTITY = 128; // Net.Protocol 0x80 const float VHSF_NORMAL = 0; const float VHSF_FACTORY = 2; -.int hud; +.int hud = _STAT(HUD); .float dmg_time; .int volly_counter; diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index eb40628ef..1d10f4b29 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -158,7 +158,7 @@ const float MAX_DAMAGEEXTRARADIUS = 16; //.int weapon; // current weapon .int switchweapon = _STAT(SWITCHWEAPON); -.int switchingweapon; // weapon currently being switched to (is copied from switchweapon once switch is possible) +.int switchingweapon = _STAT(SWITCHINGWEAPON); // weapon currently being switched to (is copied from switchweapon once switch is possible) .string weaponname; // name of .weapon // WEAPONTODO @@ -447,12 +447,12 @@ float servertime, serverprevtime, serverframetime; string matchid; -.float last_pickup; +.float last_pickup = _STAT(LAST_PICKUP); -.float hit_time; -.float typehit_time; +.float hit_time = _STAT(HIT_TIME); +.float typehit_time = _STAT(TYPEHIT_TIME); -.float damage_dealt_total; +.float damage_dealt_total = _STAT(DAMAGE_DEALT_TOTAL); .float stat_leadlimit = _STAT(LEADLIMIT); @@ -469,11 +469,11 @@ float client_cefc_accumulatortime; .float old_clip_load; .float clip_size = _STAT(WEAPON_CLIPSIZE); -.float minelayer_mines; -.float vortex_charge; +.float minelayer_mines = _STAT(LAYED_MINES); +.float vortex_charge = _STAT(VORTEX_CHARGE); .float vortex_charge_rottime; -.float vortex_chargepool_ammo; -.float hagar_load; +.float vortex_chargepool_ammo = _STAT(VORTEX_CHARGEPOOL); +.float hagar_load = _STAT(HAGAR_LOAD); .int grab; // 0 = can't grab, 1 = owner can grab, 2 = owner and team mates can grab, 3 = anyone can grab diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index e7a079a57..569b5c35f 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -757,22 +757,11 @@ spawnfunc(worldspawn) WepSet_AddStat(); WepSet_AddStat_InMap(); - addstat(STAT_SWITCHINGWEAPON, AS_INT, switchingweapon); addstat(STAT_ROUNDSTARTTIME, AS_FLOAT, stat_round_starttime); Nagger_Init(); addstat(STAT_SUPERWEAPONS_FINISHED, AS_FLOAT, superweapons_finished); addstat(STAT_PLASMA, AS_INT, ammo_plasma); - 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); - - addstat(STAT_VORTEX_CHARGE, AS_FLOAT, vortex_charge); - addstat(STAT_VORTEX_CHARGEPOOL, AS_FLOAT, vortex_chargepool_ammo); - - addstat(STAT_HAGAR_LOAD, AS_INT, hagar_load); // freeze attacks addstat(STAT_FROZEN, AS_INT, frozen); diff --git a/qcsrc/server/weapons/accuracy.qc b/qcsrc/server/weapons/accuracy.qc index 211ef8cec..b92a21da2 100644 --- a/qcsrc/server/weapons/accuracy.qc +++ b/qcsrc/server/weapons/accuracy.qc @@ -58,7 +58,7 @@ void accuracy_resend(entity e) } // update accuracy stats -.float hit_time; +//.float hit_time; .float fired_time; void accuracy_add(entity this, int w, int fired, int hit)