Tweak item_pickup/drop behaviour a little
This commit is contained in:
parent
9e675c212d
commit
1bb1f03167
2 changed files with 14 additions and 16 deletions
|
@ -41,11 +41,10 @@ item_pickup::Touch(entity eToucher)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (real_owner || m_iWasDropped == 1 || cvar("sv_playerslots") == 1) {
|
if (real_owner || m_iWasDropped == 1 || cvar("sv_playerslots") == 1) {
|
||||||
remove(self);
|
Destroy();
|
||||||
} else {
|
} else {
|
||||||
Hide();
|
Disappear();
|
||||||
think = Respawn;
|
ScheduleThink(Respawn, 30.0f);
|
||||||
nextthink = time + 30.0f;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,9 +74,7 @@ item_pickup::Respawn(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
SetSize([-16,-16,0], [16,16,16]);
|
SetSize([-16,-16,0], [16,16,16]);
|
||||||
|
ReleaseThink();
|
||||||
think = __NULL__;
|
|
||||||
nextthink = -1;
|
|
||||||
|
|
||||||
if (!m_iWasDropped) {
|
if (!m_iWasDropped) {
|
||||||
m_iClip = -1;
|
m_iClip = -1;
|
||||||
|
|
|
@ -331,7 +331,6 @@ Weapon_DropCurrentWeapon
|
||||||
void
|
void
|
||||||
Weapon_DropCurrentWeapon(NSClientPlayer pl)
|
Weapon_DropCurrentWeapon(NSClientPlayer pl)
|
||||||
{
|
{
|
||||||
|
|
||||||
static void DropWeapon_Enable(void)
|
static void DropWeapon_Enable(void)
|
||||||
{
|
{
|
||||||
self.solid = SOLID_TRIGGER;
|
self.solid = SOLID_TRIGGER;
|
||||||
|
@ -346,17 +345,19 @@ Weapon_DropCurrentWeapon(NSClientPlayer pl)
|
||||||
item_pickup drop = spawn(item_pickup);
|
item_pickup drop = spawn(item_pickup);
|
||||||
drop.m_iWasDropped = TRUE;
|
drop.m_iWasDropped = TRUE;
|
||||||
drop.m_iClip = pl.a_ammo1;
|
drop.m_iClip = pl.a_ammo1;
|
||||||
|
drop.real_owner = pl;
|
||||||
|
drop.owner = pl;
|
||||||
drop.SetItem(pl.activeweapon);
|
drop.SetItem(pl.activeweapon);
|
||||||
setorigin(drop, pl.origin);
|
drop.SetSolid(SOLID_NOT);
|
||||||
drop.solid = SOLID_NOT;
|
drop.SetOrigin(pl.origin);
|
||||||
drop.think = DropWeapon_Enable;
|
drop.ScheduleThink(DropWeapon_Enable, 1.5f);
|
||||||
drop.nextthink = time + 1.5f;
|
drop.SetMovetype(MOVETYPE_TOSS);
|
||||||
drop.movetype = MOVETYPE_TOSS;
|
|
||||||
drop.classname = "remove_me";
|
drop.classname = "remove_me";
|
||||||
|
drop.SetGravity(1.0f);
|
||||||
|
|
||||||
makevectors(pl.v_angle);
|
makevectors([-fabs(pl.v_angle[0]), pl.v_angle[1], 0]);
|
||||||
drop.velocity = v_forward * 256;
|
drop.SetVelocity(v_forward * 256);
|
||||||
drop.avelocity[1] = 500;
|
drop.SetAngularVelocity([0.0f, 500.0f, 0.0f]);
|
||||||
Weapons_RemoveItem(pl, pl.activeweapon);
|
Weapons_RemoveItem(pl, pl.activeweapon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue