Fix the consistency pack pk3, where modders can make different hand models

for each team.
Add crosshair to first-person spectating.
Network view-ofs.
This commit is contained in:
Marco Cawthorne 2021-05-13 09:26:26 +02:00
parent 6a24b29e3d
commit ecc963a0fe
6 changed files with 68 additions and 9 deletions

View file

@ -127,13 +127,6 @@ switch (fHeader) {
sendevent("PlayerSwitchWeapon", "i", w);
}
player pl = (player)pSeat->m_ePlayer;
if (getplayerkeyfloat(pl.entnum-1, "*team") == TEAM_CT) {
setcustomskin(pSeat->m_eViewModel, "", "geomset 0 2\n");
} else {
setcustomskin(pSeat->m_eViewModel, "", "geomset 0 1\n");
}
HUD_WeaponPickupNotify(w);
break;
case EV_RADIOMSG:

View file

@ -721,6 +721,14 @@ HUD_DrawSpectator(void)
vecPos[1] = g_hudres[1]-21;
drawstring(vecPos, strText, [12,12], SPEC_FG_COL, 1.0f, DRAWFLAG_NORMAL);
if (spec.spec_mode == SPECMODE_FIRSTPERSON) {
entity oself = self;
self = findfloat(world, ::entnum, spec.spec_ent);
if (self)
Cstrike_DrawCrosshair();
self = oself;
}
/* money */
strText = sprintf("$ %i", getstati(STAT_MONEY));
flSep = stringwidth(strText, TRUE, [12,12]);

View file

@ -28,7 +28,7 @@ init.qc
entities.qc
cmds.qc
game_event.qc
../../../valve/src/client/view.qc
view.qc
crosshair.qc
../../../valve/src/client/obituary.qc
hud.qc

57
src/client/view.qc Normal file
View file

@ -0,0 +1,57 @@
/*
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
void
View_UpdateWeapon(entity vm, entity mflash)
{
player pl = (player)pSeat->m_ePlayer;
/* only bother upon change */
if (pSeat->m_iLastWeapon == pl.activeweapon) {
return;
}
pSeat->m_iOldWeapon = pSeat->m_iLastWeapon;
pSeat->m_iLastWeapon = pl.activeweapon;
if (!pl.activeweapon) {
return;
}
/* hack, we changed the wep, move this into Game_Input/PMove */
Weapons_Draw();
/* we forced a weapon call outside the prediction,
* thus we need to update all the net variables to
* make sure these updates are recognized. this is
* vile but it'll have to do for now */
SAVE_STATE(pl.w_attack_next);
SAVE_STATE(pl.w_idle_next);
SAVE_STATE(pl.viewzoom);
SAVE_STATE(pl.weapontime);
/* figure out when the attachments start. in FTE attachments for
* HLMDL are treated as bones. they start at numbones + 1 */
skel_delete(mflash.skeletonindex);
mflash.skeletonindex = skel_create(vm.modelindex);
pSeat->m_iVMBones = skel_get_numbones(mflash.skeletonindex) + 1;
player pl = (player)pSeat->m_ePlayer;
if (getplayerkeyfloat(pl.entnum-1, "*team") == TEAM_CT) {
setcustomskin(pSeat->m_eViewModel, "", "geomset 0 2\n");
} else {
setcustomskin(pSeat->m_eViewModel, "", "geomset 0 1\n");
}
}

View file

@ -103,12 +103,14 @@ Animation_PlayerUpdate(player pl)
pl.frame1time = 10.0f;
}
#if 0
makevectors([0, pl.angles[1], 0]);
float fCorrect = dotproduct(pl.velocity, v_right) * 0.25f;
pl.subblendfrac = -fCorrect * 0.05f;
pl.subblend2frac *= -0.1f;
pl.angles[1] -= fCorrect;
#endif
#ifdef SERVER
pl.basesubblendfrac =

View file

@ -519,7 +519,6 @@ player::SendEntity(entity ePEnt, float fChanged)
fChanged &= ~PLAYER_ITEMS;
fChanged &= ~PLAYER_HEALTH;
fChanged &= ~PLAYER_ARMOR;
fChanged &= ~PLAYER_VIEWOFS;
fChanged &= ~PLAYER_AMMO1;
fChanged &= ~PLAYER_AMMO2;
fChanged &= ~PLAYER_AMMO3;