diff --git a/src/client/defs.h b/src/client/defs.h index 1b2144c9..7844cb90 100644 --- a/src/client/defs.h +++ b/src/client/defs.h @@ -63,6 +63,7 @@ var int MUZZLE_WEIRD; vector video_mins; vector video_res; vector mouse_pos; +int g_iIntermission; int g_iWorldInitialized; diff --git a/src/client/entry.c b/src/client/entry.c index 404118f4..38b042a4 100644 --- a/src/client/entry.c +++ b/src/client/entry.c @@ -248,6 +248,11 @@ CSQC_UpdateView(float w, float h, float focus) setproperty(VF_MIN, video_mins); setproperty(VF_SIZE, video_res); setproperty(VF_ANGLES, view_angles + pl.punchangle); + + if (g_iIntermission) { + view_angles = pSeat->m_vecCameraAngle + [sin(time), sin(time * 2)] * 5; + } + setproperty(VF_DRAWWORLD, 1); if (g_skyscale != 0 && g_skypos) { @@ -296,7 +301,9 @@ CSQC_UpdateView(float w, float h, float focus) #endif View_PostDraw(); - if (focus == TRUE) { + if (g_iIntermission) { + Scores_Draw(); + } else if (focus == TRUE) { GameText_Draw(); // The spectator sees things... differently @@ -456,6 +463,11 @@ CSQC_Parse_Event(void) float fHeader = readbyte(); switch (fHeader) { + case EV_INTERMISSION: + g_iIntermission = TRUE; + pSeat->m_vecCameraOrigin = getproperty(VF_ORIGIN); + pSeat->m_vecCameraAngle = getproperty(VF_ANGLES); + break; case EV_MUSICTRACK: Music_ParseTrack(); break; diff --git a/src/client/obituary.c b/src/client/obituary.c index 1f137186..10d15362 100644 --- a/src/client/obituary.c +++ b/src/client/obituary.c @@ -42,14 +42,14 @@ Obituary_KillIcon(int id, float w) /* fill in the entries and calculate some in advance */ if (w > 0) { - mtrsize = drawgetimagesize(g_weapons[w].ki_spr); + /*mtrsize = drawgetimagesize(g_weapons[w].ki_spr); g_obituary[id].mtr = g_weapons[w].ki_spr; g_obituary[id].pos = g_weapons[w].ki_xy; g_obituary[id].size = g_weapons[w].ki_size; g_obituary[id].coord[0] = g_weapons[w].ki_xy[0] / mtrsize[0]; g_obituary[id].coord[1] = g_weapons[w].ki_xy[1] / mtrsize[1]; g_obituary[id].bounds[0] = g_weapons[w].ki_size[0] / mtrsize[0]; - g_obituary[id].bounds[1] = g_weapons[w].ki_size[1] / mtrsize[1]; + g_obituary[id].bounds[1] = g_weapons[w].ki_size[1] / mtrsize[1];*/ } else { /* generic splat icon */ g_obituary[id].mtr = "sprites/640hud1.spr_0.tga"; diff --git a/src/server/cstrike/armoury_entity.cpp b/src/server/cstrike/armoury_entity.cpp index bfc8b062..61735dd4 100644 --- a/src/server/cstrike/armoury_entity.cpp +++ b/src/server/cstrike/armoury_entity.cpp @@ -119,7 +119,7 @@ armoury_entity::touch(void) if (m_iItem == 17 || m_iItem == 16) return; - if (Weapons_AddItem((player)other, m_iItem) == FALSE) { + if (Weapons_AddItem((player)other, m_iItem, -1) == FALSE) { return; } diff --git a/src/server/cstrike/buy.c b/src/server/cstrike/buy.c index 2df97da1..3b20a5ca 100644 --- a/src/server/cstrike/buy.c +++ b/src/server/cstrike/buy.c @@ -94,7 +94,7 @@ CSEv_BuyWeapon_f(float fWeapon) } } - Weapons_AddItem(pl, iWeapon); + Weapons_AddItem(pl, iWeapon, -1); Money_AddMoney(pl, -g_cstrikeWeaponPrice[iWeapon]); Sound_Play(pl, CHAN_ITEM, "buy.weapon"); } else { @@ -142,15 +142,15 @@ CSEv_BuyEquipment_f(float fUtil) Sound_Play(pl, CHAN_ITEM, "buy.kevlar"); break; case 2: - Weapons_AddItem(pl, WEAPON_FLASHBANG); + Weapons_AddItem(pl, WEAPON_FLASHBANG, -1); Sound_Play(pl, CHAN_ITEM, "buy.weapon"); break; case 3: - Weapons_AddItem(pl, WEAPON_HEGRENADE); + Weapons_AddItem(pl, WEAPON_HEGRENADE, -1); Sound_Play(pl, CHAN_ITEM, "buy.weapon"); break; case 4: - Weapons_AddItem(pl, WEAPON_SMOKEGRENADE); + Weapons_AddItem(pl, WEAPON_SMOKEGRENADE, -1); Sound_Play(pl, CHAN_ITEM, "buy.weapon"); break; case 5: diff --git a/src/server/cstrike/gamerules_multiplayer.cpp b/src/server/cstrike/gamerules_multiplayer.cpp index 4bc29bc1..708b0ee4 100644 --- a/src/server/cstrike/gamerules_multiplayer.cpp +++ b/src/server/cstrike/gamerules_multiplayer.cpp @@ -27,6 +27,32 @@ CSMultiplayerRules::MaxItemPerSlot(int slot) void CSMultiplayerRules::PlayerDeath(player pl) { + /* obituary networking */ + WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET); + WriteByte(MSG_MULTICAST, EV_OBITUARY); + if (g_dmg_eAttacker.netname) + WriteString(MSG_MULTICAST, g_dmg_eAttacker.netname); + else + WriteString(MSG_MULTICAST, g_dmg_eAttacker.classname); + WriteString(MSG_MULTICAST, pl.netname); + WriteByte(MSG_MULTICAST, g_dmg_iWeapon); + WriteByte(MSG_MULTICAST, 0); + msg_entity = world; + multicast([0,0,0], MULTICAST_ALL); + + /* death-counter */ + pl.deaths++; + forceinfokey(pl, "*deaths", ftos(pl.deaths)); + + /* update score-counter */ + if (g_dmg_eTarget.flags & FL_CLIENT || g_dmg_eTarget.flags & FL_MONSTER) + if (g_dmg_eAttacker.flags & FL_CLIENT) { + if (g_dmg_eTarget == g_dmg_eAttacker || g_dmg_eTarget.team == g_dmg_eAttacker.team) + g_dmg_eAttacker.frags--; + else + g_dmg_eAttacker.frags++; + } + /* clear all ammo and inventory... */ PlayerClearWeaponry(pl); @@ -356,7 +382,7 @@ CSMultiplayerRules::BuyingPossible(player pl) void CSMultiplayerRules::MakeBomber(player pl) { - Weapons_AddItem(pl, WEAPON_C4BOMB); + Weapons_AddItem(pl, WEAPON_C4BOMB, -1); centerprint(pl, "You have the bomb!\nFind the target zone or DROP\nthe bomb for another Terrorist."); } @@ -778,13 +804,13 @@ CSMultiplayerRules::PlayerMakePlayable(player pl, int chara) } pl.g_items |= ITEM_SUIT; - Weapons_AddItem(pl, WEAPON_KNIFE); + Weapons_AddItem(pl, WEAPON_KNIFE, -1); if (chara < 5) { /* terrorists */ pl.team = TEAM_T; if (autocvar_fcs_knifeonly == FALSE) { - Weapons_AddItem(pl, WEAPON_GLOCK18); + Weapons_AddItem(pl, WEAPON_GLOCK18, -1); /*Weapon_GiveAmmo(WEAPON_GLOCK18, 40);*/ /*Weapon_Draw(WEAPON_GLOCK18);*/ } else { @@ -794,9 +820,8 @@ CSMultiplayerRules::PlayerMakePlayable(player pl, int chara) /* counter */ pl.team = TEAM_CT; - Weapons_AddItem(pl, WEAPON_KNIFE); if (autocvar_fcs_knifeonly == FALSE) { - Weapons_AddItem(pl, WEAPON_USP45); + Weapons_AddItem(pl, WEAPON_USP45, -1); /*Weapon_GiveAmmo(WEAPON_USP45, 24);*/ /*Weapon_Draw(WEAPON_USP45);*/ } else { diff --git a/src/server/cstrike/input.c b/src/server/cstrike/input.c index 74db8f56..321aa81d 100644 --- a/src/server/cstrike/input.c +++ b/src/server/cstrike/input.c @@ -53,33 +53,33 @@ Game_Input(void) pl.health = 100; pl.armor = 100; - Weapons_AddItem(pl, WEAPON_M3); - Weapons_AddItem(pl, WEAPON_XM1014); - Weapons_AddItem(pl, WEAPON_MP5); - Weapons_AddItem(pl, WEAPON_P90); - Weapons_AddItem(pl, WEAPON_UMP45); - Weapons_AddItem(pl, WEAPON_MAC10); - Weapons_AddItem(pl, WEAPON_TMP); - Weapons_AddItem(pl, WEAPON_AK47); - Weapons_AddItem(pl, WEAPON_SG552); - Weapons_AddItem(pl, WEAPON_M4A1); - Weapons_AddItem(pl, WEAPON_AUG); - Weapons_AddItem(pl, WEAPON_SCOUT); - Weapons_AddItem(pl, WEAPON_AWP); - Weapons_AddItem(pl, WEAPON_G3SG1); - Weapons_AddItem(pl, WEAPON_SG550); - Weapons_AddItem(pl, WEAPON_PARA); - Weapons_AddItem(pl, WEAPON_C4BOMB); - Weapons_AddItem(pl, WEAPON_FLASHBANG); - Weapons_AddItem(pl, WEAPON_HEGRENADE); - Weapons_AddItem(pl, WEAPON_SMOKEGRENADE); - Weapons_AddItem(pl, WEAPON_USP45); - Weapons_AddItem(pl, WEAPON_GLOCK18); - Weapons_AddItem(pl, WEAPON_DEAGLE); - Weapons_AddItem(pl, WEAPON_P228); - Weapons_AddItem(pl, WEAPON_ELITES); - Weapons_AddItem(pl, WEAPON_FIVESEVEN); - Weapons_AddItem(pl, WEAPON_KNIFE); + Weapons_AddItem(pl, WEAPON_M3, -1); + Weapons_AddItem(pl, WEAPON_XM1014, -1); + Weapons_AddItem(pl, WEAPON_MP5, -1); + Weapons_AddItem(pl, WEAPON_P90, -1); + Weapons_AddItem(pl, WEAPON_UMP45, -1); + Weapons_AddItem(pl, WEAPON_MAC10, -1); + Weapons_AddItem(pl, WEAPON_TMP, -1); + Weapons_AddItem(pl, WEAPON_AK47, -1); + Weapons_AddItem(pl, WEAPON_SG552, -1); + Weapons_AddItem(pl, WEAPON_M4A1, -1); + Weapons_AddItem(pl, WEAPON_AUG, -1); + Weapons_AddItem(pl, WEAPON_SCOUT, -1); + Weapons_AddItem(pl, WEAPON_AWP, -1); + Weapons_AddItem(pl, WEAPON_G3SG1, -1); + Weapons_AddItem(pl, WEAPON_SG550, -1); + Weapons_AddItem(pl, WEAPON_PARA, -1); + Weapons_AddItem(pl, WEAPON_C4BOMB, -1); + Weapons_AddItem(pl, WEAPON_FLASHBANG, -1); + Weapons_AddItem(pl, WEAPON_HEGRENADE, -1); + Weapons_AddItem(pl, WEAPON_SMOKEGRENADE, -1); + Weapons_AddItem(pl, WEAPON_USP45, -1); + Weapons_AddItem(pl, WEAPON_GLOCK18, -1); + Weapons_AddItem(pl, WEAPON_DEAGLE, -1); + Weapons_AddItem(pl, WEAPON_P228, -1); + Weapons_AddItem(pl, WEAPON_ELITES, -1); + Weapons_AddItem(pl, WEAPON_FIVESEVEN, -1); + Weapons_AddItem(pl, WEAPON_KNIFE, -1); } if (self.impulse == 102) { diff --git a/src/server/defs.h b/src/server/defs.h index a2e54978..d1cb6778 100644 --- a/src/server/defs.h +++ b/src/server/defs.h @@ -69,3 +69,11 @@ enumflags GF_SEMI_TOGGLED, GF_GAMESTARTS }; + +/* damage related tempglobals, like trace_* */ +entity g_dmg_eAttacker; +entity g_dmg_eTarget; +int g_dmg_iDamage; +int g_dmg_iHitBody; +int g_dmg_iFlags; +int g_dmg_iWeapon; diff --git a/src/server/gamerules.cpp b/src/server/gamerules.cpp index e29d2ecb..09957647 100644 --- a/src/server/gamerules.cpp +++ b/src/server/gamerules.cpp @@ -110,6 +110,36 @@ CGameRules::MaxItemPerSlot(int slot) return -1; } +void +CGameRules::IntermissionStart(void) +{ + if (m_iIntermission) + return; + + m_iIntermission = TRUE; + m_flIntermissionTime = time + 5.0f; + + /* make the clients aware */ + WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET); + WriteByte(MSG_MULTICAST, EV_INTERMISSION); + msg_entity = world; + multicast([0,0,0], MULTICAST_ALL); +} + +void +CGameRules::IntermissionEnd(void) +{ + if (!m_iIntermission) + return; + if (time < m_flIntermissionTime) + return; + + if (!(input_buttons & INPUT_BUTTON0) && !(input_buttons & INPUT_BUTTON2)) + return; + + localcmd("restart\n"); +} + void CGameRules::CGameRules(void) { diff --git a/src/server/gamerules.h b/src/server/gamerules.h index 16e9b231..888bc1ff 100644 --- a/src/server/gamerules.h +++ b/src/server/gamerules.h @@ -16,6 +16,9 @@ class CGameRules { + int m_iIntermission; + float m_flIntermissionTime; + void() CGameRules; virtual void(void) InitPostEnts; @@ -40,6 +43,10 @@ class CGameRules virtual int(int) MaxItemPerSlot; + /* end of a game */ + virtual void(void) IntermissionStart; + virtual void(void) IntermissionEnd; + /* spectator */ /*virtual void(player) SpectatorConnect; virtual void(player) SpectatorDisconnect; diff --git a/src/server/gearbox/input.c b/src/server/gearbox/input.c index 5bf572c5..045adec9 100644 --- a/src/server/gearbox/input.c +++ b/src/server/gearbox/input.c @@ -43,30 +43,30 @@ Game_Input(void) pl.health = 100; pl.armor = 100; pl.g_items |= ITEM_SUIT; - Weapons_AddItem(pl, WEAPON_CROWBAR); - Weapons_AddItem(pl, WEAPON_GLOCK); - Weapons_AddItem(pl, WEAPON_PYTHON); - Weapons_AddItem(pl, WEAPON_MP5); - Weapons_AddItem(pl, WEAPON_SHOTGUN); - Weapons_AddItem(pl, WEAPON_CROSSBOW); - Weapons_AddItem(pl, WEAPON_RPG); - Weapons_AddItem(pl, WEAPON_GAUSS); - Weapons_AddItem(pl, WEAPON_EGON); - Weapons_AddItem(pl, WEAPON_HORNETGUN); - Weapons_AddItem(pl, WEAPON_HANDGRENADE); - Weapons_AddItem(pl, WEAPON_SATCHEL); - Weapons_AddItem(pl, WEAPON_TRIPMINE); - Weapons_AddItem(pl, WEAPON_SNARK); - Weapons_AddItem(pl, WEAPON_PENGUIN); - Weapons_AddItem(pl, WEAPON_PIPEWRENCH); - Weapons_AddItem(pl, WEAPON_KNIFE); - Weapons_AddItem(pl, WEAPON_GRAPPLE); - Weapons_AddItem(pl, WEAPON_EAGLE); - Weapons_AddItem(pl, WEAPON_M249); - Weapons_AddItem(pl, WEAPON_SHOCKRIFLE); - Weapons_AddItem(pl, WEAPON_SPORELAUNCHER); - Weapons_AddItem(pl, WEAPON_SNIPERRIFLE); - Weapons_AddItem(pl, WEAPON_DISPLACER); + Weapons_AddItem(pl, WEAPON_CROWBAR, -1); + Weapons_AddItem(pl, WEAPON_GLOCK, -1); + Weapons_AddItem(pl, WEAPON_PYTHON, -1); + Weapons_AddItem(pl, WEAPON_MP5, -1); + Weapons_AddItem(pl, WEAPON_SHOTGUN, -1); + Weapons_AddItem(pl, WEAPON_CROSSBOW, -1); + Weapons_AddItem(pl, WEAPON_RPG, -1); + Weapons_AddItem(pl, WEAPON_GAUSS, -1); + Weapons_AddItem(pl, WEAPON_EGON, -1); + Weapons_AddItem(pl, WEAPON_HORNETGUN, -1); + Weapons_AddItem(pl, WEAPON_HANDGRENADE, -1); + Weapons_AddItem(pl, WEAPON_SATCHEL, -1); + Weapons_AddItem(pl, WEAPON_TRIPMINE, -1); + Weapons_AddItem(pl, WEAPON_SNARK, -1); + Weapons_AddItem(pl, WEAPON_PENGUIN, -1); + Weapons_AddItem(pl, WEAPON_PIPEWRENCH, -1); + Weapons_AddItem(pl, WEAPON_KNIFE, -1); + Weapons_AddItem(pl, WEAPON_GRAPPLE, -1); + Weapons_AddItem(pl, WEAPON_EAGLE, -1); + Weapons_AddItem(pl, WEAPON_M249, -1); + Weapons_AddItem(pl, WEAPON_SHOCKRIFLE, -1); + Weapons_AddItem(pl, WEAPON_SPORELAUNCHER, -1); + Weapons_AddItem(pl, WEAPON_SNIPERRIFLE, -1); + Weapons_AddItem(pl, WEAPON_DISPLACER, -1); } if (self.impulse == 102) { diff --git a/src/server/hunger/input.c b/src/server/hunger/input.c index 12914bee..461bf9e5 100644 --- a/src/server/hunger/input.c +++ b/src/server/hunger/input.c @@ -49,27 +49,27 @@ void Game_Input(void) pl.health = 100; pl.armor = 100; pl.g_items |= ITEM_SUIT; - Weapons_AddItem(pl, WEAPON_CROWBAR); - Weapons_AddItem(pl, WEAPON_SHOVEL); - Weapons_AddItem(pl, WEAPON_SPANNER); - Weapons_AddItem(pl, WEAPON_GLOCK); - Weapons_AddItem(pl, WEAPON_PYTHON); - Weapons_AddItem(pl, WEAPON_AP9); - Weapons_AddItem(pl, WEAPON_TAURUS); - Weapons_AddItem(pl, WEAPON_MP5); - Weapons_AddItem(pl, WEAPON_SHOTGUN); - Weapons_AddItem(pl, WEAPON_CROSSBOW); - Weapons_AddItem(pl, WEAPON_SNIPER); - Weapons_AddItem(pl, WEAPON_SNIPER2); - Weapons_AddItem(pl, WEAPON_RPG); - Weapons_AddItem(pl, WEAPON_GAUSS); - Weapons_AddItem(pl, WEAPON_EGON); - Weapons_AddItem(pl, WEAPON_CHAINGUN); - Weapons_AddItem(pl, WEAPON_HANDGRENADE); - Weapons_AddItem(pl, WEAPON_SATCHEL); - Weapons_AddItem(pl, WEAPON_TRIPMINE); - Weapons_AddItem(pl, WEAPON_SNARK); - Weapons_AddItem(pl, WEAPON_MEDKIT); + Weapons_AddItem(pl, WEAPON_CROWBAR, -1); + Weapons_AddItem(pl, WEAPON_SHOVEL, -1); + Weapons_AddItem(pl, WEAPON_SPANNER, -1); + Weapons_AddItem(pl, WEAPON_GLOCK, -1); + Weapons_AddItem(pl, WEAPON_PYTHON, -1); + Weapons_AddItem(pl, WEAPON_AP9, -1); + Weapons_AddItem(pl, WEAPON_TAURUS, -1); + Weapons_AddItem(pl, WEAPON_MP5, -1); + Weapons_AddItem(pl, WEAPON_SHOTGUN, -1); + Weapons_AddItem(pl, WEAPON_CROSSBOW, -1); + Weapons_AddItem(pl, WEAPON_SNIPER, -1); + Weapons_AddItem(pl, WEAPON_SNIPER2, -1); + Weapons_AddItem(pl, WEAPON_RPG, -1); + Weapons_AddItem(pl, WEAPON_GAUSS, -1); + Weapons_AddItem(pl, WEAPON_EGON, -1); + Weapons_AddItem(pl, WEAPON_CHAINGUN, -1); + Weapons_AddItem(pl, WEAPON_HANDGRENADE, -1); + Weapons_AddItem(pl, WEAPON_SATCHEL, -1); + Weapons_AddItem(pl, WEAPON_TRIPMINE, -1); + Weapons_AddItem(pl, WEAPON_SNARK, -1); + Weapons_AddItem(pl, WEAPON_MEDKIT, -1); } if (self.impulse == 102) { diff --git a/src/server/poke646/gamerules_multiplayer.cpp b/src/server/poke646/gamerules_multiplayer.cpp index e7e2db62..10a7571d 100644 --- a/src/server/poke646/gamerules_multiplayer.cpp +++ b/src/server/poke646/gamerules_multiplayer.cpp @@ -14,6 +14,15 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +void +HLMultiplayerRules::FrameStart(void) +{ + if (cvar("mp_timelimit") != 0) + if (time >= (cvar("mp_timelimit") * 60)) { + IntermissionStart(); + } +} + void HLMultiplayerRules::PlayerDeath(player pl) { diff --git a/src/server/poke646/input.c b/src/server/poke646/input.c index 4839d580..377c39a6 100644 --- a/src/server/poke646/input.c +++ b/src/server/poke646/input.c @@ -42,13 +42,13 @@ Game_Input(void) if (self.impulse == 101) { pl.health = 100; pl.armor = 100; - Weapons_AddItem(pl, WEAPON_HEATERPIPE); - Weapons_AddItem(pl, WEAPON_BRADNAILER); - Weapons_AddItem(pl, WEAPON_NAILGUN); - Weapons_AddItem(pl, WEAPON_SHOTGUN); - Weapons_AddItem(pl, WEAPON_CMLWBR); - Weapons_AddItem(pl, WEAPON_XS); - Weapons_AddItem(pl, WEAPON_SATCHEL); + Weapons_AddItem(pl, WEAPON_HEATERPIPE, -1); + Weapons_AddItem(pl, WEAPON_BRADNAILER, -1); + Weapons_AddItem(pl, WEAPON_NAILGUN, -1); + Weapons_AddItem(pl, WEAPON_SHOTGUN, -1); + Weapons_AddItem(pl, WEAPON_CMLWBR, -1); + Weapons_AddItem(pl, WEAPON_XS, -1); + Weapons_AddItem(pl, WEAPON_SATCHEL, -1); } if (self.impulse == 102) { diff --git a/src/server/rewolf/gamerules_multiplayer.cpp b/src/server/rewolf/gamerules_multiplayer.cpp index 064c25df..c53d3de5 100644 --- a/src/server/rewolf/gamerules_multiplayer.cpp +++ b/src/server/rewolf/gamerules_multiplayer.cpp @@ -14,6 +14,15 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +void +HLMultiplayerRules::FrameStart(void) +{ + if (cvar("mp_timelimit") != 0) + if (time >= (cvar("mp_timelimit") * 60)) { + IntermissionStart(); + } +} + void HLMultiplayerRules::PlayerDeath(player pl) { diff --git a/src/server/rewolf/input.c b/src/server/rewolf/input.c index 4d9a239e..8a2b6f0d 100644 --- a/src/server/rewolf/input.c +++ b/src/server/rewolf/input.c @@ -42,15 +42,15 @@ Game_Input(void) if (self.impulse == 101) { pl.health = 100; pl.armor = 100; - Weapons_AddItem(pl, WEAPON_FISTS); - Weapons_AddItem(pl, WEAPON_GAUSSPISTOL); - Weapons_AddItem(pl, WEAPON_BEAMGUN); - Weapons_AddItem(pl, WEAPON_CHEMICALGUN); - Weapons_AddItem(pl, WEAPON_DML); - Weapons_AddItem(pl, WEAPON_MINIGUN); - Weapons_AddItem(pl, WEAPON_AICORE); - Weapons_AddItem(pl, WEAPON_SHOTGUN); - Weapons_AddItem(pl, WEAPON_GRENADE); + Weapons_AddItem(pl, WEAPON_FISTS, -1); + Weapons_AddItem(pl, WEAPON_GAUSSPISTOL, -1); + Weapons_AddItem(pl, WEAPON_BEAMGUN, -1); + Weapons_AddItem(pl, WEAPON_CHEMICALGUN, -1); + Weapons_AddItem(pl, WEAPON_DML, -1); + Weapons_AddItem(pl, WEAPON_MINIGUN, -1); + Weapons_AddItem(pl, WEAPON_AICORE, -1); + Weapons_AddItem(pl, WEAPON_SHOTGUN, -1); + Weapons_AddItem(pl, WEAPON_GRENADE, -1); } if (self.impulse == 102) { diff --git a/src/server/scihunt/shdata_parse.c b/src/server/scihunt/shdata_parse.c index 63a3aac6..90f07b38 100644 --- a/src/server/scihunt/shdata_parse.c +++ b/src/server/scihunt/shdata_parse.c @@ -94,23 +94,23 @@ void SHData_GetItems(player pl) pl.ammo_m203_grenade = 3; pl.ammo_rocket = 5; pl.ammo_snark = 10; - Weapons_AddItem(pl, WEAPON_CROWBAR); - Weapons_AddItem(pl, WEAPON_GLOCK); - Weapons_AddItem(pl, WEAPON_PYTHON); - Weapons_AddItem(pl, WEAPON_MP5); - Weapons_AddItem(pl, WEAPON_SHOTGUN); - Weapons_AddItem(pl, WEAPON_CROSSBOW); - Weapons_AddItem(pl, WEAPON_RPG); - Weapons_AddItem(pl, WEAPON_GAUSS); - Weapons_AddItem(pl, WEAPON_EGON); - Weapons_AddItem(pl, WEAPON_HORNETGUN); - Weapons_AddItem(pl, WEAPON_HANDGRENADE); - Weapons_AddItem(pl, WEAPON_SATCHEL); - Weapons_AddItem(pl, WEAPON_TRIPMINE); - Weapons_AddItem(pl, WEAPON_SNARK); - Weapons_AddItem(pl, WEAPON_CANNON); - Weapons_AddItem(pl, WEAPON_CHAINSAW); - Weapons_AddItem(pl, WEAPON_HAMMER); + Weapons_AddItem(pl, WEAPON_CROWBAR, -1); + Weapons_AddItem(pl, WEAPON_GLOCK, -1); + Weapons_AddItem(pl, WEAPON_PYTHON, -1); + Weapons_AddItem(pl, WEAPON_MP5, -1); + Weapons_AddItem(pl, WEAPON_SHOTGUN, -1); + Weapons_AddItem(pl, WEAPON_CROSSBOW, -1); + Weapons_AddItem(pl, WEAPON_RPG, -1); + Weapons_AddItem(pl, WEAPON_GAUSS, -1); + Weapons_AddItem(pl, WEAPON_EGON, -1); + Weapons_AddItem(pl, WEAPON_HORNETGUN, -1); + Weapons_AddItem(pl, WEAPON_HANDGRENADE, -1); + Weapons_AddItem(pl, WEAPON_SATCHEL, -1); + Weapons_AddItem(pl, WEAPON_TRIPMINE, -1); + Weapons_AddItem(pl, WEAPON_SNARK, -1); + Weapons_AddItem(pl, WEAPON_CANNON, -1); + Weapons_AddItem(pl, WEAPON_CHAINSAW, -1); + Weapons_AddItem(pl, WEAPON_HAMMER, -1); } void SHData_Parse(string map) diff --git a/src/server/tfc/spawn.c b/src/server/tfc/spawn.c index 4f1748fa..703d0dc4 100644 --- a/src/server/tfc/spawn.c +++ b/src/server/tfc/spawn.c @@ -109,64 +109,64 @@ CSEv_TeamJoin_f(float f) switch (f) { case CLASS_SCOUT: - Weapons_AddItem(pl, WEAPON_CROWBAR); - Weapons_AddItem(pl, WEAPON_SBS); - Weapons_AddItem(pl, WEAPON_NAILGUN); + Weapons_AddItem(pl, WEAPON_CROWBAR, -1); + Weapons_AddItem(pl, WEAPON_SBS, -1); + Weapons_AddItem(pl, WEAPON_NAILGUN, -1); env_message_single(pl, "HELP_SCOUT"); break; case CLASS_SNIPER: - Weapons_AddItem(pl, WEAPON_CROWBAR); - Weapons_AddItem(pl, WEAPON_SNIPER); - Weapons_AddItem(pl, WEAPON_AUTORIFLE); - Weapons_AddItem(pl, WEAPON_NAILGUN); + Weapons_AddItem(pl, WEAPON_CROWBAR, -1); + Weapons_AddItem(pl, WEAPON_SNIPER, -1); + Weapons_AddItem(pl, WEAPON_AUTORIFLE, -1); + Weapons_AddItem(pl, WEAPON_NAILGUN, -1); env_message_single(pl, "HELP_SNIPER"); break; case CLASS_SOLDIER: - Weapons_AddItem(pl, WEAPON_CROWBAR); - Weapons_AddItem(pl, WEAPON_SBS); - Weapons_AddItem(pl, WEAPON_DBS); - Weapons_AddItem(pl, WEAPON_RPG); + Weapons_AddItem(pl, WEAPON_CROWBAR, -1); + Weapons_AddItem(pl, WEAPON_SBS, -1); + Weapons_AddItem(pl, WEAPON_DBS, -1); + Weapons_AddItem(pl, WEAPON_RPG, -1); env_message_single(pl, "HELP_SOLDIER"); break; case CLASS_DEMO: - Weapons_AddItem(pl, WEAPON_CROWBAR); - Weapons_AddItem(pl, WEAPON_SBS); - Weapons_AddItem(pl, WEAPON_GLAUNCHER); - Weapons_AddItem(pl, WEAPON_PIPEBOMB); + Weapons_AddItem(pl, WEAPON_CROWBAR, -1); + Weapons_AddItem(pl, WEAPON_SBS, -1); + Weapons_AddItem(pl, WEAPON_GLAUNCHER, -1); + Weapons_AddItem(pl, WEAPON_PIPEBOMB, -1); env_message_single(pl, "HELP_DEMOMAN"); break; case CLASS_MEDIC: - Weapons_AddItem(pl, WEAPON_MEDKIT); - Weapons_AddItem(pl, WEAPON_SBS); - Weapons_AddItem(pl, WEAPON_DBS); - Weapons_AddItem(pl, WEAPON_SUPERNAIL); + Weapons_AddItem(pl, WEAPON_MEDKIT, -1); + Weapons_AddItem(pl, WEAPON_SBS, -1); + Weapons_AddItem(pl, WEAPON_DBS, -1); + Weapons_AddItem(pl, WEAPON_SUPERNAIL, -1); env_message_single(pl, "HELP_MEDIC"); break; case CLASS_HVYWEAPON: - Weapons_AddItem(pl, WEAPON_CROWBAR); - Weapons_AddItem(pl, WEAPON_SBS); - Weapons_AddItem(pl, WEAPON_DBS); - Weapons_AddItem(pl, WEAPON_ASSCAN); + Weapons_AddItem(pl, WEAPON_CROWBAR, -1); + Weapons_AddItem(pl, WEAPON_SBS, -1); + Weapons_AddItem(pl, WEAPON_DBS, -1); + Weapons_AddItem(pl, WEAPON_ASSCAN, -1); env_message_single(pl, "HELP_HWGUY"); break; case CLASS_PYRO: - Weapons_AddItem(pl, WEAPON_CROWBAR); - Weapons_AddItem(pl, WEAPON_SBS); - Weapons_AddItem(pl, WEAPON_FLAMER); - Weapons_AddItem(pl, WEAPON_INCENDIARY); + Weapons_AddItem(pl, WEAPON_CROWBAR, -1); + Weapons_AddItem(pl, WEAPON_SBS, -1); + Weapons_AddItem(pl, WEAPON_FLAMER, -1); + Weapons_AddItem(pl, WEAPON_INCENDIARY, -1); env_message_single(pl, "HELP_PYRO"); break; case CLASS_SPY: - Weapons_AddItem(pl, WEAPON_KNIFE); - Weapons_AddItem(pl, WEAPON_TRANQUIL); - Weapons_AddItem(pl, WEAPON_DBS); - Weapons_AddItem(pl, WEAPON_NAILGUN); + Weapons_AddItem(pl, WEAPON_KNIFE, -1); + Weapons_AddItem(pl, WEAPON_TRANQUIL, -1); + Weapons_AddItem(pl, WEAPON_DBS, -1); + Weapons_AddItem(pl, WEAPON_NAILGUN, -1); env_message_single(pl, "HELP_SPY"); break; case CLASS_ENGINEER: - Weapons_AddItem(pl, WEAPON_WRENCH); - Weapons_AddItem(pl, WEAPON_RAILGUN); - Weapons_AddItem(pl, WEAPON_DBS); + Weapons_AddItem(pl, WEAPON_WRENCH, -1); + Weapons_AddItem(pl, WEAPON_RAILGUN, -1); + Weapons_AddItem(pl, WEAPON_DBS, -1); env_message_single(pl, "HELP_ENGINEER"); break; } diff --git a/src/server/valve/damage.c b/src/server/valve/damage.c index 8eab17de..a4ff78b2 100644 --- a/src/server/valve/damage.c +++ b/src/server/valve/damage.c @@ -14,24 +14,6 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* someone dieded */ -void -Damage_Obituary(entity c, entity t, float weapon, float flags) -{ - WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET); - WriteByte(MSG_MULTICAST, EV_OBITUARY); - if (c.netname) { - WriteString(MSG_MULTICAST, c.netname); - } else { - WriteString(MSG_MULTICAST, c.classname); - } - WriteString(MSG_MULTICAST, t.netname); - WriteByte(MSG_MULTICAST, weapon); - WriteByte(MSG_MULTICAST, flags); - msg_entity = self; - multicast([0,0,0], MULTICAST_ALL); -} - /* generic function that applies damage, pain and suffering */ void Damage_Apply(entity t, entity c, float dmg, int w, int type) @@ -69,6 +51,14 @@ Damage_Apply(entity t, entity c, float dmg, int w, int type) dmg = rint(dmg); t.health -= dmg; + /* the globals... */ + g_dmg_eAttacker = c; + g_dmg_eTarget = t; + g_dmg_iDamage = dmg; + g_dmg_iHitBody = trace_surface_id; + g_dmg_iFlags = type; + g_dmg_iWeapon = w; + if (dmg > 0) { t.dmg_take = dmg; t.dmg_inflictor = c; @@ -76,30 +66,12 @@ Damage_Apply(entity t, entity c, float dmg, int w, int type) t.health = t.max_health; } - // Target is dead and a client.... - if (t.health <= 0) { - if (t.flags & FL_CLIENT) { - t.deaths++; - forceinfokey(t, "*deaths", ftos(t.deaths)); - } - - if (t.flags & FL_CLIENT || t.flags & FL_MONSTER) - if (c.flags & FL_CLIENT) - if (t == c) - c.frags--; - else - c.frags++; - } - /* set this global in case we need it later */ g_eAttacker = c; CBaseEntity s = (CBaseEntity)t; if (s.health <= 0) { - if (t.flags & FL_MONSTER || t.flags & FL_CLIENT) { - Damage_Obituary(c, t, w, 0); - } if (s.flags & FL_CLIENT) { rules.PlayerDeath((player)s); } else { diff --git a/src/server/valve/gamerules.h b/src/server/valve/gamerules.h index 028b9f78..390d51da 100644 --- a/src/server/valve/gamerules.h +++ b/src/server/valve/gamerules.h @@ -37,6 +37,11 @@ class HLSingleplayerRules:HLGameRules class HLMultiplayerRules:HLGameRules { + int m_iIntermission; + int m_iIntermissionTime; + + virtual void(void) FrameStart; + /* client */ virtual void(player) PlayerSpawn; virtual void(player) PlayerDeath; diff --git a/src/server/valve/gamerules_multiplayer.cpp b/src/server/valve/gamerules_multiplayer.cpp index 80d5a67f..8c454572 100644 --- a/src/server/valve/gamerules_multiplayer.cpp +++ b/src/server/valve/gamerules_multiplayer.cpp @@ -14,9 +14,50 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +void +HLMultiplayerRules::FrameStart(void) +{ + if (cvar("mp_timelimit")) + if (time >= (cvar("mp_timelimit") * 60)) { + IntermissionStart(); + } +} + void HLMultiplayerRules::PlayerDeath(player pl) { + /* obituary networking */ + WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET); + WriteByte(MSG_MULTICAST, EV_OBITUARY); + if (g_dmg_eAttacker.netname) + WriteString(MSG_MULTICAST, g_dmg_eAttacker.netname); + else + WriteString(MSG_MULTICAST, g_dmg_eAttacker.classname); + WriteString(MSG_MULTICAST, pl.netname); + WriteByte(MSG_MULTICAST, g_dmg_iWeapon); + WriteByte(MSG_MULTICAST, 0); + msg_entity = world; + multicast([0,0,0], MULTICAST_ALL); + + /* death-counter */ + pl.deaths++; + forceinfokey(pl, "*deaths", ftos(pl.deaths)); + + /* update score-counter */ + if (pl.flags & FL_CLIENT || pl.flags & FL_MONSTER) + if (g_dmg_eAttacker.flags & FL_CLIENT) { + if (pl == g_dmg_eAttacker) + g_dmg_eAttacker.frags--; + else + g_dmg_eAttacker.frags++; + } + + /* in DM we only care about the frags */ + if (cvar("mp_fraglimit")) + if (g_dmg_eAttacker.frags >= cvar("mp_fraglimit")) { + IntermissionStart(); + } + weaponbox_spawn(pl); pl.movetype = MOVETYPE_NONE; pl.solid = SOLID_NOT; diff --git a/src/server/valve/input.c b/src/server/valve/input.c index 3ff630c6..05f368ed 100644 --- a/src/server/valve/input.c +++ b/src/server/valve/input.c @@ -23,6 +23,13 @@ Handles impulse and whatnot */ void Game_Input(void) { + CGameRules rules = (CGameRules)g_grMode; + + if (rules.m_iIntermission) { + rules.IntermissionEnd(); + return; + } + if (input_buttons & INPUT_BUTTON0) { Weapons_Primary(); } else if (input_buttons & INPUT_BUTTON4) { @@ -52,20 +59,20 @@ void Game_Input(void) pl.health = 100; pl.armor = 100; pl.g_items |= ITEM_SUIT; - Weapons_AddItem(pl, WEAPON_CROWBAR); - Weapons_AddItem(pl, WEAPON_GLOCK); - Weapons_AddItem(pl, WEAPON_PYTHON); - Weapons_AddItem(pl, WEAPON_MP5); - Weapons_AddItem(pl, WEAPON_SHOTGUN); - Weapons_AddItem(pl, WEAPON_CROSSBOW); - Weapons_AddItem(pl, WEAPON_RPG); - Weapons_AddItem(pl, WEAPON_GAUSS); - Weapons_AddItem(pl, WEAPON_EGON); - Weapons_AddItem(pl, WEAPON_HORNETGUN); - Weapons_AddItem(pl, WEAPON_HANDGRENADE); - Weapons_AddItem(pl, WEAPON_SATCHEL); - Weapons_AddItem(pl, WEAPON_TRIPMINE); - Weapons_AddItem(pl, WEAPON_SNARK); + Weapons_AddItem(pl, WEAPON_CROWBAR, -1); + Weapons_AddItem(pl, WEAPON_GLOCK, -1); + Weapons_AddItem(pl, WEAPON_PYTHON, -1); + Weapons_AddItem(pl, WEAPON_MP5, -1); + Weapons_AddItem(pl, WEAPON_SHOTGUN, -1); + Weapons_AddItem(pl, WEAPON_CROSSBOW, -1); + Weapons_AddItem(pl, WEAPON_RPG, -1); + Weapons_AddItem(pl, WEAPON_GAUSS, -1); + Weapons_AddItem(pl, WEAPON_EGON, -1); + Weapons_AddItem(pl, WEAPON_HORNETGUN, -1); + Weapons_AddItem(pl, WEAPON_HANDGRENADE, -1); + Weapons_AddItem(pl, WEAPON_SATCHEL, -1); + Weapons_AddItem(pl, WEAPON_TRIPMINE, -1); + Weapons_AddItem(pl, WEAPON_SNARK, -1); } if (self.impulse == 102) { diff --git a/src/server/valve/items.cpp b/src/server/valve/items.cpp index 81b7ef73..da41cfb7 100644 --- a/src/server/valve/items.cpp +++ b/src/server/valve/items.cpp @@ -34,7 +34,7 @@ void item_pickup::touch(void) } /* don't remove if AddItem fails */ - if (Weapons_AddItem((player)other, id) == FALSE) { + if (Weapons_AddItem((player)other, id, m_iClip) == FALSE) { return; } @@ -75,8 +75,10 @@ void item_pickup::Respawn(void) think = __NULL__; nextthink = -1; - if (!m_iWasDropped) + if (!m_iWasDropped) { sound(this, CHAN_ITEM, "items/suitchargeok1.wav", 1, ATTN_NORM, 150); + m_iClip = -1; + } droptofloor(); } diff --git a/src/server/vox.c b/src/server/vox.c index 9a2af893..d0992b51 100644 --- a/src/server/vox.c +++ b/src/server/vox.c @@ -56,7 +56,7 @@ void Vox_Broadcast(string sMessage) WriteByte(MSG_MULTICAST, EV_CHAT_VOX); WriteString(MSG_MULTICAST, sMessage); msg_entity = world; - multicast([0,0,0], MULTICAST_ALL); + multicast([0,0,0], MULTICAST_ALL); } /* diff --git a/src/shared/cstrike/w_ak47.c b/src/shared/cstrike/w_ak47.c index ca7a9aea..876ae568 100644 --- a/src/shared/cstrike/w_ak47.c +++ b/src/shared/cstrike/w_ak47.c @@ -75,13 +75,16 @@ w_ak47_deathmsg(void) } int -w_ak47_pickup(int new) +w_ak47_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.ak47_mag = 30; + if (startammo == -1) + pl.ak47_mag = 30; + else + pl.ak47_mag = startammo; } else { if (pl.ammo_762mm < 90) { pl.ammo_762mm = bound(0, pl.ammo_762mm + 30, 90); @@ -244,12 +247,11 @@ w_ak47_hudpic(int selected, vector pos, float a) weapon_t w_ak47 = { - .id = ITEM_AK47, + .name = "ak47", + .id = ITEM_AK47, .slot = 0, .slot_pos = 7, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,80], + .allow_drop = TRUE, .draw = w_ak47_draw, .holster = __NULL__, .primary = w_ak47_primary, diff --git a/src/shared/cstrike/w_aug.c b/src/shared/cstrike/w_aug.c index 32abd631..d30565c4 100644 --- a/src/shared/cstrike/w_aug.c +++ b/src/shared/cstrike/w_aug.c @@ -75,13 +75,16 @@ w_aug_deathmsg(void) } int -w_aug_pickup(int new) +w_aug_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.aug_mag = 30; + if (startammo == -1) + pl.aug_mag = 30; + else + pl.aug_mag = startammo; } else { if (pl.ammo_762mm < 90) { pl.ammo_762mm = bound(0, pl.ammo_762mm + 30, 90); @@ -269,27 +272,26 @@ w_aug_hudpic(int selected, vector pos, float a) weapon_t w_aug = { - ITEM_AUG, - 0, - 10, - "sprites/640hud1.spr_0.tga", - [44,16], - [148,240], - w_aug_draw, - __NULL__, - w_aug_primary, - w_aug_secondary, - w_aug_reload, - w_cstrike_weaponrelease, - w_aug_hud, - w_aug_precache, - w_aug_pickup, - w_aug_updateammo, - w_aug_wmodel, - w_aug_pmodel, - w_aug_deathmsg, - w_aug_aimanim, - w_aug_hudpic + .name = "aug", + .id = ITEM_AUG, + .slot = 0, + .slot_pos = 10, + .allow_drop = TRUE, + .draw = w_aug_draw, + .holster = __NULL__, + .primary = w_aug_primary, + .secondary = w_aug_secondary, + .reload = w_aug_reload, + .release = w_cstrike_weaponrelease, + .crosshair = w_aug_hud, + .precache = w_aug_precache, + .pickup = w_aug_pickup, + .updateammo = w_aug_updateammo, + .wmodel = w_aug_wmodel, + .pmodel = w_aug_pmodel, + .deathmsg = w_aug_deathmsg, + .aimanim = w_aug_aimanim, + .hudpic = w_aug_hudpic }; #ifdef SERVER diff --git a/src/shared/cstrike/w_awp.c b/src/shared/cstrike/w_awp.c index f797973d..f1c93c1a 100644 --- a/src/shared/cstrike/w_awp.c +++ b/src/shared/cstrike/w_awp.c @@ -75,13 +75,16 @@ w_awp_deathmsg(void) } int -w_awp_pickup(int new) +w_awp_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.awp_mag = 10; + if (startammo == -1) + pl.awp_mag = 10; + else + pl.awp_mag = startammo; } else { if (pl.ammo_338mag < 20) { pl.ammo_338mag = bound(0, pl.ammo_338mag + 10, 20); @@ -295,12 +298,11 @@ w_awp_hudpic(int selected, vector pos, float a) weapon_t w_awp = { + "awp", ITEM_AWP, 0, 12, - "sprites/640hud1.spr_0.tga", - [48,16], - [192,128], + TRUE, w_awp_draw, __NULL__, w_awp_primary, diff --git a/src/shared/cstrike/w_c4bomb.c b/src/shared/cstrike/w_c4bomb.c index 7d159c71..7ae37ddd 100644 --- a/src/shared/cstrike/w_c4bomb.c +++ b/src/shared/cstrike/w_c4bomb.c @@ -305,12 +305,11 @@ w_c4bomb_hudpic(int selected, vector pos, float a) weapon_t w_c4bomb = { + "c4", ITEM_C4BOMB, 4, 0, - "sprites/640hud1.spr_0.tga", - [32,16], - [224,240], + TRUE, w_c4bomb_draw, __NULL__, w_c4bomb_primary, diff --git a/src/shared/cstrike/w_deagle.c b/src/shared/cstrike/w_deagle.c index c7adc886..18af2644 100644 --- a/src/shared/cstrike/w_deagle.c +++ b/src/shared/cstrike/w_deagle.c @@ -74,13 +74,16 @@ w_deagle_deathmsg(void) } int -w_deagle_pickup(int new) +w_deagle_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.deagle_mag = 7; + if (startammo == -1) + pl.deagle_mag = 7; + else + pl.deagle_mag = startammo; } else { if (pl.ammo_50ae < AMMO_MAX_50AE) { pl.ammo_50ae = bound(0, pl.ammo_50ae + 7, AMMO_MAX_50AE); @@ -249,12 +252,11 @@ w_deagle_hudpic(int selected, vector pos, float a) weapon_t w_deagle = { + "deagle", ITEM_DEAGLE, 1, 2, - "sprites/640hud1.spr_0.tga", - [32,16], - [224,16], + TRUE, w_deagle_draw, __NULL__, w_deagle_primary, diff --git a/src/shared/cstrike/w_elites.c b/src/shared/cstrike/w_elites.c index 9da1565d..3c31d1cc 100644 --- a/src/shared/cstrike/w_elites.c +++ b/src/shared/cstrike/w_elites.c @@ -83,13 +83,16 @@ w_elites_deathmsg(void) } int -w_elites_pickup(int new) +w_elites_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.elites_mag = 30; + if (startammo == -1) + pl.elites_mag = 30; + else + pl.elites_mag = startammo; } else { if (pl.ammo_9mm < 90) { pl.ammo_9mm = bound(0, pl.ammo_9mm + 30, 90); @@ -300,12 +303,11 @@ w_elites_hudpic(int selected, vector pos, float a) weapon_t w_elites = { + "elites", ITEM_ELITES, 1, 4, - "sprites/640hud1.spr_0.tga", - [57,16], - [52,240], + TRUE, w_elites_draw, __NULL__, w_elites_primary, diff --git a/src/shared/cstrike/w_fiveseven.c b/src/shared/cstrike/w_fiveseven.c index a4c20d8d..08fc6584 100644 --- a/src/shared/cstrike/w_fiveseven.c +++ b/src/shared/cstrike/w_fiveseven.c @@ -74,13 +74,16 @@ w_fiveseven_deathmsg(void) } int -w_fiveseven_pickup(int new) +w_fiveseven_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.fiveseven_mag = 20; + if (startammo == -1) + pl.fiveseven_mag = 20; + else + pl.fiveseven_mag = startammo; } else { if (pl.ammo_57mm < 40) { pl.ammo_57mm = bound(0, pl.ammo_57mm + 20, 40); @@ -249,12 +252,11 @@ w_fiveseven_hudpic(int selected, vector pos, float a) weapon_t w_fiveseven = { + "fiveseven", ITEM_FIVESEVEN, 1, 5, - "sprites/640hud16.spr_0.tga", - [48,16], - [192,0], + TRUE, w_fiveseven_draw, __NULL__, w_fiveseven_primary, diff --git a/src/shared/cstrike/w_flashbang.c b/src/shared/cstrike/w_flashbang.c index ec28c9b1..2f36ce62 100644 --- a/src/shared/cstrike/w_flashbang.c +++ b/src/shared/cstrike/w_flashbang.c @@ -57,7 +57,7 @@ w_flashbang_updateammo(player pl) } int -w_flashbang_pickup(int new) +w_flashbang_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -263,12 +263,11 @@ w_flashbang_hudpic(int selected, vector pos, float a) weapon_t w_flashbang = { + "flashbang", ITEM_FLASHBANG, 3, 1, - "sprites/640hud1.spr_0.tga", - [48,16], - [192,192], + FALSE, w_flashbang_draw, __NULL__, w_flashbang_primary, diff --git a/src/shared/cstrike/w_g3sg1.c b/src/shared/cstrike/w_g3sg1.c index 79be3c38..aef40649 100644 --- a/src/shared/cstrike/w_g3sg1.c +++ b/src/shared/cstrike/w_g3sg1.c @@ -73,13 +73,16 @@ w_g3sg1_deathmsg(void) } int -w_g3sg1_pickup(int new) +w_g3sg1_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.g3sg1_mag = 20; + if (startammo == -1) + pl.g3sg1_mag = 20; + else + pl.g3sg1_mag = startammo; } else { if (pl.ammo_762mm < 60) { pl.ammo_762mm = bound(0, pl.ammo_762mm + 20, 60); @@ -260,12 +263,11 @@ w_g3sg1_hudpic(int selected, vector pos, float a) weapon_t w_g3sg1 = { + "g3sg1", ITEM_G3SG1, 0, 13, - "sprites/640hud1.spr_0.tga", - [48,16], - [192,144], + TRUE, w_g3sg1_draw, __NULL__, w_g3sg1_primary, diff --git a/src/shared/cstrike/w_glock18.c b/src/shared/cstrike/w_glock18.c index ebb00406..5a3811c4 100644 --- a/src/shared/cstrike/w_glock18.c +++ b/src/shared/cstrike/w_glock18.c @@ -84,13 +84,16 @@ w_glock18_deathmsg(void) } int -w_glock18_pickup(int new) +w_glock18_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.glock18_mag = 20; + if (startammo == -1) + pl.glock18_mag = 20; + else + pl.glock18_mag = startammo; } else { if (pl.ammo_9mm < 40) { pl.ammo_9mm = bound(0, pl.ammo_9mm + 20, 40); @@ -308,12 +311,11 @@ w_glock18_hudpic(int selected, vector pos, float a) weapon_t w_glock18 = { + "glock18", ITEM_GLOCK18, 1, 1, - "sprites/640hud1.spr_0.tga", - [32,16], - [192,16], + TRUE, w_glock18_draw, __NULL__, w_glock18_primary, diff --git a/src/shared/cstrike/w_hegrenade.c b/src/shared/cstrike/w_hegrenade.c index 83b31e29..eaa6f4ad 100644 --- a/src/shared/cstrike/w_hegrenade.c +++ b/src/shared/cstrike/w_hegrenade.c @@ -57,7 +57,7 @@ w_hegrenade_updateammo(player pl) } int -w_hegrenade_pickup(int new) +w_hegrenade_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -265,12 +265,11 @@ w_hegrenade_hudpic(int selected, vector pos, float a) weapon_t w_hegrenade = { + "hegrenade", ITEM_HEGRENADE, 3, 0, - "sprites/640hud1.spr_0.tga", - [32,16], - [224,192], + FALSE, w_hegrenade_draw, __NULL__, w_hegrenade_primary, diff --git a/src/shared/cstrike/w_knife.c b/src/shared/cstrike/w_knife.c index f992d812..ecf790c1 100644 --- a/src/shared/cstrike/w_knife.c +++ b/src/shared/cstrike/w_knife.c @@ -212,12 +212,11 @@ w_knife_hudpic(int selected, vector pos, float a) weapon_t w_knife = { + "knife", ITEM_KNIFE, 2, 0, - "sprites/640hud1.spr_0.tga", - [48,16], - [192,0], + FALSE, w_knife_draw, __NULL__, w_knife_primary, diff --git a/src/shared/cstrike/w_m3.c b/src/shared/cstrike/w_m3.c index 779e268f..d4dafb95 100644 --- a/src/shared/cstrike/w_m3.c +++ b/src/shared/cstrike/w_m3.c @@ -83,13 +83,16 @@ w_m3_deathmsg(void) } int -w_m3_pickup(int new) +w_m3_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.m3_mag = 8; + if (startammo == -1) + pl.m3_mag = 8; + else + pl.m3_mag = startammo; } else { if (pl.ammo_buckshot < AMMO_MAX_BUCKSHOT) { pl.ammo_buckshot = bound(0, pl.ammo_buckshot + 8, AMMO_MAX_BUCKSHOT); @@ -284,12 +287,11 @@ w_m3_hudpic(int selected, vector pos, float a) weapon_t w_m3 = { + "m3", ITEM_M3, 0, 0, - "sprites/640hud1.spr_0.tga", - [48,16], - [192,48], + TRUE, w_m3_draw, __NULL__, w_m3_primary, diff --git a/src/shared/cstrike/w_m4a1.c b/src/shared/cstrike/w_m4a1.c index 665a358d..16f11267 100644 --- a/src/shared/cstrike/w_m4a1.c +++ b/src/shared/cstrike/w_m4a1.c @@ -84,13 +84,16 @@ w_m4a1_deathmsg(void) } int -w_m4a1_pickup(int new) +w_m4a1_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.m4a1_mag = 30; + if (startammo == -1) + pl.m4a1_mag = 30; + else + pl.m4a1_mag = startammo; } else { if (pl.ammo_556mm < AMMO_MAX_762MM) { pl.ammo_556mm = bound(0, pl.ammo_556mm + 30, AMMO_MAX_762MM); @@ -334,12 +337,11 @@ w_m4a1_hudpic(int selected, vector pos, float a) weapon_t w_m4a1 = { - .id = ITEM_M4A1, + .name = "m4a1", + .id = ITEM_M4A1, .slot = 0, .slot_pos = 9, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,96], + .allow_drop = TRUE, .draw = w_m4a1_draw, .holster = __NULL__, .primary = w_m4a1_primary, diff --git a/src/shared/cstrike/w_mac10.c b/src/shared/cstrike/w_mac10.c index 9fa3378e..5b6c8bb7 100644 --- a/src/shared/cstrike/w_mac10.c +++ b/src/shared/cstrike/w_mac10.c @@ -74,13 +74,16 @@ w_mac10_deathmsg(void) } int -w_mac10_pickup(int new) +w_mac10_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.mac10_mag = 30; + if (startammo == -1) + pl.mac10_mag = 30; + else + pl.mac10_mag = startammo; } else { if (pl.ammo_45acp < 90) { pl.ammo_45acp = bound(0, pl.ammo_45acp + 30, 90); @@ -243,12 +246,11 @@ w_mac10_hudpic(int selected, vector pos, float a) weapon_t w_mac10 = { + "mac10", ITEM_MAC10, 0, 5, - "sprites/640hud1.spr_0.tga", - [34,16], - [109,240], + TRUE, w_mac10_draw, __NULL__, w_mac10_primary, diff --git a/src/shared/cstrike/w_mp5.c b/src/shared/cstrike/w_mp5.c index 1488516d..6aef7517 100644 --- a/src/shared/cstrike/w_mp5.c +++ b/src/shared/cstrike/w_mp5.c @@ -74,13 +74,16 @@ w_mp5_deathmsg(void) } int -w_mp5_pickup(int new) +w_mp5_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.mp5_mag = 30; + if (startammo == -1) + pl.mp5_mag = 30; + else + pl.mp5_mag = startammo; } else { if (pl.ammo_9mm < AMMO_MAX_9MM) { pl.ammo_9mm = bound(0, pl.ammo_9mm + 30, AMMO_MAX_9MM); @@ -248,12 +251,11 @@ w_mp5_hudpic(int selected, vector pos, float a) weapon_t w_mp5 = { + "mp5", ITEM_MP5, 0, 2, - "sprites/640hud1.spr_0.tga", - [32,16], - [192,64], + TRUE, w_mp5_draw, __NULL__, w_mp5_primary, diff --git a/src/shared/cstrike/w_p228.c b/src/shared/cstrike/w_p228.c index 3902c2d9..bb4f473a 100644 --- a/src/shared/cstrike/w_p228.c +++ b/src/shared/cstrike/w_p228.c @@ -77,13 +77,16 @@ w_p228_deathmsg(void) } int -w_p228_pickup(int new) +w_p228_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.p228_mag = 13; + if (startammo == -1) + pl.p228_mag = 13; + else + pl.p228_mag = startammo; } else { if (pl.ammo_357sig < 26) { pl.ammo_357sig = bound(0, pl.ammo_357sig + 13, 26); @@ -256,12 +259,11 @@ w_p228_hudpic(int selected, vector pos, float a) weapon_t w_p228 = { + "p228", ITEM_P228, 1, 3, - "sprites/640hud1.spr_0.tga", - [32,16], - [224,32], + TRUE, w_p228_draw, __NULL__, w_p228_primary, diff --git a/src/shared/cstrike/w_p90.c b/src/shared/cstrike/w_p90.c index 778075df..d8fcef52 100644 --- a/src/shared/cstrike/w_p90.c +++ b/src/shared/cstrike/w_p90.c @@ -74,13 +74,16 @@ w_p90_deathmsg(void) } int -w_p90_pickup(int new) +w_p90_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.p90_mag = 50; + if (startammo == -1) + pl.p90_mag = 50; + else + pl.p90_mag = startammo; } else { if (pl.ammo_57mm < 100) { pl.ammo_57mm = bound(0, pl.ammo_57mm + 50, 100); @@ -244,12 +247,11 @@ w_p90_hudpic(int selected, vector pos, float a) weapon_t w_p90 = { + "p90", ITEM_P90, 0, 3, - "sprites/640hud1.spr_0.tga", - [48,16], - [192,176], + TRUE, w_p90_draw, __NULL__, w_p90_primary, diff --git a/src/shared/cstrike/w_para.c b/src/shared/cstrike/w_para.c index 7b94118e..5153857e 100644 --- a/src/shared/cstrike/w_para.c +++ b/src/shared/cstrike/w_para.c @@ -73,13 +73,16 @@ w_para_deathmsg(void) } int -w_para_pickup(int new) +w_para_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.para_mag = 100; + if (startammo == -1) + pl.para_mag = 100; + else + pl.para_mag = startammo; } else { if (pl.ammo_556mmbox < 200) { pl.ammo_556mmbox = bound(0, pl.ammo_556mmbox + 100, 200); @@ -240,12 +243,11 @@ w_para_hudpic(int selected, vector pos, float a) weapon_t w_para = { + "para", ITEM_PARA, 0, 15, - "sprites/640hud1.spr_0.tga", - [48,16], - [192,160], + TRUE, w_para_draw, __NULL__, w_para_primary, diff --git a/src/shared/cstrike/w_scout.c b/src/shared/cstrike/w_scout.c index 7cadd722..0523893b 100644 --- a/src/shared/cstrike/w_scout.c +++ b/src/shared/cstrike/w_scout.c @@ -73,13 +73,16 @@ w_scout_deathmsg(void) } int -w_scout_pickup(int new) +w_scout_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.scout_mag = 10; + if (startammo == -1) + pl.scout_mag = 10; + else + pl.scout_mag = startammo; } else { if (pl.ammo_762mm < 30) { pl.ammo_762mm = bound(0, pl.ammo_762mm + 10, 30); @@ -292,12 +295,11 @@ w_scout_hudpic(int selected, vector pos, float a) weapon_t w_scout = { + "scout", ITEM_SCOUT, 0, 11, - "sprites/640hud1.spr_0.tga", - [48,16], - [192,208], + TRUE, w_scout_draw, __NULL__, w_scout_primary, diff --git a/src/shared/cstrike/w_sg550.c b/src/shared/cstrike/w_sg550.c index b9bb5425..7d998a3f 100644 --- a/src/shared/cstrike/w_sg550.c +++ b/src/shared/cstrike/w_sg550.c @@ -73,13 +73,16 @@ w_sg550_deathmsg(void) } int -w_sg550_pickup(int new) +w_sg550_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.sg550_mag = 30; + if (startammo == -1) + pl.sg550_mag = 30; + else + pl.sg550_mag = startammo; } else { if (pl.ammo_556mm < 90) { pl.ammo_556mm = bound(0, pl.ammo_556mm + 30, 90); @@ -261,12 +264,11 @@ w_sg550_hudpic(int selected, vector pos, float a) weapon_t w_sg550 = { + "sg550", ITEM_SG550, 0, 14, - "sprites/640hud16.spr_0.tga", - [48,16], - [192,48], + TRUE, w_sg550_draw, __NULL__, w_sg550_primary, diff --git a/src/shared/cstrike/w_sg552.c b/src/shared/cstrike/w_sg552.c index 4546cd5c..2e8524ef 100644 --- a/src/shared/cstrike/w_sg552.c +++ b/src/shared/cstrike/w_sg552.c @@ -74,13 +74,16 @@ w_sg552_deathmsg(void) } int -w_sg552_pickup(int new) +w_sg552_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.sg552_mag = 30; + if (startammo == -1) + pl.sg552_mag = 30; + else + pl.sg552_mag = startammo; } else { if (pl.ammo_556mm < 90) { pl.ammo_556mm = bound(0, pl.ammo_556mm + 30, 90); @@ -269,12 +272,11 @@ w_sg552_hudpic(int selected, vector pos, float a) weapon_t w_sg552 = { + "sg552", ITEM_SG552, 0, 8, - "sprites/640hud1.spr_0.tga", - [48,16], - [192,112], + TRUE, w_sg552_draw, __NULL__, w_sg552_primary, diff --git a/src/shared/cstrike/w_smokegrenade.c b/src/shared/cstrike/w_smokegrenade.c index 09eceda1..bfe335f7 100644 --- a/src/shared/cstrike/w_smokegrenade.c +++ b/src/shared/cstrike/w_smokegrenade.c @@ -57,7 +57,7 @@ w_smokegrenade_updateammo(player pl) } int -w_smokegrenade_pickup(int new) +w_smokegrenade_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -261,12 +261,11 @@ w_smokegrenade_hudpic(int selected, vector pos, float a) weapon_t w_smokegrenade = { + "smokegrenade", ITEM_SMOKEGRENADE, 3, 2, - "sprites/640hud1.spr_0.tga", - [32,16], - [224,192], + FALSE, w_smokegrenade_draw, __NULL__, w_smokegrenade_primary, diff --git a/src/shared/cstrike/w_tmp.c b/src/shared/cstrike/w_tmp.c index 5a7d0dfd..c3527a32 100644 --- a/src/shared/cstrike/w_tmp.c +++ b/src/shared/cstrike/w_tmp.c @@ -74,13 +74,16 @@ w_tmp_deathmsg(void) } int -w_tmp_pickup(int new) +w_tmp_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.tmp_mag = 30; + if (startammo == -1) + pl.tmp_mag = 30; + else + pl.tmp_mag = startammo; } else { if (pl.ammo_9mm < 90) { pl.ammo_9mm = bound(0, pl.ammo_9mm + 30, 90); @@ -244,12 +247,11 @@ w_tmp_hudpic(int selected, vector pos, float a) weapon_t w_tmp = { + "tmp", ITEM_TMP, 0, 6, - "sprites/640hud1.spr_0.tga", - [32,16], - [224,64], + TRUE, w_tmp_draw, __NULL__, w_tmp_primary, diff --git a/src/shared/cstrike/w_ump45.c b/src/shared/cstrike/w_ump45.c index 8b9f6380..7a796150 100644 --- a/src/shared/cstrike/w_ump45.c +++ b/src/shared/cstrike/w_ump45.c @@ -74,13 +74,16 @@ w_ump45_deathmsg(void) } int -w_ump45_pickup(int new) +w_ump45_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.ump45_mag = 25; + if (startammo == -1) + pl.ump45_mag = 25; + else + pl.ump45_mag = startammo; } else { if (pl.ammo_45acp < AMMO_MAX_45ACP) { pl.ammo_45acp = bound(0, pl.ammo_45acp + 25, AMMO_MAX_45ACP); @@ -244,12 +247,11 @@ w_ump45_hudpic(int selected, vector pos, float a) weapon_t w_ump45 = { + "ump45", ITEM_UMP45, 0, 4, - "sprites/640hud16.spr_0.tga", - [48,16], - [192,80], + TRUE, w_ump45_draw, __NULL__, w_ump45_primary, diff --git a/src/shared/cstrike/w_usp45.c b/src/shared/cstrike/w_usp45.c index 76f58703..82ff7669 100644 --- a/src/shared/cstrike/w_usp45.c +++ b/src/shared/cstrike/w_usp45.c @@ -87,13 +87,16 @@ w_usp45_deathmsg(void) } int -w_usp45_pickup(int new) +w_usp45_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.usp45_mag = 12; + if (startammo == -1) + pl.usp45_mag = 12; + else + pl.usp45_mag = startammo; } else { if (pl.ammo_45acp < AMMO_MAX_45ACP) { pl.ammo_45acp = bound(0, pl.ammo_45acp + 12, AMMO_MAX_45ACP); @@ -329,12 +332,11 @@ w_usp45_hudpic(int selected, vector pos, float a) weapon_t w_usp45 = { + "usp", ITEM_USP45, 1, 0, - "sprites/640hud1.spr_0.tga", - [32,16], - [192,32], + TRUE, w_usp45_draw, __NULL__, w_usp45_primary, diff --git a/src/shared/cstrike/w_xm1014.c b/src/shared/cstrike/w_xm1014.c index aa05c2db..d5cf94ea 100644 --- a/src/shared/cstrike/w_xm1014.c +++ b/src/shared/cstrike/w_xm1014.c @@ -84,13 +84,16 @@ w_xm1014_deathmsg(void) } int -w_xm1014_pickup(int new) +w_xm1014_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; if (new) { - pl.xm1014_mag = 7; + if (startammo == -1) + pl.xm1014_mag = 7; + else + pl.xm1014_mag = startammo; } else { if (pl.ammo_buckshot < AMMO_MAX_BUCKSHOT) { pl.ammo_buckshot = bound(0, pl.ammo_buckshot + 7, AMMO_MAX_BUCKSHOT); @@ -287,27 +290,26 @@ w_xm1014_hudpic(int selected, vector pos, float a) weapon_t w_xm1014 = { - ITEM_XM1014, - 0, - 1, - "sprites/640hud1.spr_0.tga", - [48,16], - [192,224], - w_xm1014_draw, - __NULL__, - w_xm1014_primary, - __NULL__, - w_xm1014_reload, - w_xm1014_release, - w_xm1014_hud, - w_xm1014_precache, - w_xm1014_pickup, - w_xm1014_updateammo, - w_xm1014_wmodel, - w_xm1014_pmodel, - w_xm1014_deathmsg, - w_xm1014_aimanim, - w_xm1014_hudpic + .name = "xm1014", + .id = ITEM_XM1014, + .slot = 0, + .slot_pos = 1, + .allow_drop = TRUE, + .draw = w_xm1014_draw, + .holster = __NULL__, + .primary = w_xm1014_primary, + .secondary = __NULL__, + .reload = w_xm1014_reload, + .release = w_xm1014_release, + .crosshair = w_xm1014_hud, + .precache = w_xm1014_precache, + .pickup = w_xm1014_pickup, + .updateammo = w_xm1014_updateammo, + .wmodel = w_xm1014_wmodel, + .pmodel = w_xm1014_pmodel, + .deathmsg = w_xm1014_deathmsg, + .aimanim = w_xm1014_aimanim, + .hudpic = w_xm1014_hudpic }; #ifdef SERVER diff --git a/src/shared/events.h b/src/shared/events.h index 4cc5a631..11fec048 100644 --- a/src/shared/events.h +++ b/src/shared/events.h @@ -17,6 +17,7 @@ // Network Events enum { + EV_INTERMISSION, EV_MUSICTRACK, EV_MUSICLOOP, EV_WEAPON_DRAW, diff --git a/src/shared/gearbox/w_displacer.c b/src/shared/gearbox/w_displacer.c index bfe3a9e6..7d543514 100644 --- a/src/shared/gearbox/w_displacer.c +++ b/src/shared/gearbox/w_displacer.c @@ -82,7 +82,7 @@ w_displacer_deathmsg(void) } int -w_displacer_pickup(int new) +w_displacer_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -356,12 +356,10 @@ w_displacer_hudpic(int selected, vector pos, float a) weapon_t w_displacer = { - .id = ITEM_DISPLACER, + .name = "displacer", + .id = ITEM_DISPLACER, .slot = 5, .slot_pos = 1, - .ki_spr = "sprites/320hudof01.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [48,208], .draw = w_displacer_draw, .holster = w_displacer_holster, .primary = w_displacer_primary, diff --git a/src/shared/gearbox/w_eagle.c b/src/shared/gearbox/w_eagle.c index 358c4315..e4622292 100644 --- a/src/shared/gearbox/w_eagle.c +++ b/src/shared/gearbox/w_eagle.c @@ -51,7 +51,7 @@ w_eagle_precache(void) } int -w_eagle_pickup(int new) +w_eagle_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -365,12 +365,10 @@ w_eagle_hudpic(int selected, vector pos, float a) weapon_t w_eagle = { - .id = ITEM_EAGLE, + .name = "eagle", + .id = ITEM_EAGLE, .slot = 1, .slot_pos = 2, - .ki_spr = "sprites/320hudof01.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [0,240], .draw = w_eagle_draw, .holster = w_eagle_holster, .primary = w_eagle_primary, diff --git a/src/shared/gearbox/w_grapple.c b/src/shared/gearbox/w_grapple.c index f18fa0a9..4bef3b49 100644 --- a/src/shared/gearbox/w_grapple.c +++ b/src/shared/gearbox/w_grapple.c @@ -282,12 +282,10 @@ w_grapple_hudpic(int selected, vector pos, float a) weapon_t w_grapple = { - .id = ITEM_GRAPPLE, + .name = "grapple", + .id = ITEM_GRAPPLE, .slot = 0, .slot_pos = 3, - .ki_spr = "sprites/320hudof01.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [0,224], .draw = w_grapple_draw, .holster = w_grapple_holster, .primary = w_grapple_primary, diff --git a/src/shared/gearbox/w_knife.c b/src/shared/gearbox/w_knife.c index d3451340..6523bc71 100644 --- a/src/shared/gearbox/w_knife.c +++ b/src/shared/gearbox/w_knife.c @@ -244,12 +244,10 @@ w_knife_hudpic(int selected, vector pos, float a) weapon_t w_knife = { - .id = ITEM_KNIFE, + .name = "knife", + .id = ITEM_KNIFE, .slot = 0, .slot_pos = 2, - .ki_spr = "sprites/320hudof01.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [96,224], .draw = w_knife_draw, .holster = w_knife_holster, .primary = w_knife_primary, diff --git a/src/shared/gearbox/w_m249.c b/src/shared/gearbox/w_m249.c index 4eb3e50b..ea6e6f79 100644 --- a/src/shared/gearbox/w_m249.c +++ b/src/shared/gearbox/w_m249.c @@ -49,7 +49,7 @@ w_m249_precache(void) } int -w_m249_pickup(int new) +w_m249_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -303,12 +303,10 @@ w_m249_hudpic(int selected, vector pos, float a) weapon_t w_m249 = { - .id = ITEM_M249, + .name = "m249", + .id = ITEM_M249, .slot = 5, .slot_pos = 0, - .ki_spr = "sprites/320hudof01.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [96,208], .draw = w_m249_draw, .holster = w_m249_holster, .primary = w_m249_primary, diff --git a/src/shared/gearbox/w_penguin.c b/src/shared/gearbox/w_penguin.c index 91750361..799dbabf 100644 --- a/src/shared/gearbox/w_penguin.c +++ b/src/shared/gearbox/w_penguin.c @@ -34,7 +34,7 @@ enum }; int -w_penguin_pickup(int new) +w_penguin_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -338,12 +338,10 @@ w_penguin_hudpic(int s, vector pos, float a) weapon_t w_penguin = { - .id = ITEM_PENGUIN, + .name = "penguin", + .id = ITEM_PENGUIN, .slot = 4, .slot_pos = 4, - .ki_spr = "sprites/320hudof01.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [144,224], .draw = w_penguin_draw, .holster = w_penguin_holster, .primary = w_penguin_primary, diff --git a/src/shared/gearbox/w_pipewrench.c b/src/shared/gearbox/w_pipewrench.c index e212225c..071794e6 100644 --- a/src/shared/gearbox/w_pipewrench.c +++ b/src/shared/gearbox/w_pipewrench.c @@ -318,12 +318,10 @@ w_pipewrench_hudpic(int selected, vector pos, float a) weapon_t w_pipewrench = { - .id = ITEM_PIPEWRENCH, + .name = "pipewrench", + .id = ITEM_PIPEWRENCH, .slot = 0, .slot_pos = 1, - .ki_spr = "sprites/320hudof01.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [0,208], .draw = w_pipewrench_draw, .holster = w_pipewrench_holster, .primary = w_pipewrench_primary, diff --git a/src/shared/gearbox/w_shockrifle.c b/src/shared/gearbox/w_shockrifle.c index e4f3169e..511b81b5 100644 --- a/src/shared/gearbox/w_shockrifle.c +++ b/src/shared/gearbox/w_shockrifle.c @@ -55,7 +55,7 @@ w_shockrifle_precache(void) } int -w_shockrifle_pickup(int new) +w_shockrifle_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -295,12 +295,10 @@ w_shockrifle_hudpic(int selected, vector pos, float a) weapon_t w_shockrifle = { - .id = ITEM_SHOCKRIFLE, + .name = "shockrifle", + .id = ITEM_SHOCKRIFLE, .slot = 6, .slot_pos = 1, - .ki_spr = "sprites/320hudof01.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [48,240], .draw = w_shockrifle_draw, .holster = w_shockrifle_holster, .primary = w_shockrifle_primary, diff --git a/src/shared/gearbox/w_sniperrifle.c b/src/shared/gearbox/w_sniperrifle.c index ce19d802..45f2a370 100644 --- a/src/shared/gearbox/w_sniperrifle.c +++ b/src/shared/gearbox/w_sniperrifle.c @@ -47,7 +47,7 @@ w_sniperrifle_precache(void) } int -w_sniperrifle_pickup(int new) +w_sniperrifle_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -278,12 +278,10 @@ w_sniperrifle_hudpic(int s, vector pos, float a) weapon_t w_sniperrifle = { - .id = ITEM_SNIPERRIFLE, + .name = "sniperrifle", + .id = ITEM_SNIPERRIFLE, .slot = 5, .slot_pos = 2, - .ki_spr = "sprites/320hudof01.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [144,208], .draw = w_sniperrifle_draw, .holster = w_sniperrifle_holster, .primary = w_sniperrifle_primary, diff --git a/src/shared/gearbox/w_sporelauncher.c b/src/shared/gearbox/w_sporelauncher.c index 5ed8b57a..e5fa945f 100644 --- a/src/shared/gearbox/w_sporelauncher.c +++ b/src/shared/gearbox/w_sporelauncher.c @@ -181,7 +181,7 @@ w_sporelauncher_deathmsg(void) } int -w_sporelauncher_pickup(int new) +w_sporelauncher_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -442,12 +442,10 @@ w_sporelauncher_hudpic(int selected, vector pos, float a) weapon_t w_sporelauncher = { - .id = ITEM_SPORELAUNCHER, + .name = "sporelauncher", + .id = ITEM_SPORELAUNCHER, .slot = 6, .slot_pos = 0, - .ki_spr = "sprites/320hudof01.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [48,224], .draw = w_sporelauncher_draw, .holster = w_sporelauncher_holster, .primary = w_sporelauncher_primary, diff --git a/src/shared/hunger/w_ap9.c b/src/shared/hunger/w_ap9.c index 5e700da0..73264a7d 100644 --- a/src/shared/hunger/w_ap9.c +++ b/src/shared/hunger/w_ap9.c @@ -66,7 +66,7 @@ w_ap9_deathmsg(void) } int -w_ap9_pickup(int new) +w_ap9_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -294,12 +294,10 @@ w_ap9_hudpic(int selected, vector pos, float a) weapon_t w_ap9 = { - .id = ITEM_AP9, + .name = "ap9", + .id = ITEM_AP9, .slot = 1, .slot_pos = 2, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [32,16], - .ki_xy = [192,16], .draw = w_ap9_draw, .holster = w_ap9_holster, .primary = w_ap9_primary, diff --git a/src/shared/hunger/w_chaingun.c b/src/shared/hunger/w_chaingun.c index 3ae9f389..b136d765 100644 --- a/src/shared/hunger/w_chaingun.c +++ b/src/shared/hunger/w_chaingun.c @@ -42,7 +42,7 @@ w_chaingun_precache(void) } int -w_chaingun_pickup(int new) +w_chaingun_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -273,12 +273,10 @@ w_chaingun_hudpic(int selected, vector pos, float a) weapon_t w_chaingun = { + .name = "chaingun", .id = ITEM_CHAINGUN, .slot = 3, .slot_pos = 3, - .ki_spr = "sprites/tfc_dmsg.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [0,16], .draw = w_chaingun_draw, .holster = w_chaingun_holster, .primary = w_chaingun_primary, diff --git a/src/shared/hunger/w_flame.c b/src/shared/hunger/w_flame.c index 2b08d940..4bb64f0e 100644 --- a/src/shared/hunger/w_flame.c +++ b/src/shared/hunger/w_flame.c @@ -69,7 +69,7 @@ w_flame_deathmsg(void) } int -w_flame_pickup(int new) +w_flame_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -231,12 +231,10 @@ w_flame_hudpic(int selected, vector pos, float a) weapon_t w_flame = { - .id = ITEM_EGON, + .name = "flame", + .id = ITEM_EGON, .slot = 3, .slot_pos = 2, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [32,16], - .ki_xy = [0,192], .draw = w_flame_draw, .holster = w_egon_holster, .primary = w_flame_primary, diff --git a/src/shared/hunger/w_medkit.c b/src/shared/hunger/w_medkit.c index 935f493e..8454fe75 100644 --- a/src/shared/hunger/w_medkit.c +++ b/src/shared/hunger/w_medkit.c @@ -63,7 +63,7 @@ w_medkit_deathmsg(void) } int -w_medkit_pickup(int new) +w_medkit_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -212,12 +212,10 @@ w_medkit_hudpic(int selected, vector pos, float a) weapon_t w_medkit = { + .name = "medkit", .id = ITEM_MEDKIT2, .slot = 4, .slot_pos = 4, - .ki_spr = "sprites/tfc_dmsg.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [0,192], .draw = w_medkit_draw, .holster = __NULL__, .primary = w_medkit_primary, diff --git a/src/shared/hunger/w_shovel.c b/src/shared/hunger/w_shovel.c index c4c23039..76df3979 100644 --- a/src/shared/hunger/w_shovel.c +++ b/src/shared/hunger/w_shovel.c @@ -127,12 +127,10 @@ w_shovel_hudpic(int selected, vector pos, float a) weapon_t w_shovel = { - .id = ITEM_SHOVEL, + .name = "shovel", + .id = ITEM_SHOVEL, .slot = 0, .slot_pos = 1, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,0], .draw = w_shovel_draw, .holster = w_shovel_holster, .primary = w_shovel_primary, diff --git a/src/shared/hunger/w_silencer.c b/src/shared/hunger/w_silencer.c index 9d804357..b236af50 100644 --- a/src/shared/hunger/w_silencer.c +++ b/src/shared/hunger/w_silencer.c @@ -67,9 +67,9 @@ w_silencer_deathmsg(void) } int -w_silencer_pickup(int new) +w_silencer_pickup(int new, int startammo) { - return w_glock_pickup(new); + return w_glock_pickup(new, startammo); } void @@ -240,12 +240,10 @@ w_silencer_hudpic(int selected, vector pos, float a) weapon_t w_silencer = { - .id = ITEM_GLOCK, + .name = "silencer", + .id = ITEM_GLOCK, .slot = 1, .slot_pos = 0, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [32,16], - .ki_xy = [192,16], .draw = w_silencer_draw, .holster = w_silencer_holster, .primary = w_silencer_primary, diff --git a/src/shared/hunger/w_sniper.c b/src/shared/hunger/w_sniper.c index f771a283..34233fa8 100644 --- a/src/shared/hunger/w_sniper.c +++ b/src/shared/hunger/w_sniper.c @@ -38,7 +38,7 @@ w_sniper_precache(void) } int -w_sniper_pickup(int new) +w_sniper_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -322,12 +322,10 @@ w_sniper_hudpic(int selected, vector pos, float a) weapon_t w_sniper = { - .id = ITEM_SNIPER, + .name = "sniper", + .id = ITEM_SNIPER, .slot = 2, .slot_pos = 3, - .ki_spr = "sprites/tfc_dmsg.spr_0.tga", - .ki_size = [60,16], - .ki_xy = [0,96], .draw = w_sniper_draw, .holster = w_sniper_holster, .primary = w_sniper_primary, diff --git a/src/shared/hunger/w_sniper2.c b/src/shared/hunger/w_sniper2.c index f7fecc2a..e92dcdc3 100644 --- a/src/shared/hunger/w_sniper2.c +++ b/src/shared/hunger/w_sniper2.c @@ -35,7 +35,7 @@ w_sniper2_precache(void) } int -w_sniper2_pickup(int new) +w_sniper2_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -219,12 +219,10 @@ w_sniper2_hudpic(int selected, vector pos, float a) weapon_t w_sniper2 = { + .name = "sniper2", .id = ITEM_SNIPER2, .slot = 2, .slot_pos = 4, - .ki_spr = "sprites/tfc_dmsg.spr_0.tga", - .ki_size = [60,16], - .ki_xy = [0,96], .draw = w_sniper2_draw, .holster = w_sniper2_holster, .primary = w_sniper2_primary, diff --git a/src/shared/hunger/w_spanner.c b/src/shared/hunger/w_spanner.c index eba692f8..a719f93c 100644 --- a/src/shared/hunger/w_spanner.c +++ b/src/shared/hunger/w_spanner.c @@ -180,12 +180,10 @@ w_spanner_hudpic(int selected, vector pos, float a) weapon_t w_spanner = { - .id = ITEM_SPANNER, + .name = "spanner", + .id = ITEM_SPANNER, .slot = 0, .slot_pos = 2, - .ki_spr = "sprites/tfc_dmsg.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [0,48], .draw = w_spanner_draw, .holster = w_spanner_holster, .primary = w_spanner_primary, diff --git a/src/shared/hunger/w_taurus.c b/src/shared/hunger/w_taurus.c index a289f3e1..92965fc3 100644 --- a/src/shared/hunger/w_taurus.c +++ b/src/shared/hunger/w_taurus.c @@ -68,7 +68,7 @@ w_taurus_deathmsg(void) } int -w_taurus_pickup(int new) +w_taurus_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -239,12 +239,10 @@ w_taurus_hudpic(int selected, vector pos, float a) weapon_t w_taurus = { - .id = ITEM_TAURUS, + .name = "taurus", + .id = ITEM_TAURUS, .slot = 1, .slot_pos = 3, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [32,16], - .ki_xy = [192,16], .draw = w_taurus_draw, .holster = w_taurus_holster, .primary = w_taurus_primary, diff --git a/src/shared/hunger/w_tnt.c b/src/shared/hunger/w_tnt.c index 3790e6c5..1ac41326 100644 --- a/src/shared/hunger/w_tnt.c +++ b/src/shared/hunger/w_tnt.c @@ -57,9 +57,9 @@ string w_tnt_deathmsg(void) return w_handgrenade_deathmsg(); } -int w_tnt_pickup(int new) +int w_tnt_pickup(int new, int startammo) { - return w_handgrenade_pickup(new); + return w_handgrenade_pickup(new, startammo); } #ifdef SERVER @@ -200,12 +200,10 @@ w_tnt_hudpic(int selected, vector pos, float a) weapon_t w_tnt = { - .id = ITEM_HANDGRENADE, + .name = "tnt", + .id = ITEM_HANDGRENADE, .slot = 4, .slot_pos = 0, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [32,16], - .ki_xy = [192,160], .draw = w_tnt_draw, .holster = w_tnt_holster, .primary = w_tnt_primary, diff --git a/src/shared/poke646/w_bradnailer.c b/src/shared/poke646/w_bradnailer.c index 9ac9f473..7bddc830 100644 --- a/src/shared/poke646/w_bradnailer.c +++ b/src/shared/poke646/w_bradnailer.c @@ -68,7 +68,7 @@ w_bradnailer_wmodel(void) } int -w_bradnailer_pickup(int new) +w_bradnailer_pickup(int new, int startammo) { /* TODO */ return TRUE; @@ -239,12 +239,10 @@ w_bradnailer_hudpic(int selected, vector pos, float a) weapon_t w_bradnailer = { - .id = ITEM_BRADNAILER, + .name = "bradnailer", + .id = ITEM_BRADNAILER, .slot = 1, .slot_pos = 0, - .ki_spr = __NULL__, - .ki_size = __NULL__, - .ki_xy = __NULL__, .draw = w_bradnailer_draw, .holster = w_bradnailer_holster, .primary = w_bradnailer_primary, diff --git a/src/shared/poke646/w_cmlwbr.c b/src/shared/poke646/w_cmlwbr.c index c31ce73c..01a8bb6f 100644 --- a/src/shared/poke646/w_cmlwbr.c +++ b/src/shared/poke646/w_cmlwbr.c @@ -120,12 +120,10 @@ w_cmlwbr_hudpic(int selected, vector pos, float a) weapon_t w_cmlwbr = { - .id = ITEM_CMLWBR, + .name = "cmlwbr", + .id = ITEM_CMLWBR, .slot = 2, .slot_pos = 1, - .ki_spr = __NULL__, - .ki_size = __NULL__, - .ki_xy = __NULL__, .draw = w_cmlwbr_draw, .holster = w_cmlwbr_holster, .primary = w_cmlwbr_primary, diff --git a/src/shared/poke646/w_heaterpipe.c b/src/shared/poke646/w_heaterpipe.c index 4236ed8f..aab55c29 100644 --- a/src/shared/poke646/w_heaterpipe.c +++ b/src/shared/poke646/w_heaterpipe.c @@ -109,12 +109,10 @@ w_heaterpipe_hudpic(int selected, vector pos, float a) weapon_t w_heaterpipe = { - .id = ITEM_HEATERPIPE, + .name = "heaterpipe", + .id = ITEM_HEATERPIPE, .slot = 0, .slot_pos = 0, - .ki_spr = __NULL__, - .ki_size = __NULL__, - .ki_xy = __NULL__, .draw = w_heaterpipe_draw, .holster = w_heaterpipe_holster, .primary = w_heaterpipe_primary, diff --git a/src/shared/poke646/w_nailgun.c b/src/shared/poke646/w_nailgun.c index 3cc1ea9d..91128112 100644 --- a/src/shared/poke646/w_nailgun.c +++ b/src/shared/poke646/w_nailgun.c @@ -165,12 +165,10 @@ w_nailgun_hudpic(int selected, vector pos, float a) weapon_t w_nailgun = { - .id = ITEM_NAILGUN, + .name = "nailgun", + .id = ITEM_NAILGUN, .slot = 1, .slot_pos = 1, - .ki_spr = __NULL__, - .ki_size = __NULL__, - .ki_xy = __NULL__, .draw = w_nailgun_draw, .holster = __NULL__, .primary = w_nailgun_primary, diff --git a/src/shared/poke646/w_pipebomb.c b/src/shared/poke646/w_pipebomb.c index 2624884b..2b66469b 100644 --- a/src/shared/poke646/w_pipebomb.c +++ b/src/shared/poke646/w_pipebomb.c @@ -68,9 +68,9 @@ void w_pipebomb_precache(void) precache_model("models/p_pipebomb.mdl"); } -int w_pipebomb_pickup(int new) +int w_pipebomb_pickup(int new, int startammo) { - return w_satchel_pickup(new); + return w_satchel_pickup(new, startammo); } void w_pipebomb_draw(void) @@ -248,12 +248,10 @@ void w_pipebomb_hudpic(int selected, vector pos, float a) weapon_t w_pipebomb = { - .id = ITEM_SATCHEL, + .name = "pipebomb", + .id = ITEM_SATCHEL, .slot = 4, .slot_pos = 1, - .ki_spr = __NULL__, - .ki_size = __NULL__, - .ki_xy = __NULL__, .draw = w_pipebomb_draw, .holster = w_pipebomb_holster, .primary = w_pipebomb_primary, diff --git a/src/shared/poke646/w_shotgun.c b/src/shared/poke646/w_shotgun.c index d0f7cc1d..61d2a4db 100644 --- a/src/shared/poke646/w_shotgun.c +++ b/src/shared/poke646/w_shotgun.c @@ -63,7 +63,7 @@ string w_shotgun_deathmsg(void) return ""; } -int w_shotgun_pickup(int new) +int w_shotgun_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -245,12 +245,10 @@ void w_shotgun_hudpic(int s, vector pos, float a) weapon_t w_shotgun = { - .id = ITEM_SHOTGUN, + .name = "shotgun", + .id = ITEM_SHOTGUN, .slot = 2, .slot_pos = 1, - .ki_spr = __NULL__, - .ki_size = __NULL__, - .ki_xy = __NULL__, .draw = w_shotgun_draw, .holster = w_shotgun_holster, .primary = w_shotgun_primary, diff --git a/src/shared/poke646/w_xs.c b/src/shared/poke646/w_xs.c index b89da06c..8bcc304d 100644 --- a/src/shared/poke646/w_xs.c +++ b/src/shared/poke646/w_xs.c @@ -122,12 +122,10 @@ w_xs_hudpic(int selected, vector pos, float a) weapon_t w_xs = { - .id = ITEM_XS, + .name = "xs", + .id = ITEM_XS, .slot = 3, .slot_pos = 0, - .ki_spr = __NULL__, - .ki_size = __NULL__, - .ki_xy = __NULL__, .draw = w_xs_draw, .holster = w_xs_holster, .primary = w_xs_primary, diff --git a/src/shared/rewolf/w_aicore.c b/src/shared/rewolf/w_aicore.c index f67dda64..b30ff351 100644 --- a/src/shared/rewolf/w_aicore.c +++ b/src/shared/rewolf/w_aicore.c @@ -121,12 +121,10 @@ w_aicore_precache(void) weapon_t w_aicore = { - .id = ITEM_AICORE, + .name = "aicore", + .id = ITEM_AICORE, .slot = 0, .slot_pos = 1, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,0], .draw = w_aicore_draw, .holster = w_aicore_holster, .primary = w_aicore_primary, diff --git a/src/shared/rewolf/w_beamgun.c b/src/shared/rewolf/w_beamgun.c index 8c46069e..48cda5fb 100644 --- a/src/shared/rewolf/w_beamgun.c +++ b/src/shared/rewolf/w_beamgun.c @@ -256,12 +256,10 @@ w_beamgun_precache(void) weapon_t w_beamgun = { - .id = ITEM_BEAMGUN, + .name = "beamgun", + .id = ITEM_BEAMGUN, .slot = 3, .slot_pos = 0, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,0], .draw = w_beamgun_draw, .holster = w_beamgun_holster, .primary = w_beamgun_primary, diff --git a/src/shared/rewolf/w_chemicalgun.c b/src/shared/rewolf/w_chemicalgun.c index 84264f69..b40e033f 100644 --- a/src/shared/rewolf/w_chemicalgun.c +++ b/src/shared/rewolf/w_chemicalgun.c @@ -139,7 +139,7 @@ w_chemicalgun_aimanim(void) } int -w_chemicalgun_pickup(int new) +w_chemicalgun_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -358,12 +358,10 @@ w_chemicalgun_precache(void) weapon_t w_chemicalgun = { - .id = ITEM_CHEMICALGUN, + .name = "chemicalgun", + .id = ITEM_CHEMICALGUN, .slot = 4, .slot_pos = 1, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,0], .draw = w_chemicalgun_draw, .holster = w_chemicalgun_holster, .primary = w_chemicalgun_primary, diff --git a/src/shared/rewolf/w_dml.c b/src/shared/rewolf/w_dml.c index 7b56ed60..dce14891 100644 --- a/src/shared/rewolf/w_dml.c +++ b/src/shared/rewolf/w_dml.c @@ -224,7 +224,7 @@ w_dml_aimanim(void) } int -w_dml_pickup(int new) +w_dml_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -378,12 +378,10 @@ w_dml_precache(void) weapon_t w_dml = { - .id = ITEM_DML, + .name = "dml", + .id = ITEM_DML, .slot = 3, .slot_pos = 1, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,0], .draw = w_dml_draw, .holster = w_dml_holster, .primary = w_dml_primary, diff --git a/src/shared/rewolf/w_fists.c b/src/shared/rewolf/w_fists.c index 3fc609ce..ad784f79 100644 --- a/src/shared/rewolf/w_fists.c +++ b/src/shared/rewolf/w_fists.c @@ -221,7 +221,7 @@ w_fists_aimanim(void) } int -w_fists_pickup(int new) +w_fists_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -265,12 +265,10 @@ w_fists_precache(void) weapon_t w_fists = { - .id = ITEM_FISTS, + .name = "fists", + .id = ITEM_FISTS, .slot = 0, .slot_pos = 0, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,0], .draw = w_fists_draw, .holster = w_fists_holster, .primary = w_fists_primary, diff --git a/src/shared/rewolf/w_gausspistol.c b/src/shared/rewolf/w_gausspistol.c index eb5cc692..1011b9ca 100644 --- a/src/shared/rewolf/w_gausspistol.c +++ b/src/shared/rewolf/w_gausspistol.c @@ -199,7 +199,7 @@ w_gausspistol_aimanim(void) } int -w_gausspistol_pickup(int new) +w_gausspistol_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -366,12 +366,10 @@ w_gausspistol_precache(void) weapon_t w_gausspistol = { - .id = ITEM_GAUSSPISTOL, + .name = "gausspistol", + .id = ITEM_GAUSSPISTOL, .slot = 1, .slot_pos = 0, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,0], .draw = w_gausspistol_draw, .holster = w_gausspistol_holster, .primary = w_gausspistol_primary, diff --git a/src/shared/rewolf/w_grenade.c b/src/shared/rewolf/w_grenade.c index 618eacd8..302dac61 100644 --- a/src/shared/rewolf/w_grenade.c +++ b/src/shared/rewolf/w_grenade.c @@ -220,12 +220,10 @@ w_grenade_precache(void) weapon_t w_grenade = { - .id = ITEM_GRENADE, + .name = "grenade", + .id = ITEM_GRENADE, .slot = 4, .slot_pos = 0, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,0], .draw = w_grenade_draw, .holster = w_grenade_holster, .primary = w_grenade_primary, diff --git a/src/shared/rewolf/w_minigun.c b/src/shared/rewolf/w_minigun.c index 30487ce6..8aa6758a 100644 --- a/src/shared/rewolf/w_minigun.c +++ b/src/shared/rewolf/w_minigun.c @@ -186,7 +186,7 @@ w_minigun_aimanim(void) } int -w_minigun_pickup(int new) +w_minigun_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -264,12 +264,10 @@ w_minigun_precache(void) weapon_t w_minigun = { - .id = ITEM_MINIGUN, + .name = "minigun", + .id = ITEM_MINIGUN, .slot = 2, .slot_pos = 1, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,0], .draw = w_minigun_draw, .holster = w_minigun_holster, .primary = w_minigun_primary, diff --git a/src/shared/rewolf/w_shotgun.c b/src/shared/rewolf/w_shotgun.c index 9849699d..13dda6c2 100644 --- a/src/shared/rewolf/w_shotgun.c +++ b/src/shared/rewolf/w_shotgun.c @@ -217,7 +217,7 @@ w_shotgun_aimanim(void) } int -w_shotgun_pickup(int new) +w_shotgun_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -331,12 +331,10 @@ w_shotgun_precache(void) weapon_t w_shotgun = { - .id = ITEM_SHOTGUN, + .name = "shotgun", + .id = ITEM_SHOTGUN, .slot = 2, .slot_pos = 0, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,0], .draw = w_shotgun_draw, .holster = w_shotgun_holster, .primary = w_shotgun_primary, diff --git a/src/shared/scihunt/w_cannon.c b/src/shared/scihunt/w_cannon.c index 706da61f..f61f7777 100644 --- a/src/shared/scihunt/w_cannon.c +++ b/src/shared/scihunt/w_cannon.c @@ -81,7 +81,7 @@ void w_cannon_reload(void) pl.w_idle_next = 3.0f; } -int w_cannon_pickup(int new) +int w_cannon_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -230,12 +230,10 @@ void w_cannon_hudpic(int s, vector pos, float a) weapon_t w_cannon = { - .id = ITEM_CANNON, + .name = "cannon", + .id = ITEM_CANNON, .slot = 2, .slot_pos = 3, - .ki_spr = "sprites/w_cannon.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,0], .draw = w_cannon_draw, .holster = w_cannon_holster, .primary = w_cannon_primary, diff --git a/src/shared/scihunt/w_chainsaw.c b/src/shared/scihunt/w_chainsaw.c index 921d10ca..7b82db77 100644 --- a/src/shared/scihunt/w_chainsaw.c +++ b/src/shared/scihunt/w_chainsaw.c @@ -153,12 +153,10 @@ void w_chainsaw_hudpic(int s, vector pos, float a) weapon_t w_chainsaw = { - .id = ITEM_CHAINSAW, + .name = "chainsaw", + .id = ITEM_CHAINSAW, .slot = 0, .slot_pos = 2, - .ki_spr = "sprites/chainsaw.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,0], .draw = w_chainsaw_draw, .holster = w_chainsaw_holster, .primary = w_chainsaw_primary, diff --git a/src/shared/scihunt/w_hammer.c b/src/shared/scihunt/w_hammer.c index 59fdaad3..ec102a04 100644 --- a/src/shared/scihunt/w_hammer.c +++ b/src/shared/scihunt/w_hammer.c @@ -215,12 +215,10 @@ void w_hammer_hudpic(int s, vector pos, float a) weapon_t w_hammer = { - .id = ITEM_HAMMER, + .name = "hammer", + .id = ITEM_HAMMER, .slot = 0, .slot_pos = 1, - .ki_spr = "sprites/hammer.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,0], .draw = w_hammer_draw, .holster = w_hammer_holster, .primary = w_hammer_primary, diff --git a/src/shared/tfc/w_asscan.c b/src/shared/tfc/w_asscan.c index 8d0f786e..8bdb1846 100644 --- a/src/shared/tfc/w_asscan.c +++ b/src/shared/tfc/w_asscan.c @@ -92,12 +92,10 @@ w_asscan_hudpic(int selected, vector pos, float a) weapon_t w_asscan = { - .id = ITEM_ASSCAN, + .name = "asscan", + .id = ITEM_ASSCAN, .slot = 4, .slot_pos = 2, - .ki_spr = "sprites/tfc_dmsg.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [0,16], .draw = w_asscan_draw, .holster = __NULL__, .primary = __NULL__, diff --git a/src/shared/tfc/w_autorifle.c b/src/shared/tfc/w_autorifle.c index 81df6014..a64d0544 100644 --- a/src/shared/tfc/w_autorifle.c +++ b/src/shared/tfc/w_autorifle.c @@ -92,12 +92,10 @@ w_autorifle_hudpic(int selected, vector pos, float a) weapon_t w_autorifle = { - .id = ITEM_AUTORIFLE, + .name = "autorifle", + .id = ITEM_AUTORIFLE, .slot = 2, .slot_pos = 0, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [60,16], - .ki_xy = [0,80], .draw = w_autorifle_draw, .holster = __NULL__, .primary = __NULL__, diff --git a/src/shared/tfc/w_crowbar.c b/src/shared/tfc/w_crowbar.c index 8eb751ab..4123d9b5 100644 --- a/src/shared/tfc/w_crowbar.c +++ b/src/shared/tfc/w_crowbar.c @@ -210,12 +210,10 @@ w_crowbar_hudpic(int selected, vector pos, float a) weapon_t w_crowbar = { - .id = ITEM_CROWBAR, + .name = "crowbar", + .id = ITEM_CROWBAR, .slot = 0, .slot_pos = 0, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,0], .draw = w_crowbar_draw, .holster = w_crowbar_holster, .primary = w_crowbar_primary, diff --git a/src/shared/tfc/w_dbs.c b/src/shared/tfc/w_dbs.c index 854a1f37..39190753 100644 --- a/src/shared/tfc/w_dbs.c +++ b/src/shared/tfc/w_dbs.c @@ -69,7 +69,7 @@ string w_dbs_deathmsg(void) } int -w_dbs_pickup(int new) +w_dbs_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -251,25 +251,23 @@ w_dbs_hudpic(int s, vector pos, float a) weapon_t w_dbs = { - ITEM_DBS, - 2, - 1, - "sprites/640hud1.spr_0.tga", - [48,16], - [192,64], - w_dbs_draw, - w_dbs_holster, - w_dbs_primary, - w_dbs_release, - w_dbs_reload, - w_dbs_release, - w_dbs_crosshair, - w_dbs_precache, - w_dbs_pickup, - w_dbs_updateammo, - w_dbs_wmodel, - w_dbs_pmodel, - w_dbs_deathmsg, - w_dbs_aimanim, - w_dbs_hudpic + .name = "sbs", + .id = ITEM_DBS, + .slot = 2, + .slot_pos = 1, + .draw = w_dbs_draw, + .holster = w_dbs_holster, + .primary = w_dbs_primary, + .secondary = w_dbs_release, + .reload = w_dbs_reload, + .release = w_dbs_release, + .crosshair = w_dbs_crosshair, + .precache = w_dbs_precache, + .pickup = w_dbs_pickup, + .updateammo = w_dbs_updateammo, + .wmodel = w_dbs_wmodel, + .pmodel = w_dbs_pmodel, + .deathmsg = w_dbs_deathmsg, + .aimanim = w_dbs_aimanim, + .hudpic = w_dbs_hudpic }; diff --git a/src/shared/tfc/w_flamer.c b/src/shared/tfc/w_flamer.c index 8d5b8f07..52ab5abf 100644 --- a/src/shared/tfc/w_flamer.c +++ b/src/shared/tfc/w_flamer.c @@ -92,12 +92,10 @@ w_flamer_hudpic(int selected, vector pos, float a) weapon_t w_flamer = { - .id = ITEM_FLAMER, + .name = "flamer", + .id = ITEM_FLAMER, .slot = 3, .slot_pos = 3, - .ki_spr = "sprites/tfc_dmsg.spr_0.tga", - .ki_size = [64,16], - .ki_xy = [112,24], .draw = w_flamer_draw, .holster = __NULL__, .primary = __NULL__, diff --git a/src/shared/tfc/w_glauncher.c b/src/shared/tfc/w_glauncher.c index c7cdae61..51281d56 100644 --- a/src/shared/tfc/w_glauncher.c +++ b/src/shared/tfc/w_glauncher.c @@ -92,12 +92,10 @@ w_glauncher_hudpic(int selected, vector pos, float a) weapon_t w_glauncher = { - .id = ITEM_GLAUNCHER, + .name = "glauncher", + .id = ITEM_GLAUNCHER, .slot = 3, .slot_pos = 1, - .ki_spr = "sprites/tfc_dmsg.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [0,128], .draw = w_glauncher_draw, .holster = __NULL__, .primary = __NULL__, diff --git a/src/shared/tfc/w_grapple.c b/src/shared/tfc/w_grapple.c index 114808a8..d41f9206 100644 --- a/src/shared/tfc/w_grapple.c +++ b/src/shared/tfc/w_grapple.c @@ -92,12 +92,10 @@ w_grapple_hudpic(int selected, vector pos, float a) weapon_t w_grapple = { - .id = ITEM_GRAPPLE, + .name = "grapple", + .id = ITEM_GRAPPLE, .slot = 5, .slot_pos = 0, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,0], .draw = w_grapple_draw, .holster = __NULL__, .primary = __NULL__, diff --git a/src/shared/tfc/w_incendiary.c b/src/shared/tfc/w_incendiary.c index 56967e6c..d3d24b13 100644 --- a/src/shared/tfc/w_incendiary.c +++ b/src/shared/tfc/w_incendiary.c @@ -92,12 +92,10 @@ w_incendiary_hudpic(int selected, vector pos, float a) weapon_t w_incendiary = { - .id = ITEM_INCENDIARY, + .name = "incendiary", + .id = ITEM_INCENDIARY, .slot = 4, .slot_pos = 3, - .ki_spr = "sprites/tfc_dmsg.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [0,160], .draw = w_incendiary_draw, .holster = __NULL__, .primary = __NULL__, diff --git a/src/shared/tfc/w_knife.c b/src/shared/tfc/w_knife.c index 3d489171..20209687 100644 --- a/src/shared/tfc/w_knife.c +++ b/src/shared/tfc/w_knife.c @@ -92,12 +92,10 @@ w_knife_hudpic(int selected, vector pos, float a) weapon_t w_knife = { - .id = ITEM_KNIFE, + .name = "knife", + .id = ITEM_KNIFE, .slot = 0, .slot_pos = 2, - .ki_spr = "sprites/tfc_dmsg.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [0,32], .draw = w_knife_draw, .holster = __NULL__, .primary = __NULL__, diff --git a/src/shared/tfc/w_medkit.c b/src/shared/tfc/w_medkit.c index 59ca7087..71962d98 100644 --- a/src/shared/tfc/w_medkit.c +++ b/src/shared/tfc/w_medkit.c @@ -92,12 +92,10 @@ w_medkit_hudpic(int selected, vector pos, float a) weapon_t w_medkit = { - .id = ITEM_MEDKIT, + .name = "medkit", + .id = ITEM_MEDKIT, .slot = 0, .slot_pos = 1, - .ki_spr = "sprites/tfc_dmsg.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [0,192], .draw = w_medkit_draw, .holster = __NULL__, .primary = __NULL__, diff --git a/src/shared/tfc/w_nailgun.c b/src/shared/tfc/w_nailgun.c index e98f63cb..7de2cac8 100644 --- a/src/shared/tfc/w_nailgun.c +++ b/src/shared/tfc/w_nailgun.c @@ -92,12 +92,10 @@ w_nailgun_hudpic(int selected, vector pos, float a) weapon_t w_nailgun = { - .id = ITEM_NAILGUN, + .name = "nailgun", + .id = ITEM_NAILGUN, .slot = 3, .slot_pos = 0, - .ki_spr = "sprites/tfc_dmsg.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [112,43], .draw = w_nailgun_draw, .holster = __NULL__, .primary = __NULL__, diff --git a/src/shared/tfc/w_pipebomb.c b/src/shared/tfc/w_pipebomb.c index 703a08f0..1b4ef0b0 100644 --- a/src/shared/tfc/w_pipebomb.c +++ b/src/shared/tfc/w_pipebomb.c @@ -93,12 +93,10 @@ w_pipebomb_hudpic(int selected, vector pos, float a) weapon_t w_pipebomb = { - .id = ITEM_PIPEBOMB, + .name = "pipebomb", + .id = ITEM_PIPEBOMB, .slot = 4, .slot_pos = 1, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [0,112], .draw = w_pipebomb_draw, .holster = __NULL__, .primary = __NULL__, diff --git a/src/shared/tfc/w_railgun.c b/src/shared/tfc/w_railgun.c index 7982de40..f2d18e3c 100644 --- a/src/shared/tfc/w_railgun.c +++ b/src/shared/tfc/w_railgun.c @@ -92,12 +92,10 @@ w_railgun_hudpic(int selected, vector pos, float a) weapon_t w_railgun = { - .id = ITEM_RAILGUN, + .name = "railgun", + .id = ITEM_RAILGUN, .slot = 1, .slot_pos = 3, - .ki_spr = "sprites/tfc_dmsg.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [113,4], .draw = w_railgun_draw, .holster = __NULL__, .primary = __NULL__, diff --git a/src/shared/tfc/w_rpg.c b/src/shared/tfc/w_rpg.c index c447cf45..8b1712f4 100644 --- a/src/shared/tfc/w_rpg.c +++ b/src/shared/tfc/w_rpg.c @@ -74,12 +74,10 @@ w_rpg_hudpic(int selected, vector pos, float a) weapon_t w_rpg = { - .id = ITEM_RPG, + .name = "rpg", + .id = ITEM_RPG, .slot = 4, .slot_pos = 0, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,96], .draw = w_rpg_draw, .holster = __NULL__, .primary = __NULL__, diff --git a/src/shared/tfc/w_sbs.c b/src/shared/tfc/w_sbs.c index a580e1ff..85fac6e5 100644 --- a/src/shared/tfc/w_sbs.c +++ b/src/shared/tfc/w_sbs.c @@ -70,7 +70,7 @@ string w_sbs_deathmsg(void) } int -w_sbs_pickup(int new) +w_sbs_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -252,25 +252,23 @@ w_sbs_hudpic(int s, vector pos, float a) weapon_t w_sbs = { - ITEM_SBS, - 1, - 0, - "sprites/tfc_dmsg.spr_0.tga", - [60,16], - [0,144], - w_sbs_draw, - w_sbs_holster, - w_sbs_primary, - w_sbs_release, - w_sbs_reload, - w_sbs_release, - w_sbs_crosshair, - w_sbs_precache, - w_sbs_pickup, - w_sbs_updateammo, - w_sbs_wmodel, - w_sbs_pmodel, - w_sbs_deathmsg, - w_sbs_aimanim, - w_sbs_hudpic + .name = "sbs", + .id = ITEM_SBS, + .slot = 1, + .slot_pos = 0, + .draw = w_sbs_draw, + .holster = w_sbs_holster, + .primary = w_sbs_primary, + .secondary = w_sbs_release, + .reload = w_sbs_reload, + .release = w_sbs_release, + .crosshair = w_sbs_crosshair, + .precache = w_sbs_precache, + .pickup = w_sbs_pickup, + .updateammo = w_sbs_updateammo, + .wmodel = w_sbs_wmodel, + .pmodel = w_sbs_pmodel, + .deathmsg = w_sbs_deathmsg, + .aimanim = w_sbs_aimanim, + .hudpic = w_sbs_hudpic }; diff --git a/src/shared/tfc/w_sniper.c b/src/shared/tfc/w_sniper.c index b850dc23..1873ae7a 100644 --- a/src/shared/tfc/w_sniper.c +++ b/src/shared/tfc/w_sniper.c @@ -92,12 +92,10 @@ w_sniper_hudpic(int selected, vector pos, float a) weapon_t w_sniper = { - .id = ITEM_SNIPER, + .name = "sniper", + .id = ITEM_SNIPER, .slot = 1, .slot_pos = 1, - .ki_spr = "sprites/tfc_dmsg.spr_0.tga", - .ki_size = [60,16], - .ki_xy = [0,96], .draw = w_sniper_draw, .holster = __NULL__, .primary = __NULL__, diff --git a/src/shared/tfc/w_supernail.c b/src/shared/tfc/w_supernail.c index 6b2a51e6..e6ec5b5d 100644 --- a/src/shared/tfc/w_supernail.c +++ b/src/shared/tfc/w_supernail.c @@ -92,12 +92,10 @@ w_supernail_hudpic(int selected, vector pos, float a) weapon_t w_supernail = { - .id = ITEM_SUPERNAIL, + .name = "supernail", + .id = ITEM_SUPERNAIL, .slot = 3, .slot_pos = 2, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [112,64], .draw = w_supernail_draw, .holster = __NULL__, .primary = __NULL__, diff --git a/src/shared/tfc/w_tranquil.c b/src/shared/tfc/w_tranquil.c index 46dfedcb..01fee11d 100644 --- a/src/shared/tfc/w_tranquil.c +++ b/src/shared/tfc/w_tranquil.c @@ -92,12 +92,10 @@ w_tranquil_hudpic(int selected, vector pos, float a) weapon_t w_tranquil = { - .id = ITEM_TRANQUIL, + .name = "tranquil", + .id = ITEM_TRANQUIL, .slot = 1, .slot_pos = 2, - .ki_spr = "sprites/tfc_dmsg.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [0,176], .draw = w_tranquil_draw, .holster = __NULL__, .primary = __NULL__, diff --git a/src/shared/tfc/w_umbrella.c b/src/shared/tfc/w_umbrella.c index edd1cc09..17b5fbc1 100644 --- a/src/shared/tfc/w_umbrella.c +++ b/src/shared/tfc/w_umbrella.c @@ -213,12 +213,10 @@ w_umbrella_hudpic(int selected, vector pos, float a) weapon_t w_umbrella = { - .id = ITEM_UMBRELLA, + .name = "umbrella", + .id = ITEM_UMBRELLA, .slot = 0, .slot_pos = 4, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,0], .draw = w_umbrella_draw, .holster = w_umbrella_holster, .primary = w_umbrella_primary, diff --git a/src/shared/tfc/w_wrench.c b/src/shared/tfc/w_wrench.c index 4c658765..b37c58f6 100644 --- a/src/shared/tfc/w_wrench.c +++ b/src/shared/tfc/w_wrench.c @@ -203,12 +203,10 @@ w_wrench_hudpic(int selected, vector pos, float a) weapon_t w_wrench = { - .id = ITEM_WRENCH, + .name = "wrench", + .id = ITEM_WRENCH, .slot = 0, .slot_pos = 3, - .ki_spr = "sprites/tfc_dmsg.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [0,48], .draw = w_wrench_draw, .holster = w_wrench_holster, .primary = w_wrench_primary, diff --git a/src/shared/valve/w_crossbow.c b/src/shared/valve/w_crossbow.c index 5c937489..72753c83 100644 --- a/src/shared/valve/w_crossbow.c +++ b/src/shared/valve/w_crossbow.c @@ -83,7 +83,7 @@ w_crossbow_deathmsg(void) } int -w_crossbow_pickup(int new) +w_crossbow_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -365,12 +365,10 @@ w_crossbow_hudpic(int selected, vector pos, float a) weapon_t w_crossbow = { + .name = "crossbow", .id = ITEM_CROSSBOW, .slot = 2, .slot_pos = 2, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,80], .draw = w_crossbow_draw, .holster = w_crossbow_holster, .primary = w_crossbow_primary, diff --git a/src/shared/valve/w_crowbar.c b/src/shared/valve/w_crowbar.c index 7e43f548..38f3f448 100644 --- a/src/shared/valve/w_crowbar.c +++ b/src/shared/valve/w_crowbar.c @@ -204,12 +204,10 @@ w_crowbar_hudpic(int selected, vector pos, float a) weapon_t w_crowbar = { + .name = "crowbar", .id = ITEM_CROWBAR, .slot = 0, .slot_pos = 0, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,0], .draw = w_crowbar_draw, .holster = w_crowbar_holster, .primary = w_crowbar_primary, diff --git a/src/shared/valve/w_egon.c b/src/shared/valve/w_egon.c index a682a232..4901d640 100644 --- a/src/shared/valve/w_egon.c +++ b/src/shared/valve/w_egon.c @@ -63,7 +63,7 @@ string w_egon_deathmsg(void) return ""; } -int w_egon_pickup(int new) +int w_egon_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -187,12 +187,10 @@ void w_egon_hudpic(int selected, vector pos, float a) weapon_t w_egon = { + .name = "egon", .id = ITEM_EGON, .slot = 3, .slot_pos = 2, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [32,16], - .ki_xy = [192,128], .draw = w_egon_draw, .holster = w_egon_holster, .primary = w_egon_primary, diff --git a/src/shared/valve/w_gauss.c b/src/shared/valve/w_gauss.c index cc90d6ae..ffca69f4 100644 --- a/src/shared/valve/w_gauss.c +++ b/src/shared/valve/w_gauss.c @@ -154,7 +154,7 @@ string w_gauss_deathmsg(void) return ""; } -int w_gauss_pickup(int new) +int w_gauss_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -464,12 +464,10 @@ void w_gauss_hudpic(int selected, vector pos, float a) weapon_t w_gauss = { + .name = "gauss", .id = ITEM_GAUSS, .slot = 3, .slot_pos = 1, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [32,16], - .ki_xy = [192,112], .draw = w_gauss_draw, .holster = w_gauss_holster, .primary = w_gauss_primary, diff --git a/src/shared/valve/w_glock.c b/src/shared/valve/w_glock.c index f4b10e0a..8e68287e 100644 --- a/src/shared/valve/w_glock.c +++ b/src/shared/valve/w_glock.c @@ -86,7 +86,7 @@ w_glock_deathmsg(void) } int -w_glock_pickup(int new) +w_glock_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -351,12 +351,10 @@ w_glock_hudpic(int selected, vector pos, float a) weapon_t w_glock = { + .name = "glock", .id = ITEM_GLOCK, .slot = 1, .slot_pos = 0, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [32,16], - .ki_xy = [192,16], .draw = w_glock_draw, .holster = w_glock_holster, .primary = w_glock_primary, diff --git a/src/shared/valve/w_handgrenade.c b/src/shared/valve/w_handgrenade.c index 3dc4a9fd..0f1ef0ed 100644 --- a/src/shared/valve/w_handgrenade.c +++ b/src/shared/valve/w_handgrenade.c @@ -64,7 +64,7 @@ string w_handgrenade_deathmsg(void) return ""; } -int w_handgrenade_pickup(int new) +int w_handgrenade_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -248,12 +248,10 @@ w_handgrenade_hudpic(int selected, vector pos, float a) weapon_t w_handgrenade = { + .name = "handgrenade", .id = ITEM_HANDGRENADE, .slot = 4, .slot_pos = 0, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [32,16], - .ki_xy = [192,160], .draw = w_handgrenade_draw, .holster = w_handgrenade_holster, .primary = w_handgrenade_primary, diff --git a/src/shared/valve/w_hornetgun.c b/src/shared/valve/w_hornetgun.c index d10f2274..a3b110f0 100644 --- a/src/shared/valve/w_hornetgun.c +++ b/src/shared/valve/w_hornetgun.c @@ -49,7 +49,7 @@ w_hornetgun_precache(void) } int -w_hornetgun_pickup(int new) +w_hornetgun_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -323,12 +323,10 @@ w_hornetgun_hudpic(int selected, vector pos, float a) weapon_t w_hornetgun = { + .name = "hornetgun", .id = ITEM_HORNETGUN, .slot = 3, .slot_pos = 3, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,144], .draw = w_hornetgun_draw, .holster = w_hornetgun_holster, .primary = w_hornetgun_primary, diff --git a/src/shared/valve/w_mp5.c b/src/shared/valve/w_mp5.c index 5ba03fcb..750dcf9d 100644 --- a/src/shared/valve/w_mp5.c +++ b/src/shared/valve/w_mp5.c @@ -65,7 +65,7 @@ w_mp5_precache(void) } int -w_mp5_pickup(int new) +w_mp5_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -370,13 +370,12 @@ w_mp5_hudpic(int selected, vector pos, float a) #endif } -weapon_t w_mp5 = { +weapon_t w_mp5 = +{ + .name = "mp5", .id = ITEM_MP5, .slot = 2, .slot_pos = 0, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,48], .draw = w_mp5_draw, .holster = w_mp5_holster, .primary = w_mp5_primary, diff --git a/src/shared/valve/w_python.c b/src/shared/valve/w_python.c index 9a3c09ee..50143a52 100644 --- a/src/shared/valve/w_python.c +++ b/src/shared/valve/w_python.c @@ -60,7 +60,7 @@ w_python_precache(void) } int -w_python_pickup(int new) +w_python_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -330,12 +330,10 @@ w_python_hudpic(int selected, vector pos, float a) weapon_t w_python = { + .name = "python", .id = ITEM_PYTHON, .slot = 1, .slot_pos = 1, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [32,16], - .ki_xy = [192,32], .draw = w_python_draw, .holster = w_python_holster, .primary = w_python_primary, diff --git a/src/shared/valve/w_rpg.c b/src/shared/valve/w_rpg.c index bc95e8a8..db27bb63 100644 --- a/src/shared/valve/w_rpg.c +++ b/src/shared/valve/w_rpg.c @@ -68,7 +68,7 @@ string w_rpg_deathmsg(void) return ""; } -int w_rpg_pickup(int new) +int w_rpg_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -341,12 +341,10 @@ void w_rpg_hud(void) weapon_t w_rpg = { + .name = "rpg", .id = ITEM_RPG, .slot = 3, .slot_pos = 0, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,96], .draw = w_rpg_draw, .holster = w_rpg_holster, .primary = w_rpg_primary, diff --git a/src/shared/valve/w_satchel.c b/src/shared/valve/w_satchel.c index 28dc2e45..b66b70b3 100644 --- a/src/shared/valve/w_satchel.c +++ b/src/shared/valve/w_satchel.c @@ -69,7 +69,7 @@ void w_satchel_precache(void) precache_model("models/p_satchel.mdl"); } -int w_satchel_pickup(int new) +int w_satchel_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -273,12 +273,10 @@ void w_satchel_hudpic(int selected, vector pos, float a) weapon_t w_satchel = { + .name = "satchel", .id = ITEM_SATCHEL, .slot = 4, .slot_pos = 1, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [32,16], - .ki_xy = [192,176], .draw = w_satchel_draw, .holster = w_satchel_holster, .primary = w_satchel_primary, diff --git a/src/shared/valve/w_shotgun.c b/src/shared/valve/w_shotgun.c index a4812c27..8e6cc753 100644 --- a/src/shared/valve/w_shotgun.c +++ b/src/shared/valve/w_shotgun.c @@ -77,7 +77,7 @@ string w_shotgun_deathmsg(void) return ""; } -int w_shotgun_pickup(int new) +int w_shotgun_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -301,12 +301,10 @@ void w_shotgun_hudpic(int selected, vector pos, float a) weapon_t w_shotgun = { + .name = "shotgun", .id = ITEM_SHOTGUN, .slot = 2, .slot_pos = 1, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [48,16], - .ki_xy = [192,64], .draw = w_shotgun_draw, .holster = w_shotgun_holster, .primary = w_shotgun_primary, diff --git a/src/shared/valve/w_snark.c b/src/shared/valve/w_snark.c index 457b0f41..c24529a7 100644 --- a/src/shared/valve/w_snark.c +++ b/src/shared/valve/w_snark.c @@ -137,7 +137,7 @@ monster_snark::monster_snark(void) } #endif -int w_snark_pickup(int new) +int w_snark_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -304,12 +304,10 @@ void w_snark_hudpic(int selected, vector pos, float a) weapon_t w_snark = { + .name = "snark", .id = ITEM_SNARK, .slot = 4, .slot_pos = 3, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [32,16], - .ki_xy = [192,208], .draw = w_snark_draw, .holster = w_snark_holster, .primary = w_snark_primary, diff --git a/src/shared/valve/w_tripmine.c b/src/shared/valve/w_tripmine.c index 81bedfd3..76a274e0 100644 --- a/src/shared/valve/w_tripmine.c +++ b/src/shared/valve/w_tripmine.c @@ -171,7 +171,7 @@ string w_tripmine_deathmsg(void) { return ""; } -int w_tripmine_pickup(int new) +int w_tripmine_pickup(int new, int startammo) { #ifdef SERVER player pl = (player)self; @@ -341,12 +341,10 @@ void w_tripmine_hudpic(int selected, vector pos, float a) weapon_t w_tripmine = { - .id = ITEM_TRIPMINE, + .name = "tripmine", + .id = ITEM_TRIPMINE, .slot = 4, .slot_pos = 2, - .ki_spr = "sprites/640hud1.spr_0.tga", - .ki_size = [32,16], - .ki_xy = [192,192], .draw = w_tripmine_draw, .holster = w_tripmine_holster, .primary = w_tripmine_primary, diff --git a/src/shared/valve/weapon_common.c b/src/shared/valve/weapon_common.c index 532e82ad..b95c8136 100644 --- a/src/shared/valve/weapon_common.c +++ b/src/shared/valve/weapon_common.c @@ -278,7 +278,7 @@ void Weapons_SwitchBest(player pl) } /* returns TRUE if weapon pickup gets removed from this world */ -int Weapons_AddItem(player pl, int w) +int Weapons_AddItem(player pl, int w, int startammo) { int value; entity oldself = self; @@ -323,13 +323,13 @@ int Weapons_AddItem(player pl, int w) } } } else { - /* Call team pickup */ + /* call pickup to handle the ammo */ if (pl.g_items & g_weapons[w].id) { - value = g_weapons[w].pickup(FALSE); + value = g_weapons[w].pickup(FALSE, startammo); } else { /* new to our arsenal */ pl.g_items |= g_weapons[w].id; - value = g_weapons[w].pickup(TRUE); + value = g_weapons[w].pickup(TRUE, startammo); /* it's new, so autoswitch? */ if (pl.activeweapon == 0) { @@ -404,6 +404,9 @@ void CSEv_DropWeapon(void) if (!pl.activeweapon) return; + if (g_weapons[pl.activeweapon].allow_drop != TRUE) + return; + item_pickup drop = spawn(item_pickup, m_iWasDropped: TRUE, m_iClip: pl.a_ammo1); drop.setitem(pl.activeweapon); setorigin(drop, pl.origin); diff --git a/src/shared/valve/weapon_common.h b/src/shared/valve/weapon_common.h index eada46f3..cf4036c6 100644 --- a/src/shared/valve/weapon_common.h +++ b/src/shared/valve/weapon_common.h @@ -16,12 +16,11 @@ typedef struct { + string name; int id; /* bitflag id */ int slot; int slot_pos; - string ki_spr; - vector ki_size; - vector ki_xy; + int allow_drop; void(void) draw; void(void) holster; @@ -32,7 +31,7 @@ typedef struct void(void) crosshair; void(void) precache; - int(int) pickup; + int(int, int) pickup; void(player) updateammo; string() wmodel; string() pmodel; @@ -54,7 +53,10 @@ void Weapons_SetGeomset(string); void Weapons_RefreshAmmo(player); void Weapons_InitItem(int); float Weapons_GetAim(int); -int Weapons_AddItem(player, int); + +/* TODO: pass this as a weapon.pickup parm */ +int Weapons_AddItem(player, int, int); + void Weapons_RemoveItem(player, int); string Weapons_GetWorldmodel(int); void Weapons_UpdateAmmo(player, int, int, int);