Change pSeat references to pSeatLocal where applicable.

This commit is contained in:
Marco Cawthorne 2021-03-31 13:42:36 +02:00
parent acbdc62b14
commit dee6ee1a73
31 changed files with 123 additions and 305 deletions

View file

@ -50,46 +50,8 @@ var string g_cs_scope6;
var string g_cs_scope7;
var string g_cs_scope8;
var float SHELL_PISTOL;
var float SHELL_RIFLE;
var float SHELL_RIFLELARGE;
struct
{
/* viewmodel stuff */
entity m_eViewModel;
entity m_eMuzzleflash;
int m_iVMBones;
void(void) m_pEventCall;
float m_flEventTime;
float m_flEventFrame;
int m_iLastWeapon;
int m_iOldWeapon;
float m_flBobTime;
float m_flBob;
/* damage overlay */
float m_flDamageAlpha;
vector m_vecDamagePos;
/* +zoomin cmd */
int m_iZoomed;
float m_flZoomTime;
/* player fields */
entity m_ePlayer;
vector m_vecPredictedOrigin;
vector m_vecPredictedOriginOld;
vector m_vecPredictedVelocity;
float m_flPredictedFlags;
/* camera fields */
vector m_vecCameraOrigin;
vector m_vecCameraAngle;
float m_flCameraTime;
/* hud.c */
int m_iHealthOld;
float m_flHealthAlpha;
@ -104,49 +66,6 @@ struct
int m_iPickupWeapon;
float m_flPickupAlpha;
/* This is seperated from the other VGUI stuff so we can check scores
* while buying and whatnot */
int m_iScoresVisible;
int m_iHUDWeaponSelected;
float m_flHUDWeaponSelectTime;
/* saturn controller */
int m_iSaturnMenu;
/* centerprint related */
float m_flCenterprintAlpha;
float m_flCenterprintTime;
float m_iCenterprintLines;
string m_strCenterprintBuffer[18];
/* chat related */
float m_flPrintTime;
string m_strPrintBuffer[5];
int m_iPrintLines;
int m_iInputAttack2;
int m_iInputReload;
int m_iInputUse;
int m_iInputDuck;
float m_flInputBlockTime;
/* fading */
float m_flFadeDuration;
float m_flFadeHold;
float m_flFadeMaxAlpha;
float m_flFadeStyle;
float m_flFadeAlpha;
float m_flFadeTime;
vector m_vecFadeColor;
int m_iFadeActive;
entity m_pWeaponFX;
/* shake */
float m_flShakeFreq;
float m_flShakeDuration;
float m_flShakeTime;
float m_flShakeAmp;
/* cstrike additions */
float m_iMoneyOld;
float m_flMoneyAlpha;
@ -155,7 +74,7 @@ struct
float m_flTimeAlpha;
vector m_vecMoneyColor;
int m_iNightvision;
} g_seats[4], *pSeat;
} g_seatslocal[4], *pSeatLocal;
void HUD_DrawAmmo1(void);
void HUD_DrawAmmo2(void);

View file

@ -162,24 +162,24 @@ HUD_DrawTimer(int spectator)
drawsubpic(time_pos, [24,25], g_hud7_spr, [NUMSIZE_X * 6, NUMSIZE_Y * 3], [NUMSIZE_X, NUMSIZE_Y], [1,0,0], fAlpha, DRAWFLAG_ADDITIVE);
drawsubpic(time_pos, [24,25], g_hud7_spr, [NUMSIZE_X * 6, NUMSIZE_Y * 3], [NUMSIZE_X, NUMSIZE_Y], g_hud_color, 1 - fAlpha, DRAWFLAG_ADDITIVE);
} else {
if (iUnits != pSeat->m_iTimeUnitsOld) {
pSeat->m_flTimeAlpha = 1.0;
if (iUnits != pSeatLocal->m_iTimeUnitsOld) {
pSeatLocal->m_flTimeAlpha = 1.0;
}
if (pSeat->m_flTimeAlpha >= HUD_ALPHA) {
pSeat->m_flTimeAlpha -= clframetime * 0.5;
if (pSeatLocal->m_flTimeAlpha >= HUD_ALPHA) {
pSeatLocal->m_flTimeAlpha -= clframetime * 0.5;
} else {
pSeat->m_flTimeAlpha = HUD_ALPHA;
pSeatLocal->m_flTimeAlpha = HUD_ALPHA;
}
HUD_DrawNumber(iMinutes, time_pos + [48,0], pSeat->m_flTimeAlpha, g_hud_color);
HUD_DrawNumber(iTens, time_pos + [75,0], pSeat->m_flTimeAlpha, g_hud_color);
HUD_DrawNumber(iUnits, time_pos + [95,0], pSeat->m_flTimeAlpha, g_hud_color);
HUD_DrawNumber(iMinutes, time_pos + [48,0], pSeatLocal->m_flTimeAlpha, g_hud_color);
HUD_DrawNumber(iTens, time_pos + [75,0], pSeatLocal->m_flTimeAlpha, g_hud_color);
HUD_DrawNumber(iUnits, time_pos + [95,0], pSeatLocal->m_flTimeAlpha, g_hud_color);
drawsubpic(time_pos + [70,6], [3,3], g_hud7_spr, [0.9375, 0], [0.01171875, 0.01171875], g_hud_color, pSeat->m_flTimeAlpha, DRAWFLAG_ADDITIVE);
drawsubpic(time_pos + [70,16], [3,3], g_hud7_spr, [0.9375, 0], [0.01171875, 0.01171875], g_hud_color, pSeat->m_flTimeAlpha, DRAWFLAG_ADDITIVE);
drawsubpic(time_pos + [70,6], [3,3], g_hud7_spr, [0.9375, 0], [0.01171875, 0.01171875], g_hud_color, pSeatLocal->m_flTimeAlpha, DRAWFLAG_ADDITIVE);
drawsubpic(time_pos + [70,16], [3,3], g_hud7_spr, [0.9375, 0], [0.01171875, 0.01171875], g_hud_color, pSeatLocal->m_flTimeAlpha, DRAWFLAG_ADDITIVE);
drawsubpic(time_pos, [24,25], g_hud7_spr, [NUMSIZE_X * 6, NUMSIZE_Y * 3], [NUMSIZE_X, NUMSIZE_Y], g_hud_color, pSeat->m_flTimeAlpha, DRAWFLAG_ADDITIVE);
pSeat->m_iTimeUnitsOld = iUnits;
drawsubpic(time_pos, [24,25], g_hud7_spr, [NUMSIZE_X * 6, NUMSIZE_Y * 3], [NUMSIZE_X, NUMSIZE_Y], g_hud_color, pSeatLocal->m_flTimeAlpha, DRAWFLAG_ADDITIVE);
pSeatLocal->m_iTimeUnitsOld = iUnits;
}
}
@ -192,31 +192,31 @@ HUD_DrawMoney(void)
money_pos = g_hudmins + [g_hudres[0] - 160, g_hudres[1] - 72];
/* if the money differs from last frame, paint it appropriately */
if (getstati(STAT_MONEY) > pSeat->m_iMoneyOld) {
if (getstati(STAT_MONEY) > pSeatLocal->m_iMoneyOld) {
/* effect already in progress from something else, go add on top of it! */
if (pSeat->m_flMoneyAlpha > 0) {
pSeat->m_iMoneyDelta += (pSeat->m_iMoneyOld - getstati(STAT_MONEY));
if (pSeatLocal->m_flMoneyAlpha > 0) {
pSeatLocal->m_iMoneyDelta += (pSeatLocal->m_iMoneyOld - getstati(STAT_MONEY));
} else {
pSeat->m_iMoneyDelta = pSeat->m_iMoneyOld - getstati(STAT_MONEY);
pSeatLocal->m_iMoneyDelta = pSeatLocal->m_iMoneyOld - getstati(STAT_MONEY);
}
/* make it green for a short time */
pSeat->m_vecMoneyColor = [0,1,0];
pSeat->m_flMoneyAlpha = 1.0;
} else if (getstati(STAT_MONEY) < pSeat->m_iMoneyOld) {
pSeatLocal->m_vecMoneyColor = [0,1,0];
pSeatLocal->m_flMoneyAlpha = 1.0;
} else if (getstati(STAT_MONEY) < pSeatLocal->m_iMoneyOld) {
/* same one as above */
if (pSeat->m_flMoneyAlpha > 0) {
pSeat->m_iMoneyDelta += (pSeat->m_iMoneyOld - getstati(STAT_MONEY));
if (pSeatLocal->m_flMoneyAlpha > 0) {
pSeatLocal->m_iMoneyDelta += (pSeatLocal->m_iMoneyOld - getstati(STAT_MONEY));
} else {
pSeat->m_iMoneyDelta = pSeat->m_iMoneyOld - getstati(STAT_MONEY);
pSeatLocal->m_iMoneyDelta = pSeatLocal->m_iMoneyOld - getstati(STAT_MONEY);
}
/* make it red */
pSeat->m_vecMoneyColor = [1,0,0];
pSeat->m_flMoneyAlpha = 1.0;
pSeat->m_iMoneyDelta = pSeat->m_iMoneyOld - getstati(STAT_MONEY);
pSeatLocal->m_vecMoneyColor = [1,0,0];
pSeatLocal->m_flMoneyAlpha = 1.0;
pSeatLocal->m_iMoneyDelta = pSeatLocal->m_iMoneyOld - getstati(STAT_MONEY);
}
/* maximum alpha is variable. */
endalpha = pSeat->m_flMoneyAlpha * HUD_ALPHA;
endalpha = pSeatLocal->m_flMoneyAlpha * HUD_ALPHA;
/* dollar sign */
drawsubpic(
@ -232,7 +232,7 @@ HUD_DrawMoney(void)
/* if the alpha/color effect is active, draw the money twice in their
* varying alphas/colors */
if (pSeat->m_flMoneyAlpha > 0) {
if (pSeatLocal->m_flMoneyAlpha > 0) {
/* red/green dollar sign */
drawsubpic(
money_pos,
@ -240,27 +240,27 @@ HUD_DrawMoney(void)
g_hud7_spr,
[192/256, 24/256],
[18/256, 26/256],
pSeat->m_vecMoneyColor,
pSeatLocal->m_vecMoneyColor,
endalpha,
DRAWFLAG_ADDITIVE
);
/* draw the +/- symbols depending on whether
* or not we made or lost money */
if (pSeat->m_iMoneyDelta < 0) {
drawsubpic(money_pos + [0,-32], [18,23], g_hud7_spr, [0.8671875, 0.09765625], [0.0703125, 0.08984375], pSeat->m_vecMoneyColor, endalpha, DRAWFLAG_ADDITIVE);
if (pSeatLocal->m_iMoneyDelta < 0) {
drawsubpic(money_pos + [0,-32], [18,23], g_hud7_spr, [0.8671875, 0.09765625], [0.0703125, 0.08984375], pSeatLocal->m_vecMoneyColor, endalpha, DRAWFLAG_ADDITIVE);
} else {
drawsubpic(money_pos + [0,-32], [13,23], g_hud7_spr, [0.8203125, 0.09765625], [0.05078125, 0.08984375], pSeat->m_vecMoneyColor, endalpha, DRAWFLAG_ADDITIVE);
drawsubpic(money_pos + [0,-32], [13,23], g_hud7_spr, [0.8203125, 0.09765625], [0.05078125, 0.08984375], pSeatLocal->m_vecMoneyColor, endalpha, DRAWFLAG_ADDITIVE);
}
/* shift the numbers for reverse drawing */
money_pos[0] += (24 * 5);
/* draw the red/green overlay numbers on top of ours */
HUD_DrawNums(getstati(STAT_MONEY), money_pos, endalpha, pSeat->m_vecMoneyColor);
HUD_DrawNums(getstati(STAT_MONEY), money_pos, endalpha, pSeatLocal->m_vecMoneyColor);
/* draw above how much money we've lost/gotten from all this */
HUD_DrawNums(fabs(pSeat->m_iMoneyDelta), money_pos + [0,-32], endalpha, pSeat->m_vecMoneyColor);
HUD_DrawNums(fabs(pSeatLocal->m_iMoneyDelta), money_pos + [0,-32], endalpha, pSeatLocal->m_vecMoneyColor);
} else {
money_pos[0] += (24 * 5);
}
@ -273,8 +273,8 @@ HUD_DrawMoney(void)
g_hud_color
);
pSeat->m_iMoneyOld = getstati(STAT_MONEY);
pSeat->m_flMoneyAlpha = max(0, pSeat->m_flMoneyAlpha - (clframetime * 0.5));
pSeatLocal->m_iMoneyOld = getstati(STAT_MONEY);
pSeatLocal->m_flMoneyAlpha = max(0, pSeatLocal->m_flMoneyAlpha - (clframetime * 0.5));
}
/* health */
@ -284,14 +284,14 @@ HUD_DrawHealth(void)
vector pos;
player pl = (player)pSeat->m_ePlayer;
if (pl.health != pSeat->m_iHealthOld) {
pSeat->m_flHealthAlpha = 1.0;
if (pl.health != pSeatLocal->m_iHealthOld) {
pSeatLocal->m_flHealthAlpha = 1.0;
}
if (pSeat->m_flHealthAlpha >= HUD_ALPHA) {
pSeat->m_flHealthAlpha -= clframetime * 0.5;
if (pSeatLocal->m_flHealthAlpha >= HUD_ALPHA) {
pSeatLocal->m_flHealthAlpha -= clframetime * 0.5;
} else {
pSeat->m_flHealthAlpha = HUD_ALPHA;
pSeatLocal->m_flHealthAlpha = HUD_ALPHA;
}
pos = g_hudmins + [88, g_hudres[1] - 42];
@ -303,10 +303,10 @@ HUD_DrawHealth(void)
[spr_health[0], spr_health[1]],
[spr_health[2], spr_health[3]],
g_hud_color,
pSeat->m_flHealthAlpha,
pSeatLocal->m_flHealthAlpha,
DRAWFLAG_ADDITIVE
);
HUD_DrawNums(pl.health, pos, pSeat->m_flHealthAlpha, g_hud_color);
HUD_DrawNums(pl.health, pos, pSeatLocal->m_flHealthAlpha, g_hud_color);
} else {
drawsubpic(
pos + [-72,1],
@ -315,13 +315,13 @@ HUD_DrawHealth(void)
[spr_health[0], spr_health[1]],
[spr_health[2], spr_health[3]],
[1,0,0],
pSeat->m_flHealthAlpha,
pSeatLocal->m_flHealthAlpha,
DRAWFLAG_ADDITIVE
);
HUD_DrawNums(pl.health, pos, pSeat->m_flHealthAlpha, [1,0,0]);
HUD_DrawNums(pl.health, pos, pSeatLocal->m_flHealthAlpha, [1,0,0]);
}
pSeat->m_iHealthOld = pl.health;
pSeatLocal->m_iHealthOld = pl.health;
}
/* armor/suit charge */
@ -333,14 +333,14 @@ HUD_DrawArmor(void)
pos = g_hudmins + [198, g_hudres[1] - 42];
if (pl.armor != pSeat->m_iArmorOld) {
pSeat->m_flArmorAlpha = 1.0;
if (pl.armor != pSeatLocal->m_iArmorOld) {
pSeatLocal->m_flArmorAlpha = 1.0;
}
if (pSeat->m_flArmorAlpha >= HUD_ALPHA) {
pSeat->m_flArmorAlpha -= clframetime * 0.5;
if (pSeatLocal->m_flArmorAlpha >= HUD_ALPHA) {
pSeatLocal->m_flArmorAlpha -= clframetime * 0.5;
} else {
pSeat->m_flArmorAlpha = HUD_ALPHA;
pSeatLocal->m_flArmorAlpha = HUD_ALPHA;
}
if (pl.g_items & ITEM_HELMET) {
@ -351,7 +351,7 @@ HUD_DrawArmor(void)
[spr_suit4[0], spr_suit4[1]],
[spr_suit4[2], spr_suit4[3]],
g_hud_color,
pSeat->m_flArmorAlpha,
pSeatLocal->m_flArmorAlpha,
DRAWFLAG_ADDITIVE
);
} else {
@ -362,7 +362,7 @@ HUD_DrawArmor(void)
[spr_suit2[0], spr_suit2[1]],
[spr_suit2[2], spr_suit2[3]],
g_hud_color,
pSeat->m_flArmorAlpha,
pSeatLocal->m_flArmorAlpha,
DRAWFLAG_ADDITIVE
);
}
@ -377,7 +377,7 @@ HUD_DrawArmor(void)
spr_suit3[1]],
[spr_suit3[2], spr_suit3[3] * (pl.armor / 100)],
g_hud_color,
pSeat->m_flArmorAlpha,
pSeatLocal->m_flArmorAlpha,
DRAWFLAG_ADDITIVE
);
} else {
@ -389,14 +389,14 @@ HUD_DrawArmor(void)
spr_suit1[1]],
[spr_suit1[2], spr_suit1[3] * (pl.armor / 100)],
g_hud_color,
pSeat->m_flArmorAlpha,
pSeatLocal->m_flArmorAlpha,
DRAWFLAG_ADDITIVE
);
}
}
HUD_DrawNums(pl.armor, pos, pSeat->m_flArmorAlpha, g_hud_color);
pSeat->m_iArmorOld = pl.armor;
HUD_DrawNums(pl.armor, pos, pSeatLocal->m_flArmorAlpha, g_hud_color);
pSeatLocal->m_iArmorOld = pl.armor;
}
/* magazine/clip ammo */
@ -406,19 +406,19 @@ HUD_DrawAmmo1(void)
player pl = (player)pSeat->m_ePlayer;
vector pos;
if (pl.a_ammo1 != pSeat->m_iAmmo1Old) {
pSeat->m_flAmmo1Alpha = 1.0;
pSeat->m_iAmmo1Old = pl.a_ammo1;
if (pl.a_ammo1 != pSeatLocal->m_iAmmo1Old) {
pSeatLocal->m_flAmmo1Alpha = 1.0;
pSeatLocal->m_iAmmo1Old = pl.a_ammo1;
}
if (pSeat->m_flAmmo1Alpha >= HUD_ALPHA) {
pSeat->m_flAmmo1Alpha -= clframetime * 0.5;
if (pSeatLocal->m_flAmmo1Alpha >= HUD_ALPHA) {
pSeatLocal->m_flAmmo1Alpha -= clframetime * 0.5;
} else {
pSeat->m_flAmmo1Alpha = HUD_ALPHA;
pSeatLocal->m_flAmmo1Alpha = HUD_ALPHA;
}
pos = g_hudmins + [g_hudres[0] - 152, g_hudres[1] - 42];
HUD_DrawNums(pl.a_ammo1, pos, pSeat->m_flAmmo1Alpha, g_hud_color);
HUD_DrawNums(pl.a_ammo1, pos, pSeatLocal->m_flAmmo1Alpha, g_hud_color);
HUD_DrawSeperator(pos + [30,0]);
}
@ -429,19 +429,19 @@ HUD_DrawAmmo2(void)
player pl = (player)pSeat->m_ePlayer;
vector pos;
if (pl.a_ammo2 != pSeat->m_iAmmo2Old) {
pSeat->m_flAmmo2Alpha = 1.0;
pSeat->m_iAmmo2Old = pl.a_ammo2;
if (pl.a_ammo2 != pSeatLocal->m_iAmmo2Old) {
pSeatLocal->m_flAmmo2Alpha = 1.0;
pSeatLocal->m_iAmmo2Old = pl.a_ammo2;
}
if (pSeat->m_flAmmo2Alpha >= HUD_ALPHA) {
pSeat->m_flAmmo2Alpha -= clframetime * 0.5;
if (pSeatLocal->m_flAmmo2Alpha >= HUD_ALPHA) {
pSeatLocal->m_flAmmo2Alpha -= clframetime * 0.5;
} else {
pSeat->m_flAmmo2Alpha = HUD_ALPHA;
pSeatLocal->m_flAmmo2Alpha = HUD_ALPHA;
}
pos = g_hudmins + [g_hudres[0] - 72, g_hudres[1] - 42];
HUD_DrawNums(pl.a_ammo2, pos, pSeat->m_flAmmo2Alpha, g_hud_color);
HUD_DrawNums(pl.a_ammo2, pos, pSeatLocal->m_flAmmo2Alpha, g_hud_color);
}
/* special ammo */
@ -451,19 +451,19 @@ HUD_DrawAmmo3(void)
player pl = (player)pSeat->m_ePlayer;
vector pos;
if (pl.a_ammo3 != pSeat->m_iAmmo3Old) {
pSeat->m_flAmmo3Alpha = 1.0;
pSeat->m_iAmmo3Old = pl.a_ammo3;
if (pl.a_ammo3 != pSeatLocal->m_iAmmo3Old) {
pSeatLocal->m_flAmmo3Alpha = 1.0;
pSeatLocal->m_iAmmo3Old = pl.a_ammo3;
}
if (pSeat->m_flAmmo3Alpha >= HUD_ALPHA) {
pSeat->m_flAmmo3Alpha -= clframetime * 0.5;
if (pSeatLocal->m_flAmmo3Alpha >= HUD_ALPHA) {
pSeatLocal->m_flAmmo3Alpha -= clframetime * 0.5;
} else {
pSeat->m_flAmmo3Alpha = HUD_ALPHA;
pSeatLocal->m_flAmmo3Alpha = HUD_ALPHA;
}
pos = g_hudmins + [g_hudres[0] - 72, g_hudres[1] - 74];
HUD_DrawNums(pl.a_ammo3, pos, pSeat->m_flAmmo3Alpha, g_hud_color);
HUD_DrawNums(pl.a_ammo3, pos, pSeatLocal->m_flAmmo3Alpha, g_hud_color);
}
/* ammo bar */
@ -632,20 +632,20 @@ HUD_DrawNotify(void)
{
vector pos;
if (pSeat->m_flPickupAlpha <= 0.0f) {
if (pSeatLocal->m_flPickupAlpha <= 0.0f) {
return;
}
pos = g_hudmins + [g_hudres[0] - 192, g_hudres[1] - 128];
Weapons_HUDPic(pSeat->m_iPickupWeapon, 1, pos, pSeat->m_flPickupAlpha);
pSeat->m_flPickupAlpha -= clframetime;
Weapons_HUDPic(pSeatLocal->m_iPickupWeapon, 1, pos, pSeatLocal->m_flPickupAlpha);
pSeatLocal->m_flPickupAlpha -= clframetime;
}
void
HUD_WeaponPickupNotify(int w)
{
pSeat->m_iPickupWeapon = w;
pSeat->m_flPickupAlpha = 1.0f;
pSeatLocal->m_iPickupWeapon = w;
pSeatLocal->m_flPickupAlpha = 1.0f;
}
/* main entry */

View file

@ -133,9 +133,13 @@ ClientGame_RendererRestart(string rstr)
g_cs_scope7 = spriteframe("sprites/bottom.spr", 0, 0.0f);
g_cs_scope8 = spriteframe("sprites/bottom_right.spr", 0, 0.0f);
SHELL_PISTOL = getmodelindex("models/pshell.mdl");
SHELL_RIFLE = getmodelindex("models/rshell.mdl");
SHELL_RIFLELARGE = getmodelindex("models/rshell_big.mdl");
precache_model("models/pshell.mdl");
precache_model("models/rshell.mdl");
precache_model("models/rshell_big.mdl");
precache_model("models/shotgunshell.mdl");
precache_model("sprites/muzzleflash1.spr");
precache_model("sprites/muzzleflash2.spr");
precache_model("sprites/muzzleflash3.spr");
Obituary_Precache();

View file

@ -20,13 +20,13 @@ Nightvision_Toggle(void)
player pl = (player)pSeat->m_ePlayer;
if (!(pl.g_items & ITEM_NIGHTVISION)) {
pSeat->m_iNightvision = 0;
pSeatLocal->m_iNightvision = 0;
return;
}
pSeat->m_iNightvision = 1 - pSeat->m_iNightvision;
pSeatLocal->m_iNightvision = 1 - pSeatLocal->m_iNightvision;
if (pSeat->m_iNightvision)
if (pSeatLocal->m_iNightvision)
Sound_Play(self, CHAN_AUTO, "nvg.on");
else
Sound_Play(self, CHAN_AUTO, "nvg.off");
@ -37,11 +37,11 @@ Nightvision_PreFrame(void)
{
player pl = (player)pSeat->m_ePlayer;
if (!pSeat->m_iNightvision)
if (!pSeatLocal->m_iNightvision)
return;
if (!(pl.g_items & ITEM_NIGHTVISION)) {
pSeat->m_iNightvision = 0;
pSeatLocal->m_iNightvision = 0;
return;
}
@ -53,11 +53,11 @@ Nightvision_PostFrame(void)
{
player pl = (player)pSeat->m_ePlayer;
if (!pSeat->m_iNightvision)
if (!pSeatLocal->m_iNightvision)
return;
if (!(pl.g_items & ITEM_NIGHTVISION)) {
pSeat->m_iNightvision = 0;
pSeatLocal->m_iNightvision = 0;
return;
}

View file

@ -42,108 +42,3 @@ Player_PreDraw(base_player pl, int thirdperson)
}
}
}
void
Player_ReceiveEntity(float new)
{
float fl;
player pl = (player)self;
if (new == TRUE) {
spawnfunc_player();
pl.classname = "player";
pl.solid = SOLID_SLIDEBOX;
pl.drawmask = MASK_ENGINE;
pl.customphysics = Empty;
setsize(pl, VEC_HULL_MIN, VEC_HULL_MAX);
} else {
int i;
//FIXME: splitscreen
if (pl.entnum == player_localentnum) {
//FIXME: splitscreen
pSeat = &g_seats[0];
for (i = pl.sequence+1; i <= servercommandframe; i++) {
if (!getinputstate(i)) {
break; //erk?... too old?
}
input_sequence = i;
PMove_Run();
}
/* any differences in things that are read below are now
* officially from prediction misses. */
}
}
pl.sequence = servercommandframe;
fl = readfloat();
/* HACK: we need to make this more reliable */
if (fl == UPDATE_ALL) {
/* we respawned */
pl.gravity = __NULL__;
}
if (fl & PLAYER_MODELINDEX)
pl.modelindex = readshort();
if (fl & PLAYER_ORIGIN) {
pl.origin[0] = readcoord();
pl.origin[1] = readcoord();
}
if (fl & PLAYER_ORIGIN_Z)
pl.origin[2] = readcoord();
if (fl & PLAYER_ANGLES_X)
pl.pitch = readfloat();
if (fl & PLAYER_ANGLES_Y)
pl.angles[1] = readfloat();
if (fl & PLAYER_ANGLES_Z)
pl.angles[2] = readfloat();
if (fl & PLAYER_VELOCITY) {
pl.velocity[0] = readcoord();
pl.velocity[1] = readcoord();
}
if (fl & PLAYER_VELOCITY_Z)
pl.velocity[2] = readcoord();
if (fl & PLAYER_FLAGS) {
pl.flags = readfloat();
pl.gflags = readfloat();
}
if (fl & PLAYER_WEAPON)
pl.activeweapon = readbyte();
if (fl & PLAYER_ITEMS)
pl.g_items = (__variant)readfloat();
if (fl & PLAYER_HEALTH)
pl.health = readbyte();
if (fl & PLAYER_ARMOR)
pl.armor = readbyte();
if (fl & PLAYER_MOVETYPE)
pl.movetype = readbyte();
if (fl & PLAYER_VIEWOFS)
pl.view_ofs[2] = readfloat();
if (fl & PLAYER_BASEFRAME) {
pl.baseframe = readbyte();
pl.baseframe1time = 0.0f;
pl.baseframe2time = 0.0f;
}
if (fl & PLAYER_FRAME)
pl.frame = readbyte();
if (fl & PLAYER_AMMO1)
pl.a_ammo1 = readbyte();
if (fl & PLAYER_AMMO2)
pl.a_ammo2 = readbyte();
if (fl & PLAYER_AMMO3)
pl.a_ammo3 = readbyte();
if (fl & PLAYER_CSSHOT)
pl.cs_shotmultiplier = readbyte();
if (fl & PLAYER_CSSHOTTIME)
pl.cs_shottime = readfloat();
setorigin(pl, pl.origin);
}

View file

@ -243,7 +243,7 @@ w_ak47_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [72/256,72/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [72/256,72/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -235,7 +235,7 @@ w_aug_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [72/256,72/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [72/256,72/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -286,7 +286,7 @@ w_awp_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [24/256,96/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [24/256,96/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -176,7 +176,7 @@ w_c4bomb_hud(void)
#ifdef CLIENT
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [96/256,96/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [96/256,96/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -247,7 +247,7 @@ w_deagle_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [24/256,72/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [24/256,72/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -310,7 +310,7 @@ w_elites_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [48/256,72/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [48/256,72/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -215,7 +215,7 @@ w_fiveseven_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [120/256,96/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [120/256,96/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -223,7 +223,7 @@ w_flashbang_hud(void)
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [48/256,96/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [48/256,96/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -227,7 +227,7 @@ w_g3sg1_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [72/256,72/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [72/256,72/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -285,7 +285,7 @@ w_glock18_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [48/256,72/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [48/256,72/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -225,7 +225,7 @@ w_hegrenade_hud(void)
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [72/256,96/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [72/256,96/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -272,7 +272,7 @@ w_m3_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [0,72/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [0,72/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -262,7 +262,7 @@ w_m4a1_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [0,96/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [0,96/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -210,7 +210,7 @@ w_mac10_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [96/256,72/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [96/256,72/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -210,7 +210,7 @@ w_mp5_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [48/256,72/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [48/256,72/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -219,7 +219,7 @@ w_p228_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [120/256,72/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [120/256,72/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -210,7 +210,7 @@ w_p90_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [120/256,96/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [120/256,96/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -206,7 +206,7 @@ w_para_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [0,96/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [0,96/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -251,7 +251,7 @@ w_scout_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [72/256,72/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [72/256,72/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -227,7 +227,7 @@ w_sg550_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [0,96/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [0,96/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -235,7 +235,7 @@ w_sg552_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [0,96/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [0,96/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -221,7 +221,7 @@ w_smokegrenade_hud(void)
#ifdef CLIENT
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [144/256,96/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [144/256,96/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -212,7 +212,7 @@ w_tmp_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [48/256,72/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [48/256,72/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -212,7 +212,7 @@ w_ump45_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [96/256,72/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [96/256,72/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -294,7 +294,7 @@ w_usp45_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [96/256,72/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [96/256,72/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}

View file

@ -272,7 +272,7 @@ w_xm1014_hud(void)
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [0,72/256], [24/256, 24/256], g_hud_color, pSeat->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [0,72/256], [24/256, 24/256], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
#endif
}