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

@ -139,23 +139,23 @@ FX_BreakModel(int count, vector vMins, vector vMaxs, vector vVel, float fStyle)
for (int i = 0; i < count; i++) {
entity eGib = spawn();
eGib.classname = "gib";
vecPos[0] = vMins[0] + (random() * (vMaxs[0] - vMins[0]));
vecPos[1] = vMins[1] + (random() * (vMaxs[1] - vMins[1]));
vecPos[2] = vMins[2] + (random() * (vMaxs[2] - vMins[2]));
vecPos[0] = vMins[0] + (random() * (vMaxs[0] - vMins[0]));
vecPos[1] = vMins[1] + (random() * (vMaxs[1] - vMins[1]));
vecPos[2] = vMins[2] + (random() * (vMaxs[2] - vMins[2]));
setorigin(eGib, vecPos);
setmodel(eGib, sModel);
setcustomskin(eGib, "", sprintf("geomset 0 %f\n", random(1, fModelCount + 1)));
eGib.movetype = MOVETYPE_BOUNCE;
eGib.solid = SOLID_NOT;
eGib.avelocity[0] = random()*600;
eGib.avelocity[1] = random()*600;
eGib.avelocity[2] = random()*600;
eGib.think = FX_BreakModel_Remove;
eGib.nextthink = time + 10;
if ((fStyle == GSMATERIAL_GLASS) || (fStyle == GSMATERIAL_GLASS_UNBREAKABLE)) {
eGib.effects = EF_ADDITIVE;
}

View file

@ -55,12 +55,11 @@ 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);
vel[2] = (300 + random() * 64);
entity gibb = spawn();
setmodel(gibb, g_hgibs[i]);
setorigin(gibb, pos);

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;
}
}