diff --git a/Source/client/valve/hud_weaponselect.c b/Source/client/valve/hud_weaponselect.c index 44542c9e..a0b30cb1 100644 --- a/Source/client/valve/hud_weaponselect.c +++ b/Source/client/valve/hud_weaponselect.c @@ -36,7 +36,7 @@ void HUD_DrawWeaponSelect_Forward(void) pSeat->fHUDWeaponSelectTime = time + 3; - if (!(pl.items & g_weapons[pSeat->fHUDWeaponSelected].id)) { + if (!(pl.g_items & g_weapons[pSeat->fHUDWeaponSelected].id)) { HUD_DrawWeaponSelect_Forward(); } } @@ -62,7 +62,7 @@ void HUD_DrawWeaponSelect_Back(void) pSeat->fHUDWeaponSelectTime = time + 3; - if (!(pl.items & g_weapons[pSeat->fHUDWeaponSelected].id)) { + if (!(pl.g_items & g_weapons[pSeat->fHUDWeaponSelected].id)) { HUD_DrawWeaponSelect_Back(); } } @@ -89,7 +89,7 @@ int Weapon_InSlotPos(int slot, int pos) player pl = (player)pSeat->ePlayer; for (int i = 1; i < g_weapons.length; i++) { if (g_weapons[i].slot == slot && g_weapons[i].slot_pos == pos) { - if (pl.items & g_weapons[i].id) { + if (pl.g_items & g_weapons[i].id) { return i; } else { return -1; diff --git a/Source/client/valve/player.c b/Source/client/valve/player.c index aa42ed01..b5f3cc0c 100644 --- a/Source/client/valve/player.c +++ b/Source/client/valve/player.c @@ -31,7 +31,7 @@ void Player_ReadEntity(float flIsNew) pl.velocity[2] = readcoord(); pl.flags = readfloat(); pl.activeweapon = readbyte(); - pl.items = readfloat(); + pl.g_items = readfloat(); pl.health = readbyte(); pl.armor = readbyte(); pl.movetype = readfloat(); diff --git a/Source/menu-fn/defs.h b/Source/menu-fn/defs.h index ff618fe3..9b6ed4f5 100644 --- a/Source/menu-fn/defs.h +++ b/Source/menu-fn/defs.h @@ -95,3 +95,4 @@ enum { }; void m_hide(void); +void cvar_init(void); diff --git a/Source/menu-fn/entry.cpp b/Source/menu-fn/entry.cpp index 14d578e8..6664074e 100644 --- a/Source/menu-fn/entry.cpp +++ b/Source/menu-fn/entry.cpp @@ -8,6 +8,21 @@ var int g_initialized = FALSE; +void cvar_init(void) +{ + /* TODO: Shove these into defaults.cfg instead of forcing them */ + localcmd("seta con_textsize -12\n"); + localcmd("seta scr_conalpha 1\n"); + localcmd("seta cl_idlefps 0\n"); + localcmd("seta r_shadow_realtime_dlight 0\n"); + localcmd("seta gl_mindist 4\n"); // Thanks Valve for v_shotgun.mdl + localcmd("seta _pext_infoblobs 1\n"); + + /* Hack! */ + localcmd("seta gl_font 0\n"); + localcmd("seta gl_font CONCHARS?fmt=h\n"); +} + void m_init(void) { vector g_btnsize; @@ -21,18 +36,7 @@ void m_init(void) localcmd("plug_load ffmpeg\n"); - /* TODO: Shove these into defaults.cfg instead of forcing them */ - localcmd("con_textsize -12\n"); - localcmd("scr_conalpha 1\n"); - localcmd("cl_idlefps 0\n"); - localcmd("r_shadow_realtime_dlight 0\n"); - localcmd("gl_mindist 4\n"); // Thanks Valve for v_shotgun.mdl - localcmd("_pext_infoblobs 1\n"); - - /* Hack! */ - localcmd("gl_font 0\n"); - localcmd("gl_font CONCHARS?fmt=h\n"); - + cvar_init(); shaderforname("logo_avi", "{\n{\nvideomap av:media/logo.avi\n}\n}"); for (int i = 0; i < g_bmp.length; i++) { diff --git a/Source/menu-fn/m_customgame.cpp b/Source/menu-fn/m_customgame.cpp index f717d4ea..bf0a3bf9 100644 --- a/Source/menu-fn/m_customgame.cpp +++ b/Source/menu-fn/m_customgame.cpp @@ -180,7 +180,7 @@ void customgame_btnactivate_start(void) localcmd(sprintf("gamedir \"%s\"\n", games[nextgame].gamedir)); localcmd("snd_restart\nwait\nvid_reload\nmenu_restart\nmenu_customgame\n"); // TODO: Re-init important menu bits and bobs. - + cvar_init(); //m_shutdown(); //m_init(); } diff --git a/Source/server/scihunt/client.c b/Source/server/scihunt/client.c index 3fb74a31..5229853b 100644 --- a/Source/server/scihunt/client.c +++ b/Source/server/scihunt/client.c @@ -57,7 +57,7 @@ void Game_DecodeChangeParms(void) pl.velocity[0] = parm7; pl.velocity[1] = parm8; pl.velocity[2] = parm9; - pl.items = parm10; + pl.g_items = parm10; pl.activeweapon = parm11; } void Game_SetChangeParms(void) @@ -72,7 +72,7 @@ void Game_SetChangeParms(void) parm7 = pl.velocity[0]; parm8 = pl.velocity[1]; parm9 = pl.velocity[2]; - parm10 = pl.items; + parm10 = pl.g_items; parm11 = pl.activeweapon; } diff --git a/Source/server/valve/client.c b/Source/server/valve/client.c index 1838c744..734e4b7a 100644 --- a/Source/server/valve/client.c +++ b/Source/server/valve/client.c @@ -57,7 +57,7 @@ void Game_DecodeChangeParms(void) pl.velocity[0] = parm7; pl.velocity[1] = parm8; pl.velocity[2] = parm9; - pl.items = parm10; + pl.g_items = parm10; pl.activeweapon = parm11; } void Game_SetChangeParms(void) @@ -72,7 +72,7 @@ void Game_SetChangeParms(void) parm7 = pl.velocity[0]; parm8 = pl.velocity[1]; parm9 = pl.velocity[2]; - parm10 = pl.items; + parm10 = pl.g_items; parm11 = pl.activeweapon; } diff --git a/Source/server/valve/player.c b/Source/server/valve/player.c index 95376b8d..28da6ac9 100644 --- a/Source/server/valve/player.c +++ b/Source/server/valve/player.c @@ -15,7 +15,7 @@ void Player_Death(void) { player pl = (player)self; pl.movetype = MOVETYPE_NONE; - pl.health = pl.armor = pl.activeweapon = pl.items = 0; + pl.health = pl.armor = pl.activeweapon = pl.g_items = 0; PutClientInServer(); } @@ -101,7 +101,7 @@ float Player_SendEntity(entity ePEnt, float fChanged) WriteCoord(MSG_ENTITY, pl.velocity[2]); WriteFloat(MSG_ENTITY, pl.flags); WriteByte(MSG_ENTITY, pl.activeweapon); - WriteFloat(MSG_ENTITY, pl.items); + WriteFloat(MSG_ENTITY, pl.g_items); WriteByte(MSG_ENTITY, pl.health); WriteByte(MSG_ENTITY, pl.armor); WriteFloat(MSG_ENTITY, pl.movetype); diff --git a/Source/shared/scihunt/player.cpp b/Source/shared/scihunt/player.cpp index 5d405931..828d3264 100644 --- a/Source/shared/scihunt/player.cpp +++ b/Source/shared/scihunt/player.cpp @@ -4,26 +4,34 @@ class player float health; float armor; - float w_attack_next; /* When the weapon is done firing */ - float w_idle_next; /* When to play the next idle animation */ + /* When the weapon is done firing */ + float w_attack_next; + /* When to play the next idle animation */ + float w_idle_next; - int a_ammo1; // Magazine/Clip - int a_ammo2; // Rest in the inventory - int a_ammo3; // Special ammo + /* Magazine/Clip */ + int a_ammo1; + /* Rest in the inventory */ + int a_ammo2; + /* Special ammo */ + int a_ammo3; + + /* We can't use the default .items field, because FTE will assume + * effects of some bits. Such as invisibility, quad, etc. */ + int g_items; - float items; float activeweapon; float viewzoom; vector view_ofs; /* Weapon specific */ - int cannon_mag; int glock_mag; int mp5_mag; int python_mag; int shotgun_mag; int crossbow_mag; int rpg_mag; + int cannon_mag; #ifdef CSQC /* External model */ @@ -37,8 +45,8 @@ class player vector netorigin; vector netvelocity; float netflags; - float net_w_attack_next; /* When the weapon is done firing */ - float net_w_idle_next; /* When to play the next idle animation */ + float net_w_attack_next; + float net_w_idle_next; virtual void() gun_offset; virtual void() draw; diff --git a/Source/shared/scihunt/weapons.c b/Source/shared/scihunt/weapons.c index f8a2ef7f..649817b5 100644 --- a/Source/shared/scihunt/weapons.c +++ b/Source/shared/scihunt/weapons.c @@ -193,7 +193,7 @@ void Weapons_PlaySound(entity t, float ch, string s, float vol, float at) int Weapons_IsPresent(player pl, int w) { - if (pl.items & g_weapons[w].id) { + if (pl.g_items & g_weapons[w].id) { return TRUE; } else { return FALSE; @@ -205,7 +205,7 @@ void Weapons_AddItem(player pl, int w) { entity oldself = self; self = pl; - pl.items |= g_weapons[w].id; + pl.g_items |= g_weapons[w].id; pl.activeweapon = w; if (g_weapons[w].pickup != __NULL__) { diff --git a/Source/shared/valve/player.cpp b/Source/shared/valve/player.cpp index ded650b0..f31a8915 100644 --- a/Source/shared/valve/player.cpp +++ b/Source/shared/valve/player.cpp @@ -4,14 +4,22 @@ class player float health; float armor; - float w_attack_next; /* When the weapon is done firing */ - float w_idle_next; /* When to play the next idle animation */ + /* When the weapon is done firing */ + float w_attack_next; + /* When to play the next idle animation */ + float w_idle_next; - int a_ammo1; // Magazine/Clip - int a_ammo2; // Rest in the inventory - int a_ammo3; // Special ammo + /* Magazine/Clip */ + int a_ammo1; + /* Rest in the inventory */ + int a_ammo2; + /* Special ammo */ + int a_ammo3; + + /* We can't use the default .items field, because FTE will assume + * effects of some bits. Such as invisibility, quad, etc. */ + int g_items; - float items; float activeweapon; float viewzoom; vector view_ofs; @@ -31,13 +39,13 @@ class player int p_model_bone; float pitch; float lastweapon; - + /* Prediction */ vector netorigin; vector netvelocity; float netflags; - float net_w_attack_next; /* When the weapon is done firing */ - float net_w_idle_next; /* When to play the next idle animation */ + float net_w_attack_next; + float net_w_idle_next; virtual void() gun_offset; virtual void() draw; diff --git a/Source/shared/valve/weapons.c b/Source/shared/valve/weapons.c index 5f583719..d67e3cbc 100644 --- a/Source/shared/valve/weapons.c +++ b/Source/shared/valve/weapons.c @@ -190,7 +190,7 @@ void Weapons_PlaySound(entity t, float ch, string s, float vol, float at) int Weapons_IsPresent(player pl, int w) { - if (pl.items & g_weapons[w].id) { + if (pl.g_items & g_weapons[w].id) { return TRUE; } else { return FALSE; @@ -202,7 +202,7 @@ void Weapons_AddItem(player pl, int w) { entity oldself = self; self = pl; - pl.items |= g_weapons[w].id; + pl.g_items |= g_weapons[w].id; pl.activeweapon = w; if (g_weapons[w].pickup != __NULL__) { diff --git a/cstrike/data.pk3dir/csprogs.dat b/cstrike/data.pk3dir/csprogs.dat index e3f373e3..28c9779e 100644 Binary files a/cstrike/data.pk3dir/csprogs.dat and b/cstrike/data.pk3dir/csprogs.dat differ diff --git a/rewolf/data.pk3dir/csprogs.dat b/rewolf/data.pk3dir/csprogs.dat index 1c99cffb..3aa459f1 100644 Binary files a/rewolf/data.pk3dir/csprogs.dat and b/rewolf/data.pk3dir/csprogs.dat differ diff --git a/rewolf/data.pk3dir/progs.dat b/rewolf/data.pk3dir/progs.dat index 77643192..1a1425e7 100644 Binary files a/rewolf/data.pk3dir/progs.dat and b/rewolf/data.pk3dir/progs.dat differ diff --git a/scihunt/data.pk3dir/csprogs.dat b/scihunt/data.pk3dir/csprogs.dat index 04f3ddee..65584b6e 100644 Binary files a/scihunt/data.pk3dir/csprogs.dat and b/scihunt/data.pk3dir/csprogs.dat differ diff --git a/scihunt/data.pk3dir/progs.dat b/scihunt/data.pk3dir/progs.dat index 37c7136e..ee4d62d3 100644 Binary files a/scihunt/data.pk3dir/progs.dat and b/scihunt/data.pk3dir/progs.dat differ diff --git a/valve/data.pk3dir/csprogs.dat b/valve/data.pk3dir/csprogs.dat index c4573b7b..1d028b39 100644 Binary files a/valve/data.pk3dir/csprogs.dat and b/valve/data.pk3dir/csprogs.dat differ diff --git a/valve/data.pk3dir/menu.dat b/valve/data.pk3dir/menu.dat index 07c25263..97d333bc 100644 Binary files a/valve/data.pk3dir/menu.dat and b/valve/data.pk3dir/menu.dat differ diff --git a/valve/data.pk3dir/progs.dat b/valve/data.pk3dir/progs.dat index 67924e95..919a8bcf 100644 Binary files a/valve/data.pk3dir/progs.dat and b/valve/data.pk3dir/progs.dat differ