diff --git a/src/action/a_items.c b/src/action/a_items.c index 3a53f3c66..f15cdac3c 100644 --- a/src/action/a_items.c +++ b/src/action/a_items.c @@ -133,6 +133,8 @@ void SpecThink(edict_t * spec) G_FreeEdict(spec); } +// This function determines how long the special item will last until despawned +// The weapon version of this is SpecialWeaponRespawnTimer static void MakeTouchSpecThink(edict_t * ent) { ent->touch = Touch_Item; @@ -150,7 +152,12 @@ static void MakeTouchSpecThink(edict_t * ent) } if (gameSettings & GS_WEAPONCHOOSE) { - ent->nextthink = eztimer(6); + if (bot_enable->value && bot_connections.total_bots > 0) { + // Reduce time that items stick around if bots are loaded + ent->nextthink = eztimer(2); + } else { + ent->nextthink = eztimer(6); + } ent->think = G_FreeEdict; return; } diff --git a/src/action/p_weapon.c b/src/action/p_weapon.c index 183e4fa53..5f304a136 100644 --- a/src/action/p_weapon.c +++ b/src/action/p_weapon.c @@ -715,9 +715,14 @@ void SpecialWeaponRespawnTimer(edict_t* ent) ent->think = PlaceHolder; return; } - // Deathmatch with weapon choose, weapons disappear in 6s + // Deathmatch with weapon choose, weapons disappear in 6s (w/bots, 2 seconds) if (gameSettings & GS_WEAPONCHOOSE) { - ent->nextthink = eztimer(6); + if (bot_enable->value && bot_connections.total_bots > 0) { + // Reduce time that items stick around if bots are loaded + ent->nextthink = eztimer(2); + } else { + ent->nextthink = eztimer(6); + } ent->think = ThinkSpecWeap; return; }