diff --git a/Server/Source/player_pool.hpp b/Server/Source/player_pool.hpp index 87b400dbd..3f9c40d0f 100644 --- a/Server/Source/player_pool.hpp +++ b/Server/Source/player_pool.hpp @@ -1691,7 +1691,25 @@ struct PlayerPool final : public IPlayerPool, public NetworkEventHandler, public return { NewConnectionResult_BadName, nullptr }; } - Player* result = storage.emplace(*this, netData, params, useAllAnimations_, validateAnimations_, allowInteriorWeapons_, fixesComponent_); + Player* result = nullptr; + + if (params.bot) + { + for (auto index = storage.Capacity - 1; index >= 0; --index) + { + if (storage.get(index) == nullptr) + { + storage.claimHint(index, *this, netData, params, useAllAnimations_, validateAnimations_, allowInteriorWeapons_, fixesComponent_); + result = storage.get(index); + break; + } + } + } + else + { + result = storage.emplace(*this, netData, params, useAllAnimations_, validateAnimations_, allowInteriorWeapons_, fixesComponent_); + } + if (!result) { return { NewConnectionResult_NoPlayerSlot, nullptr };