items: Implement ::PickupRespawn

This commit is contained in:
Marco Cawthorne 2023-02-12 13:03:49 -08:00
parent f7a1910541
commit c03b3fc5dc
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
1 changed files with 8 additions and 9 deletions

View File

@ -40,11 +40,17 @@ item_pickup::Touch(entity eToucher)
Destroy();
} else {
Disappear();
think = Respawn;
nextthink = time + 30.0f;
ScheduleThink(PickupRespawn, 30.0f);
}
}
void
item_pickup::PickupRespawn(void)
{
Respawn();
Sound_Play(this, CHAN_ITEM, "item.respawn");
}
void
item_pickup::SetItem(int i)
{
@ -75,13 +81,6 @@ item_pickup::Respawn(void)
think = __NULL__;
nextthink = -1;
if (!m_iWasDropped && cvar("sv_playerslots") > 1) {
if (!real_owner)
Sound_Play(this, CHAN_ITEM, "item.respawn");
m_iClip = -1;
}
if (!m_bFloating) {
droptofloor();
SetMovetype(MOVETYPE_TOSS);