Function: GetBotCount(player, count_type)
Description: Returns the number of active companions or the saved companion count for the supplied Player.
Parameters:
player: player spawn. Optional count_type: the exact string "active" selects active companions; omitted or other strings select the saved count from the database.
Returns: Integer count. Invalid or non-player spawns return zero.
Active companion identity: Active counting uses live, ready registrations of the original Bot allocations. Reservations still being initialized and retired or expired Bots are excluded. Reusing a runtime ID does not make a replacement Bot inherit an old registration. Saved counting uses the supplied Player’s character ID.
Bot admission during teardown: Closing the Player's Bot registry excludes closing, cancelled and older-generation registrations from the active count immediately, while existing actor loans can finish before physical retirement. A live connection handoff preserves ready Player-owned Bots when no teardown occurred. The saved-count query is unchanged.