Valve: Basic weapon pickup notification, cl_autoweaponswitch
This commit is contained in:
parent
223d740448
commit
66b629b83a
24 changed files with 125 additions and 65 deletions
|
@ -145,14 +145,14 @@ void HUD_DrawWeaponSelect(void)
|
|||
slot_selected = TRUE;
|
||||
if (x == wantpos) {
|
||||
// Selected Sprite
|
||||
Weapons_HUDPic(pSeat->fHUDWeaponSelected, 1, vecPos);
|
||||
Weapons_HUDPic(pSeat->fHUDWeaponSelected, 1, vecPos, 1.0f);
|
||||
drawsubpic(vecPos, [170,45], "sprites/640hud3.spr_0.tga",
|
||||
[0,180/256], [170/256,45/256],
|
||||
g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
vecPos[1] += 50;
|
||||
} else if ((b=HUD_InSlotPos(i, x)) != -1) {
|
||||
// Unselected Sprite
|
||||
Weapons_HUDPic(b, 0, vecPos);
|
||||
Weapons_HUDPic(b, 0, vecPos, 1.0f);
|
||||
vecPos[1] += 50;
|
||||
}
|
||||
} else if (HUD_InSlotPos(i, x) != -1) {
|
||||
|
|
|
@ -249,6 +249,12 @@ void HUD_DrawAmmo3(void)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
HUD_WeaponPickupNotify(int w)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void HUD_Draw(void)
|
||||
{
|
||||
g_hud_color = autocvar_con_color * (1 / 255);
|
||||
|
|
|
@ -147,13 +147,13 @@ void HUD_DrawWeaponSelect(void)
|
|||
slot_selected = TRUE;
|
||||
if (x == wantpos) {
|
||||
// Selected Sprite
|
||||
Weapons_HUDPic(pSeat->fHUDWeaponSelected, 1, vecPos);
|
||||
Weapons_HUDPic(pSeat->fHUDWeaponSelected, 1, vecPos, 1.0f);
|
||||
drawsubpic(vecPos, [170,45], "sprites/640hud3.spr_0.tga",
|
||||
[0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
vecPos[1] += 50;
|
||||
} else if ((b=HUD_InSlotPos(i, x)) != -1) {
|
||||
// Unselected Sprite
|
||||
Weapons_HUDPic(b, 0, vecPos);
|
||||
Weapons_HUDPic(b, 0, vecPos, 1.0f);
|
||||
vecPos[1] += 50;
|
||||
}
|
||||
} else if (HUD_InSlotPos(i, x) != -1) {
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
var int autocvar_cl_autoweaponswitch = TRUE;
|
||||
|
||||
vector g_hud_color;
|
||||
|
||||
struct
|
||||
|
@ -59,6 +61,8 @@ struct
|
|||
float ammo2_alpha;
|
||||
float ammo3_old;
|
||||
float ammo3_alpha;
|
||||
int pickup_weapon;
|
||||
float pickup_alpha;
|
||||
|
||||
/* This is seperated from the other VGUI stuff so we can check scores
|
||||
* while buying and whatnot */
|
||||
|
@ -77,3 +81,4 @@ struct
|
|||
void HUD_DrawAmmo1(void);
|
||||
void HUD_DrawAmmo2(void);
|
||||
void HUD_DrawAmmo3(void);
|
||||
void HUD_WeaponPickupNotify(int);
|
||||
|
|
|
@ -32,5 +32,13 @@ void Game_Parse_Event(float fHeader)
|
|||
Sound_PlayVOX(readstring());
|
||||
} else if (fHeader == EV_VIEWMODEL) {
|
||||
View_PlayAnimation(readbyte());
|
||||
} else if (fHeader == EV_WEAPON_PICKUP) {
|
||||
float w = readbyte();
|
||||
|
||||
if (autocvar_cl_autoweaponswitch == 1) {
|
||||
sendevent("PlayerSwitchWeapon", "f", w);
|
||||
}
|
||||
|
||||
HUD_WeaponPickupNotify(w);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -363,6 +363,29 @@ HUD_DrawLogo(void)
|
|||
}
|
||||
}
|
||||
|
||||
/* weapon/ammo pickup notifications */
|
||||
|
||||
void
|
||||
HUD_DrawNotify(void)
|
||||
{
|
||||
vector pos;
|
||||
|
||||
if (pSeat->pickup_alpha <= 0.0f) {
|
||||
return;
|
||||
}
|
||||
|
||||
pos = video_mins + [video_res[0] - 192, video_res[1] - 128];
|
||||
Weapons_HUDPic(pSeat->pickup_weapon, 1, pos, pSeat->pickup_alpha);
|
||||
pSeat->pickup_alpha -= frametime;
|
||||
}
|
||||
|
||||
void
|
||||
HUD_WeaponPickupNotify(int w)
|
||||
{
|
||||
pSeat->pickup_weapon = w;
|
||||
pSeat->pickup_alpha = 1.0f;
|
||||
}
|
||||
|
||||
/* main entry */
|
||||
void
|
||||
HUD_Draw(void)
|
||||
|
@ -382,6 +405,7 @@ HUD_Draw(void)
|
|||
HUD_DrawHealth();
|
||||
HUD_DrawArmor();
|
||||
HUD_DrawFlashlight();
|
||||
HUD_DrawNotify();
|
||||
Damage_Draw();
|
||||
}
|
||||
|
||||
|
|
|
@ -139,13 +139,13 @@ void HUD_DrawWeaponSelect(void)
|
|||
slot_selected = TRUE;
|
||||
if (x == wantpos) {
|
||||
// Selected Sprite
|
||||
Weapons_HUDPic(pSeat->fHUDWeaponSelected, 1, vecPos);
|
||||
Weapons_HUDPic(pSeat->fHUDWeaponSelected, 1, vecPos, 1.0f);
|
||||
drawsubpic(vecPos, [170,45], "sprites/640hud3.spr_0.tga",
|
||||
[0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
vecPos[1] += 50;
|
||||
} else if ((b=HUD_InSlotPos(i, x)) != -1) {
|
||||
// Unselected Sprite
|
||||
Weapons_HUDPic(b, 0, vecPos);
|
||||
Weapons_HUDPic(b, 0, vecPos, 1.0f);
|
||||
vecPos[1] += 50;
|
||||
}
|
||||
} else if (HUD_InSlotPos(i, x) != -1) {
|
||||
|
|
|
@ -20,6 +20,7 @@ enum {
|
|||
EV_WEAPON_PRIMARYATTACK,
|
||||
EV_WEAPON_SECONDARYATTACK,
|
||||
EV_WEAPON_RELOAD,
|
||||
EV_WEAPON_PICKUP,
|
||||
EV_IMPACT,
|
||||
EV_GIBHUMAN,
|
||||
EV_BLOOD,
|
||||
|
|
|
@ -331,7 +331,7 @@ w_crossbow_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_crossbow_hudpic(int selected, vector pos)
|
||||
w_crossbow_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -342,7 +342,7 @@ w_crossbow_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -353,7 +353,7 @@ w_crossbow_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -185,7 +185,7 @@ w_crowbar_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_crowbar_hudpic(int selected, vector pos)
|
||||
w_crowbar_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -196,7 +196,7 @@ w_crowbar_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -207,7 +207,7 @@ w_crowbar_hudpic(int selected, vector pos)
|
|||
[0,0],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -165,13 +165,13 @@ float w_egon_aimanim(void)
|
|||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMEGON : ANIM_AIMEGON;
|
||||
}
|
||||
|
||||
void w_egon_hudpic(int s, vector pos)
|
||||
void w_egon_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (s) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud5.spr_0.tga", [0,135/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
if (selected) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud5.spr_0.tga", [0,135/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud2.spr_0.tga", [0,135/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/640hud2.spr_0.tga", [0,135/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -391,7 +391,7 @@ float w_gauss_aimanim(void)
|
|||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMGAUSS : ANIM_AIMGAUSS;
|
||||
}
|
||||
|
||||
void w_gauss_hudpic(int selected, vector pos)
|
||||
void w_gauss_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -402,7 +402,7 @@ void w_gauss_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -413,7 +413,7 @@ void w_gauss_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -297,7 +297,7 @@ w_glock_hud(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_glock_hudpic(int selected, vector pos)
|
||||
w_glock_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -308,7 +308,7 @@ w_glock_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -319,7 +319,7 @@ w_glock_hudpic(int selected, vector pos)
|
|||
[0,45/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -226,13 +226,13 @@ w_handgrenade_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_handgrenade_hudpic(int s, vector pos)
|
||||
w_handgrenade_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (s) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud6.spr_0.tga", [0,0], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
if (selected) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud6.spr_0.tga", [0,0], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud3.spr_0.tga", [0,0], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/640hud3.spr_0.tga", [0,0], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -37,8 +37,8 @@ w_hornetgun_precache(void)
|
|||
precache_sound("agrunt/ag_fire3.wav");
|
||||
|
||||
precache_sound("hornet/ag_buzz1.wav");
|
||||
precache_sound("agrunt/ag_buzz2.wav");
|
||||
precache_sound("agrunt/ag_buzz3.wav");
|
||||
precache_sound("hornet/ag_buzz2.wav");
|
||||
precache_sound("hornet/ag_buzz3.wav");
|
||||
|
||||
precache_sound("hornet/ag_hornethit1.wav");
|
||||
precache_sound("hornet/ag_hornethit2.wav");
|
||||
|
@ -292,7 +292,7 @@ w_hornetgun_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_hornetgun_hudpic(int selected, vector pos)
|
||||
w_hornetgun_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -303,7 +303,7 @@ w_hornetgun_hudpic(int selected, vector pos)
|
|||
[0,180/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -314,7 +314,7 @@ w_hornetgun_hudpic(int selected, vector pos)
|
|||
[0,180/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -320,7 +320,7 @@ w_mp5_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_mp5_hudpic(int selected, vector pos)
|
||||
w_mp5_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -331,7 +331,7 @@ w_mp5_hudpic(int selected, vector pos)
|
|||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -342,7 +342,7 @@ w_mp5_hudpic(int selected, vector pos)
|
|||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -284,7 +284,7 @@ w_python_aimanim(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_python_hudpic(int selected, vector pos)
|
||||
w_python_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (selected) {
|
||||
|
@ -295,7 +295,7 @@ w_python_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
|
@ -306,7 +306,7 @@ w_python_hudpic(int selected, vector pos)
|
|||
[0,90/256],
|
||||
[170/256,45/256],
|
||||
g_hud_color,
|
||||
1.0f,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -243,13 +243,13 @@ float w_rpg_aimanim(void)
|
|||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMRPG : ANIM_AIMRPG;
|
||||
}
|
||||
|
||||
void w_rpg_hudpic(int s, vector pos)
|
||||
void w_rpg_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (s) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud5.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
if (selected) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud5.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud2.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/640hud2.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -253,13 +253,13 @@ void w_satchel_hud(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
void w_satchel_hudpic(int s, vector pos)
|
||||
void w_satchel_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (s) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud6.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
if (selected) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud6.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud3.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/640hud3.spr_0.tga", [0,45/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -274,13 +274,13 @@ float w_shotgun_aimanim(void)
|
|||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMSHOTGUN : ANIM_AIMSHOTGUN;
|
||||
}
|
||||
|
||||
void w_shotgun_hudpic(int s, vector pos)
|
||||
void w_shotgun_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (s) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud4.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
if (selected) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud4.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud1.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/640hud1.spr_0.tga", [0,180/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -252,17 +252,17 @@ void w_snark_hud(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
void w_snark_hudpic(int s, vector pos)
|
||||
void w_snark_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (s) {
|
||||
if (selected) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud6.spr_0.tga",
|
||||
[0,135/256], [170/256,45/256],
|
||||
g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud3.spr_0.tga",
|
||||
[0,135/256], [170/256,45/256],
|
||||
g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -274,13 +274,13 @@ void w_tripmine_hud(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
void w_tripmine_hudpic(int s, vector pos)
|
||||
void w_tripmine_hudpic(int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CSQC
|
||||
if (s) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud6.spr_0.tga", [0,90/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
if (selected) {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud6.spr_0.tga", [0,90/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], "sprites/640hud3.spr_0.tga", [0,90/256], [170/256,45/256], g_hud_color, 1, DRAWFLAG_ADDITIVE);
|
||||
drawsubpic(pos, [170,45], "sprites/640hud3.spr_0.tga", [0,90/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -171,10 +171,10 @@ float Weapons_GetAim(int id)
|
|||
#endif
|
||||
|
||||
#ifdef CSQC
|
||||
void Weapons_HUDPic(int id, int s, vector pos)
|
||||
void Weapons_HUDPic(int id, int s, vector pos, float a)
|
||||
{
|
||||
if (g_weapons[id].hudpic != __NULL__) {
|
||||
g_weapons[id].hudpic(s, pos);
|
||||
g_weapons[id].hudpic(s, pos, a);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -242,6 +242,14 @@ int Weapons_IsPresent(player pl, int w)
|
|||
}
|
||||
|
||||
#ifdef SSQC
|
||||
void Weapons_PickupNotify(player pl, int w)
|
||||
{
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EV_WEAPON_PICKUP);
|
||||
WriteByte(MSG_MULTICAST, w);
|
||||
msg_entity = (entity)pl;
|
||||
multicast([0,0,0], MULTICAST_ONE);
|
||||
}
|
||||
|
||||
void Weapons_RefreshAmmo(player pl)
|
||||
{
|
||||
|
@ -282,8 +290,12 @@ int Weapons_AddItem(player pl, int w)
|
|||
value = TRUE;
|
||||
|
||||
/* it's new, so autoswitch? */
|
||||
pl.activeweapon = w;
|
||||
Weapons_Draw();
|
||||
if (pl.activeweapon == 0) {
|
||||
pl.activeweapon = w;
|
||||
Weapons_Draw();
|
||||
} else {
|
||||
Weapons_PickupNotify(pl, w);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Call team pickup */
|
||||
|
@ -295,8 +307,12 @@ int Weapons_AddItem(player pl, int w)
|
|||
value = g_weapons[w].pickup(TRUE);
|
||||
|
||||
/* it's new, so autoswitch? */
|
||||
pl.activeweapon = w;
|
||||
Weapons_Draw();
|
||||
if (pl.activeweapon == 0) {
|
||||
pl.activeweapon = w;
|
||||
Weapons_Draw();
|
||||
} else {
|
||||
Weapons_PickupNotify(pl, w);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ typedef struct
|
|||
string() pmodel;
|
||||
string() deathmsg;
|
||||
float() aimanim;
|
||||
void(int, vector) hudpic;
|
||||
void(int, vector, float) hudpic;
|
||||
} weapon_t;
|
||||
|
||||
void Weapons_DrawCrosshair(void);
|
||||
|
@ -64,5 +64,5 @@ void Weapons_ReloadWeapon(player, .int, .int, int);
|
|||
#else
|
||||
string Weapons_GetPlayermodel(int);
|
||||
int Weapons_GetAnimation(void);
|
||||
void Weapons_HUDPic(int, int, vector);
|
||||
void Weapons_HUDPic(int, int, vector, float);
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue