mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-24 03:56:43 +00:00
Codefix: use constructor to set index of PoolItems over 'magic'/UB
This commit is contained in:
@@ -62,9 +62,11 @@ static_assert(lengthof(_admin_update_type_frequencies) == ADMIN_UPDATE_END);
|
||||
|
||||
/**
|
||||
* Create a new socket for the server side of the admin network.
|
||||
* @param index The index in the admin pool.
|
||||
* @param s The socket to connect with.
|
||||
*/
|
||||
ServerNetworkAdminSocketHandler::ServerNetworkAdminSocketHandler(SOCKET s) : NetworkAdminSocketHandler(s)
|
||||
ServerNetworkAdminSocketHandler::ServerNetworkAdminSocketHandler(AdminID index, SOCKET s) :
|
||||
NetworkAdminSocketPool::PoolItem<&_networkadminsocket_pool>(index), NetworkAdminSocketHandler(s)
|
||||
{
|
||||
this->status = ADMIN_STATUS_INACTIVE;
|
||||
this->connect_time = std::chrono::steady_clock::now();
|
||||
|
||||
Reference in New Issue
Block a user