From 0867c172113ac094aafe7271a296eaf4612f3c09 Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Thu, 4 Mar 2021 04:07:09 +0100 Subject: [PATCH] Poke646: Fix to make it compile again with the new networking. Team Fortress: Ditto --- poke646/src/server/gamerules.qc | 95 ----- poke646/src/server/gamerules_multiplayer.qc | 1 - poke646/src/shared/player.qc | 444 +++++++++++++++++++- poke646/src/shared/w_bradnailer.qc | 6 +- poke646/src/shared/w_cmlwbr.qc | 4 +- poke646/src/shared/w_heaterpipe.qc | 4 +- poke646/src/shared/w_nailgun.qc | 4 +- poke646/src/shared/w_pipebomb.qc | 18 +- poke646/src/shared/w_shotgun.qc | 2 +- poke646/src/shared/w_xs.qc | 4 +- rewolf/src/client/hud.qc | 6 + tfc/src/server/gamerules.qc | 2 +- tfc/src/server/spawn.qc | 2 +- valve/src/shared/w_shotgun.qc | 53 ++- 14 files changed, 495 insertions(+), 150 deletions(-) diff --git a/poke646/src/server/gamerules.qc b/poke646/src/server/gamerules.qc index d1589792..33f8a820 100644 --- a/poke646/src/server/gamerules.qc +++ b/poke646/src/server/gamerules.qc @@ -14,107 +14,12 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -var int autocvar_sv_playerkeepalive = TRUE; - /* we check what fields have changed over the course of the frame and network * only the ones that have actually changed */ void HLGameRules::PlayerPostFrame(base_player pp) { - player pl = (player)pp; - Animation_PlayerUpdate(); - - if (autocvar_sv_playerkeepalive) - pl.SendFlags |= PLAYER_KEEPALIVE; - - if (pl.old_modelindex != pl.modelindex) - pl.SendFlags |= PLAYER_MODELINDEX; - - if (pl.old_origin[0] != pl.origin[0]) - pl.SendFlags |= PLAYER_ORIGIN; - - if (pl.old_origin[1] != pl.origin[1]) - pl.SendFlags |= PLAYER_ORIGIN; - - if (pl.old_origin[2] != pl.origin[2]) - pl.SendFlags |= PLAYER_ORIGIN_Z; - - if (pl.old_angles[0] != pl.v_angle[0]) - pl.SendFlags |= PLAYER_ANGLES_X; - - if (pl.old_angles[1] != pl.angles[1]) - pl.SendFlags |= PLAYER_ANGLES_Y; - - if (pl.old_angles[2] != pl.angles[2]) - pl.SendFlags |= PLAYER_ANGLES_Z; - - if (pl.old_velocity[0] != pl.velocity[0]) - pl.SendFlags |= PLAYER_VELOCITY; - - if (pl.old_velocity[1] != pl.velocity[1]) - pl.SendFlags |= PLAYER_VELOCITY; - - if (pl.old_velocity[2] != pl.velocity[2]) - pl.SendFlags |= PLAYER_VELOCITY_Z; - - if (pl.old_flags != pl.flags) - pl.SendFlags |= PLAYER_FLAGS; - - if (pl.old_gflags != pl.gflags) - pl.SendFlags |= PLAYER_FLAGS; - - if (pl.old_activeweapon != pl.activeweapon) - pl.SendFlags |= PLAYER_WEAPON; - - if (pl.old_items != pl.g_items) - pl.SendFlags |= PLAYER_ITEMS; - - if (pl.old_health != pl.health) - pl.SendFlags |= PLAYER_HEALTH; - - if (pl.old_armor != pl.armor) - pl.SendFlags |= PLAYER_ARMOR; - - if (pl.old_movetype != pl.movetype) - pl.SendFlags |= PLAYER_MOVETYPE; - - if (pl.old_viewofs != pl.view_ofs[2]) - pl.SendFlags |= PLAYER_VIEWOFS; - - if (pl.old_baseframe != pl.baseframe) - pl.SendFlags |= PLAYER_BASEFRAME; - - if (pl.old_frame != pl.frame) - pl.SendFlags |= PLAYER_FRAME; - - if (pl.old_a_ammo1 != pl.a_ammo1) - pl.SendFlags |= PLAYER_AMMO1; - - if (pl.old_a_ammo2 != pl.a_ammo2) - pl.SendFlags |= PLAYER_AMMO2; - - if (pl.old_a_ammo3 != pl.a_ammo3) - pl.SendFlags |= PLAYER_AMMO3; - - pl.old_modelindex = pl.modelindex; - pl.old_origin = pl.origin; - pl.old_angles = pl.angles; - pl.old_angles[0] = pl.v_angle[0]; - pl.old_velocity = pl.velocity; - pl.old_flags = pl.flags; - pl.old_gflags = pl.gflags; - pl.old_activeweapon = pl.activeweapon; - pl.old_items = pl.g_items; - pl.old_health = pl.health; - pl.old_armor = pl.armor; - pl.old_movetype = pl.movetype; - pl.old_viewofs = pl.view_ofs[2]; - pl.old_baseframe = pl.baseframe; - pl.old_frame = pl.frame; - pl.old_a_ammo1 = pl.a_ammo1; - pl.old_a_ammo2 = pl.a_ammo2; - pl.old_a_ammo3 = pl.a_ammo3; } void diff --git a/poke646/src/server/gamerules_multiplayer.qc b/poke646/src/server/gamerules_multiplayer.qc index fa845b6b..2e5848bf 100644 --- a/poke646/src/server/gamerules_multiplayer.qc +++ b/poke646/src/server/gamerules_multiplayer.qc @@ -87,7 +87,6 @@ HLMultiplayerRules::PlayerSpawn(base_player pp) pl.velocity = [0,0,0]; pl.gravity = __NULL__; pl.frame = 1; - pl.SendEntity = Player_SendEntity; pl.SendFlags = UPDATE_ALL; pl.customphysics = Empty; pl.iBleeds = TRUE; diff --git a/poke646/src/shared/player.qc b/poke646/src/shared/player.qc index be4cee25..e3b1ae8c 100644 --- a/poke646/src/shared/player.qc +++ b/poke646/src/shared/player.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2021 Marco Hladik * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -14,12 +14,50 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -int input_sequence; +/* all potential SendFlags bits we can possibly send */ +enumflags +{ + PLAYER_KEEPALIVE, + PLAYER_MODELINDEX, + PLAYER_ORIGIN, + PLAYER_ORIGIN_Z, + PLAYER_ANGLES_X, + PLAYER_ANGLES_Y, + PLAYER_ANGLES_Z, + PLAYER_VELOCITY, + PLAYER_VELOCITY_Z, + PLAYER_FLAGS, + PLAYER_WEAPON, + PLAYER_ITEMS, + PLAYER_HEALTH, + PLAYER_ARMOR, + PLAYER_MOVETYPE, + PLAYER_VIEWOFS, + PLAYER_BASEFRAME, + PLAYER_FRAME, + PLAYER_AMMO1, + PLAYER_AMMO2, + PLAYER_AMMO3, + PLAYER_UNUSED1, + PLAYER_UNUSED2 +}; +noref int input_sequence; class player:base_player { - /* Weapon specific */ + int bradnailer_mag; int bradnailer_mag_net; + int nailgun_mag; int nailgun_mag_net; + int shotgun_mag; int shotgun_mag_net; + int cmlwbr_mag; int cmlwbr_mag_net; + int xs_mag; int xs_mag_net; + int satchel_chg; int satchel_chg_net; + + int ammo_nail; int ammo_nail_net; + int ammo_buckshot; int ammo_buckshot_net; + int ammo_bolts; int ammo_bolts_net; + int ammo_xencandy; int ammo_xencandy_net; + int ammo_satchel; int ammo_satchel_net; #ifdef CLIENT /* External model */ @@ -32,19 +70,395 @@ class player:base_player virtual void(void) draw; virtual float() predraw; virtual void(void) postdraw; + virtual void(float) ReceiveEntity; + virtual void(void) PredictPreFrame; + virtual void(void) PredictPostFrame; #else - int ammo_nail; - int ammo_buckshot; - int ammo_bolts; - int ammo_xencandy; - int ammo_satchel; - - int bradnailer_mag; - int nailgun_mag; - int shotgun_mag; - int cmlwbr_mag; - int xs_mag; - int satchel_chg; + virtual void(void) EvaluateEntity; + virtual float(entity, float) SendEntity; #endif }; +#ifdef CLIENT +void Weapons_AmmoUpdate(entity); +/* +================= +player::ReceiveEntity +================= +*/ +void +player::ReceiveEntity(float new) +{ + float fl; + if (new == FALSE) { + /* Go through all the physics code between the last received frame + * and the newest frame and keep the changes this time around instead + * of rolling back, because we'll apply the new server-verified values + * right after anyway. */ + /* FIXME: splitscreen */ + if (entnum == player_localentnum) { + /* FIXME: splitscreen */ + pSeat = &g_seats[0]; + + for (int i = sequence+1; i <= servercommandframe; i++) { + /* ...maybe the input state is too old? */ + if (!getinputstate(i)) { + break; + } + input_sequence = i; + PMove_Run(); + } + + /* any differences in things that are read below are now + * officially from prediction misses. */ + } + } + + /* seed for our prediction table */ + sequence = servercommandframe; + + fl = readfloat(); + + /* HACK: we need to make this more reliable */ + if (fl == UPDATE_ALL) { + /* we respawned */ + gravity = __NULL__; + } + + if (fl & PLAYER_MODELINDEX) + modelindex = readshort(); + + if (fl & PLAYER_ORIGIN) { + origin[0] = readcoord(); + origin[1] = readcoord(); + } + + if (fl & PLAYER_ORIGIN_Z) + origin[2] = readcoord(); + if (fl & PLAYER_ANGLES_X) + pitch = readfloat(); + if (fl & PLAYER_ANGLES_Y) + angles[1] = readfloat(); + if (fl & PLAYER_ANGLES_Z) + angles[2] = readfloat(); + + if (fl & PLAYER_VELOCITY) { + velocity[0] = readcoord(); + velocity[1] = readcoord(); + } + + if (fl & PLAYER_VELOCITY_Z) + velocity[2] = readcoord(); + if (fl & PLAYER_FLAGS) { + flags = readfloat(); + gflags = readfloat(); + } + if (fl & PLAYER_WEAPON) + activeweapon = readbyte(); + if (fl & PLAYER_ITEMS) + g_items = (__variant)readfloat(); + if (fl & PLAYER_HEALTH) + health = readbyte(); + if (fl & PLAYER_ARMOR) + armor = readbyte(); + if (fl & PLAYER_MOVETYPE) + movetype = readbyte(); + if (fl & PLAYER_VIEWOFS) + view_ofs[2] = readfloat(); + if (fl & PLAYER_BASEFRAME) + baseframe = readbyte(); + if (fl & PLAYER_FRAME) { + frame = readbyte(); + frame1time = 0.0f; + frame2time = 0.0f; + } + + if (fl & PLAYER_AMMO1) { + bradnailer_mag = readbyte(); + nailgun_mag = readbyte(); + shotgun_mag = readbyte(); + cmlwbr_mag = readbyte(); + xs_mag = readbyte(); + satchel_chg = readbyte(); + } + + if (fl & PLAYER_AMMO2) { + ammo_nail = readbyte(); + ammo_buckshot = readbyte(); + ammo_bolts = readbyte(); + ammo_xencandy = readbyte(); + ammo_satchel = readbyte(); + } + + if (fl & PLAYER_AMMO3) { + } + + if (fl & PLAYER_AMMO1 || fl & PLAYER_AMMO2 || fl & PLAYER_AMMO3) + Weapons_AmmoUpdate(this); + + setorigin(this, origin); +} + +/* +================= +player::PredictPostFrame + +Save the last valid server values away in the _net variants of each field +so we can roll them back later. +================= +*/ +void +player::PredictPreFrame(void) +{ + bradnailer_mag_net = bradnailer_mag; + nailgun_mag_net = nailgun_mag; + shotgun_mag_net = shotgun_mag; + cmlwbr_mag_net = cmlwbr_mag; + xs_mag_net = xs_mag; + satchel_chg_net = satchel_chg; + + ammo_nail_net = ammo_nail; + ammo_buckshot_net = ammo_buckshot; + ammo_bolts_net = ammo_bolts; + ammo_xencandy_net = ammo_xencandy; + ammo_satchel_net = ammo_satchel; +} + +/* +================= +player::PredictPostFrame + +Where we roll back our values to the ones last sent/verified by the server. +================= +*/ +void +player::PredictPostFrame(void) +{ + bradnailer_mag = bradnailer_mag_net; + nailgun_mag = nailgun_mag_net; + shotgun_mag = shotgun_mag_net; + cmlwbr_mag = cmlwbr_mag_net; + xs_mag = xs_mag_net; + satchel_chg = satchel_chg_net; + + ammo_nail = ammo_nail_net; + ammo_buckshot = ammo_buckshot_net; + ammo_bolts = ammo_bolts_net; + ammo_xencandy = ammo_xencandy_net; + ammo_satchel = ammo_satchel_net; +} + +#else +void +player::EvaluateEntity(void) +{ + SendFlags |= PLAYER_KEEPALIVE; + + if (old_modelindex != modelindex) + SendFlags |= PLAYER_MODELINDEX; + + if (old_origin[0] != origin[0]) + SendFlags |= PLAYER_ORIGIN; + + if (old_origin[1] != origin[1]) + SendFlags |= PLAYER_ORIGIN; + + if (old_origin[2] != origin[2]) + SendFlags |= PLAYER_ORIGIN_Z; + + if (old_angles[0] != v_angle[0]) + SendFlags |= PLAYER_ANGLES_X; + + if (old_angles[1] != angles[1]) + SendFlags |= PLAYER_ANGLES_Y; + + if (old_angles[2] != angles[2]) + SendFlags |= PLAYER_ANGLES_Z; + + if (old_velocity[0] != velocity[0]) + SendFlags |= PLAYER_VELOCITY; + + if (old_velocity[1] != velocity[1]) + SendFlags |= PLAYER_VELOCITY; + + if (old_velocity[2] != velocity[2]) + SendFlags |= PLAYER_VELOCITY_Z; + + if (old_flags != flags) + SendFlags |= PLAYER_FLAGS; + + if (old_gflags != gflags) + SendFlags |= PLAYER_FLAGS; + + if (old_activeweapon != activeweapon) + SendFlags |= PLAYER_WEAPON; + + if (old_items != g_items) + SendFlags |= PLAYER_ITEMS; + + if (old_health != health) + SendFlags |= PLAYER_HEALTH; + + if (old_armor != armor) + SendFlags |= PLAYER_ARMOR; + + if (old_movetype != movetype) + SendFlags |= PLAYER_MOVETYPE; + + if (old_viewofs != view_ofs[2]) + SendFlags |= PLAYER_VIEWOFS; + + if (old_baseframe != baseframe) + SendFlags |= PLAYER_BASEFRAME; + + if (old_frame != frame) + SendFlags |= PLAYER_FRAME; + + old_modelindex = modelindex; + old_origin = origin; + old_angles = angles; + old_angles[0] = v_angle[0]; + old_velocity = velocity; + old_flags = flags; + old_gflags = gflags; + old_activeweapon = activeweapon; + old_items = g_items; + old_health = health; + old_armor = armor; + old_movetype = movetype; + old_viewofs = view_ofs[2]; + old_baseframe = baseframe; + old_frame = frame; + + if (bradnailer_mag_net != bradnailer_mag) + SendFlags |= PLAYER_AMMO1; + if (nailgun_mag_net != nailgun_mag) + SendFlags |= PLAYER_AMMO1; + if (shotgun_mag_net != shotgun_mag) + SendFlags |= PLAYER_AMMO1; + if (cmlwbr_mag_net != cmlwbr_mag) + SendFlags |= PLAYER_AMMO1; + if (xs_mag_net != xs_mag) + SendFlags |= PLAYER_AMMO1; + if (satchel_chg_net != satchel_chg) + SendFlags |= PLAYER_AMMO1; + + if (ammo_nail_net != ammo_nail) + SendFlags |= PLAYER_AMMO2; + if (ammo_buckshot_net != ammo_buckshot) + SendFlags |= PLAYER_AMMO2; + if (ammo_bolts_net != ammo_bolts) + SendFlags |= PLAYER_AMMO2; + if (ammo_xencandy_net != ammo_xencandy) + SendFlags |= PLAYER_AMMO2; + if (ammo_satchel_net != ammo_satchel) + SendFlags |= PLAYER_AMMO2; + + bradnailer_mag_net = bradnailer_mag; + nailgun_mag_net = nailgun_mag; + shotgun_mag_net = shotgun_mag; + cmlwbr_mag_net = cmlwbr_mag; + xs_mag_net = xs_mag; + satchel_chg_net = satchel_chg; + + ammo_nail_net = ammo_nail; + ammo_buckshot_net = ammo_buckshot; + ammo_bolts_net = ammo_bolts; + ammo_xencandy_net = ammo_xencandy; + ammo_satchel_net = ammo_satchel; +} + +/* +================= +player::SendEntity +================= +*/ +float +player::SendEntity(entity ePEnt, float fChanged) +{ + if (health <= 0 && ePEnt != this) { + return FALSE; + } + + if (clienttype(ePEnt) != CLIENTTYPE_REAL) { + return FALSE; + } + + if (ePEnt != self) { + fChanged &= ~PLAYER_ITEMS; + fChanged &= ~PLAYER_HEALTH; + fChanged &= ~PLAYER_ARMOR; + fChanged &= ~PLAYER_VIEWOFS; + fChanged &= ~PLAYER_AMMO1; + fChanged &= ~PLAYER_AMMO2; + fChanged &= ~PLAYER_AMMO3; + } + + WriteByte(MSG_ENTITY, ENT_PLAYER); + WriteFloat(MSG_ENTITY, fChanged); + + /* really trying to get our moneys worth with 23 bits of mantissa */ + if (fChanged & PLAYER_MODELINDEX) + WriteShort(MSG_ENTITY, modelindex); + if (fChanged & PLAYER_ORIGIN) { + WriteCoord(MSG_ENTITY, origin[0]); + WriteCoord(MSG_ENTITY, origin[1]); + } + if (fChanged & PLAYER_ORIGIN_Z) + WriteCoord(MSG_ENTITY, origin[2]); + if (fChanged & PLAYER_ANGLES_X) + WriteFloat(MSG_ENTITY, v_angle[0]); + if (fChanged & PLAYER_ANGLES_Y) + WriteFloat(MSG_ENTITY, angles[1]); + if (fChanged & PLAYER_ANGLES_Z) + WriteFloat(MSG_ENTITY, angles[2]); + if (fChanged & PLAYER_VELOCITY) { + WriteCoord(MSG_ENTITY, velocity[0]); + WriteCoord(MSG_ENTITY, velocity[1]); + } + if (fChanged & PLAYER_VELOCITY_Z) + WriteCoord(MSG_ENTITY, velocity[2]); + if (fChanged & PLAYER_FLAGS) { + WriteFloat(MSG_ENTITY, flags); + WriteFloat(MSG_ENTITY, gflags); + } + if (fChanged & PLAYER_WEAPON) + WriteByte(MSG_ENTITY, activeweapon); + if (fChanged & PLAYER_ITEMS) + WriteFloat(MSG_ENTITY, (__variant)g_items); + if (fChanged & PLAYER_HEALTH) + WriteByte(MSG_ENTITY, bound(0, health, 255)); + if (fChanged & PLAYER_ARMOR) + WriteByte(MSG_ENTITY, armor); + if (fChanged & PLAYER_MOVETYPE) + WriteByte(MSG_ENTITY, movetype); + if (fChanged & PLAYER_VIEWOFS) + WriteFloat(MSG_ENTITY, view_ofs[2]); + if (fChanged & PLAYER_BASEFRAME) + WriteByte(MSG_ENTITY, baseframe); + if (fChanged & PLAYER_FRAME) + WriteByte(MSG_ENTITY, frame); + + if (fChanged & PLAYER_AMMO1) { + WriteByte(MSG_ENTITY, bradnailer_mag); + WriteByte(MSG_ENTITY, nailgun_mag); + WriteByte(MSG_ENTITY, shotgun_mag); + WriteByte(MSG_ENTITY, cmlwbr_mag); + WriteByte(MSG_ENTITY, xs_mag); + WriteByte(MSG_ENTITY, satchel_chg); + } + + if (fChanged & PLAYER_AMMO2) { + WriteByte(MSG_ENTITY, ammo_nail); + WriteByte(MSG_ENTITY, ammo_buckshot); + WriteByte(MSG_ENTITY, ammo_bolts); + WriteByte(MSG_ENTITY, ammo_xencandy); + WriteByte(MSG_ENTITY, ammo_satchel); + } + + if (fChanged & PLAYER_AMMO3) { + } + + return TRUE; +} +#endif diff --git a/poke646/src/shared/w_bradnailer.qc b/poke646/src/shared/w_bradnailer.qc index 7bddc830..20060ef0 100644 --- a/poke646/src/shared/w_bradnailer.qc +++ b/poke646/src/shared/w_bradnailer.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2021 Marco Hladik * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -56,9 +56,7 @@ w_bradnailer_precache(void) void w_bradnailer_updateammo(player pl) { -#ifdef SERVER Weapons_UpdateAmmo(pl, pl.bradnailer_mag, pl.ammo_nail, -1); -#endif } string @@ -240,7 +238,7 @@ w_bradnailer_hudpic(int selected, vector pos, float a) weapon_t w_bradnailer = { .name = "bradnailer", - .id = ITEM_BRADNAILER, + .id = ITEM_BRADNAILER, .slot = 1, .slot_pos = 0, .draw = w_bradnailer_draw, diff --git a/poke646/src/shared/w_cmlwbr.qc b/poke646/src/shared/w_cmlwbr.qc index 01a8bb6f..f9dfda3b 100644 --- a/poke646/src/shared/w_cmlwbr.qc +++ b/poke646/src/shared/w_cmlwbr.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2021 Marco Hladik * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -121,7 +121,7 @@ w_cmlwbr_hudpic(int selected, vector pos, float a) weapon_t w_cmlwbr = { .name = "cmlwbr", - .id = ITEM_CMLWBR, + .id = ITEM_CMLWBR, .slot = 2, .slot_pos = 1, .draw = w_cmlwbr_draw, diff --git a/poke646/src/shared/w_heaterpipe.qc b/poke646/src/shared/w_heaterpipe.qc index aab55c29..ff9557ee 100644 --- a/poke646/src/shared/w_heaterpipe.qc +++ b/poke646/src/shared/w_heaterpipe.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2021 Marco Hladik * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -110,7 +110,7 @@ w_heaterpipe_hudpic(int selected, vector pos, float a) weapon_t w_heaterpipe = { .name = "heaterpipe", - .id = ITEM_HEATERPIPE, + .id = ITEM_HEATERPIPE, .slot = 0, .slot_pos = 0, .draw = w_heaterpipe_draw, diff --git a/poke646/src/shared/w_nailgun.qc b/poke646/src/shared/w_nailgun.qc index 91128112..bbe6d470 100644 --- a/poke646/src/shared/w_nailgun.qc +++ b/poke646/src/shared/w_nailgun.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2021 Marco Hladik * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -166,7 +166,7 @@ w_nailgun_hudpic(int selected, vector pos, float a) weapon_t w_nailgun = { .name = "nailgun", - .id = ITEM_NAILGUN, + .id = ITEM_NAILGUN, .slot = 1, .slot_pos = 1, .draw = w_nailgun_draw, diff --git a/poke646/src/shared/w_pipebomb.qc b/poke646/src/shared/w_pipebomb.qc index 6b219fc7..0057631d 100644 --- a/poke646/src/shared/w_pipebomb.qc +++ b/poke646/src/shared/w_pipebomb.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2021 Marco Hladik * Copyright (c) 2019-2020 Gethyn ThomasQuail * * Permission to use, copy, modify, and distribute this software for any @@ -136,7 +136,7 @@ void w_pipebomb_primary(void) /* Ammo check */ #ifdef CLIENT - if (pl.a_ammo1 <= 0 && pl.a_ammo2 <= 0) { + if (pl.satchel_chg <= 0 && pl.ammo_satchel <= 0) { return; } #else @@ -145,7 +145,7 @@ void w_pipebomb_primary(void) } #endif - if (pl.a_ammo1 <= 0) { + if (pl.satchel_chg <= 0) { Weapons_ViewAnimation(RADIO_DRAW); } else { Weapons_ViewAnimation(RADIO_USE); @@ -171,8 +171,8 @@ void w_pipebomb_primary(void) Weapons_UpdateAmmo(pl, pl.satchel_chg, pl.ammo_satchel, __NULL__); #else setmodel(pSeat->m_eViewModel, "models/v_pipebomb_watch.mdl"); - pl.a_ammo1++; - pl.a_ammo2--; + pl.satchel_chg++; + pl.ammo_satchel--; #endif pl.w_attack_next = 1.0f; @@ -188,7 +188,7 @@ void w_pipebomb_secondary(void) /* Ammo check */ #ifdef CLIENT - if (pl.a_ammo2 <= 0) { + if (pl.ammo_satchel <= 0) { return; } #else @@ -206,8 +206,8 @@ void w_pipebomb_secondary(void) pl.ammo_satchel--; Weapons_UpdateAmmo(pl, pl.satchel_chg, pl.ammo_satchel, __NULL__); #else - pl.a_ammo1++; - pl.a_ammo2--; + pl.satchel_chg++; + pl.ammo_satchel--; setmodel(pSeat->m_eViewModel, "models/v_pipebomb_watch.mdl"); #endif @@ -249,7 +249,7 @@ void w_pipebomb_hudpic(int selected, vector pos, float a) weapon_t w_pipebomb = { .name = "pipebomb", - .id = ITEM_SATCHEL, + .id = ITEM_SATCHEL, .slot = 4, .slot_pos = 1, .draw = w_pipebomb_draw, diff --git a/poke646/src/shared/w_shotgun.qc b/poke646/src/shared/w_shotgun.qc index 9b3e06e2..5d4e6afd 100644 --- a/poke646/src/shared/w_shotgun.qc +++ b/poke646/src/shared/w_shotgun.qc @@ -253,7 +253,7 @@ void w_shotgun_hudpic(int s, vector pos, float a) weapon_t w_shotgun = { .name = "shotgun", - .id = ITEM_SHOTGUN, + .id = ITEM_SHOTGUN, .slot = 2, .slot_pos = 1, .draw = w_shotgun_draw, diff --git a/poke646/src/shared/w_xs.qc b/poke646/src/shared/w_xs.qc index 8bcc304d..a8dacdcb 100644 --- a/poke646/src/shared/w_xs.qc +++ b/poke646/src/shared/w_xs.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2021 Marco Hladik * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -123,7 +123,7 @@ w_xs_hudpic(int selected, vector pos, float a) weapon_t w_xs = { .name = "xs", - .id = ITEM_XS, + .id = ITEM_XS, .slot = 3, .slot_pos = 0, .draw = w_xs_draw, diff --git a/rewolf/src/client/hud.qc b/rewolf/src/client/hud.qc index 5c13cfe7..522b278a 100644 --- a/rewolf/src/client/hud.qc +++ b/rewolf/src/client/hud.qc @@ -263,6 +263,12 @@ HUD_DrawAmmo3(void) } } +void +HUD_DrawAmmoBar(vector pos, float val, float max, float a) +{ + +} + void HUD_WeaponPickupNotify(int w) { diff --git a/tfc/src/server/gamerules.qc b/tfc/src/server/gamerules.qc index 355b2cc4..c5729126 100644 --- a/tfc/src/server/gamerules.qc +++ b/tfc/src/server/gamerules.qc @@ -165,7 +165,7 @@ TFCGameRules::PlayerSpawn(base_player pp) pl.takedamage = DAMAGE_NO; pl.solid = SOLID_NOT; pl.movetype = MOVETYPE_NOCLIP; - pl.SendEntity = Player_SendEntity; +// pl.SendEntity = Player_SendEntity; pl.flags = FL_CLIENT; pl.weapon = 0; pl.viewzoom = 1.0f; diff --git a/tfc/src/server/spawn.qc b/tfc/src/server/spawn.qc index 5e371cb0..7be5c5ba 100644 --- a/tfc/src/server/spawn.qc +++ b/tfc/src/server/spawn.qc @@ -79,7 +79,7 @@ CSEv_TeamJoin_f(float f) pl.velocity = [0,0,0]; pl.gravity = __NULL__; pl.frame = 1; - pl.SendEntity = Player_SendEntity; +// pl.SendEntity = Player_SendEntity; pl.SendFlags = UPDATE_ALL; pl.armor = pl.activeweapon = pl.g_items = 0; diff --git a/valve/src/shared/w_shotgun.qc b/valve/src/shared/w_shotgun.qc index c88249d7..44719911 100644 --- a/valve/src/shared/w_shotgun.qc +++ b/valve/src/shared/w_shotgun.qc @@ -58,24 +58,33 @@ void w_shotgun_precache(void) precache_model("models/p_shotgun.mdl"); #endif } -void w_shotgun_updateammo(player pl) + +void +w_shotgun_updateammo(player pl) { Weapons_UpdateAmmo(pl, pl.shotgun_mag, pl.ammo_buckshot, -1); } -string w_shotgun_wmodel(void) + +string +w_shotgun_wmodel(void) { return "models/w_shotgun.mdl"; } -string w_shotgun_pmodel(void) + +string +w_shotgun_pmodel(void) { return "models/p_shotgun.mdl"; } -string w_shotgun_deathmsg(void) + +string +w_shotgun_deathmsg(void) { return ""; } -int w_shotgun_pickup(int new, int startammo) +int +w_shotgun_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -93,7 +102,8 @@ int w_shotgun_pickup(int new, int startammo) return TRUE; } -void w_shotgun_draw(void) +void +w_shotgun_draw(void) { player pl = (player)self; pl.mode_tempstate = 0; @@ -104,11 +114,14 @@ void w_shotgun_draw(void) #endif } -void w_shotgun_holster(void) +void +w_shotgun_holster(void) { Weapons_ViewAnimation(SHOTGUN_HOLSTER); } -void w_shotgun_primary(void) + +void +w_shotgun_primary(void) { player pl = (player)self; if (pl.w_attack_next) { @@ -143,7 +156,9 @@ void w_shotgun_primary(void) pl.w_attack_next = 0.75; pl.w_idle_next = 2.5f; } -void w_shotgun_secondary(void) + +void +w_shotgun_secondary(void) { player pl = (player)self; if (pl.w_attack_next) { @@ -178,7 +193,8 @@ void w_shotgun_secondary(void) pl.w_idle_next = 2.5f; } -void w_shotgun_reload(void) +void +w_shotgun_reload(void) { player pl = (player)self; @@ -196,7 +212,8 @@ void w_shotgun_reload(void) pl.w_idle_next = 0.0f; } -void w_shotgun_release(void) +void +w_shotgun_release(void) { player pl = (player)self; @@ -253,7 +270,9 @@ void w_shotgun_release(void) pl.w_attack_next = 0.5f; } } -void w_shotgun_crosshair(void) + +void +w_shotgun_crosshair(void) { #ifdef CLIENT static vector cross_pos; @@ -266,12 +285,14 @@ void w_shotgun_crosshair(void) #endif } -float w_shotgun_aimanim(void) +float +w_shotgun_aimanim(void) { return self.flags & FL_CROUCHING ? ANIM_CR_AIMSHOTGUN : ANIM_AIMSHOTGUN; } -void w_shotgun_hudpic(int selected, vector pos, float a) +void +w_shotgun_hudpic(int selected, vector pos, float a) { #ifdef CLIENT player pl = (player)self; @@ -316,7 +337,9 @@ weapon_t w_shotgun = }; #ifdef SERVER -void weapon_shotgun(void) { +void +weapon_shotgun(void) +{ Weapons_InitItem(WEAPON_SHOTGUN); } #endif