Fixed a bug in which self wasn't reset in Weapons_AddItem()

This commit is contained in:
Marco Cawthorne 2020-04-23 22:42:09 +02:00
parent 7c0315d56f
commit 876468fc29
5 changed files with 16 additions and 17 deletions

View file

@ -52,6 +52,7 @@ class CSMultiplayerRules:CSGameRules
virtual void(player) PlayerSpawn;
virtual void(player) PlayerPreFrame;
virtual void(player) PlayerDeath;
virtual int(void) MaxItemPerSlot;
/* CS specific */
virtual void(void) CreateRescueZones;
@ -74,5 +75,4 @@ class CSMultiplayerRules:CSGameRules
virtual void(player) PlayerMakeSpectator;
virtual void(player, int) PlayerRespawn;
virtual entity(float) PlayerFindSpawn;
virtual int(void) MaxItemPerSlot;
};

View file

@ -14,6 +14,12 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
int
CSMultiplayerRules::MaxItemPerSlot(void)
{
return 1;
}
void
CSMultiplayerRules::PlayerDeath(player pl)
{
@ -719,7 +725,6 @@ CSMultiplayerRules::PlayerMakePlayable(player pl, int chara)
} else {
/* counter */
pl.team = TEAM_CT;
pl.g_items |= ITEM_SUIT;
Weapons_AddItem(pl, WEAPON_KNIFE);
if (autocvar_fcs_knifeonly == FALSE) {
@ -788,12 +793,6 @@ CSMultiplayerRules::PlayerSpawn(player pl)
forceinfokey(pl, "*team", "0");
}
int
CSMultiplayerRules::MaxItemPerSlot(void)
{
return 1;
}
void
CSMultiplayerRules::CSMultiplayerRules(void)
{

View file

@ -55,7 +55,6 @@ FX_GibHuman(vector pos)
Decals_Place(self.origin, sprintf("{blood%d", floor(random(1,9))));
}
for (int i = 0; i < 5; i++) {
vector vel;
vel[0] = random(-128,128);
vel[1] = random(-128,128);

View file

@ -297,6 +297,7 @@ int Weapons_AddItem(player pl, int w)
/* we're over the slot limit. */
if (c >= maxit) {
self = oldself;
return FALSE;
}
}