forked from Mirrorlandia_minetest/minetest
Optimize interaction distance checker (#8193)
The "what" parameter is being passed by value, most likely by accident as the type is "const std::string". Convert it to a reference by adding the missing "&".
This commit is contained in:
parent
557afdc429
commit
007c8440d7
@ -952,7 +952,7 @@ void Server::handleCommand_Respawn(NetworkPacket* pkt)
|
|||||||
// the previous addition has been successfully removed
|
// the previous addition has been successfully removed
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Server::checkInteractDistance(RemotePlayer *player, const f32 d, const std::string what)
|
bool Server::checkInteractDistance(RemotePlayer *player, const f32 d, const std::string &what)
|
||||||
{
|
{
|
||||||
PlayerSAO *playersao = player->getPlayerSAO();
|
PlayerSAO *playersao = player->getPlayerSAO();
|
||||||
const InventoryList *hlist = playersao->getInventory()->getList("hand");
|
const InventoryList *hlist = playersao->getInventory()->getList("hand");
|
||||||
|
@ -477,7 +477,7 @@ private:
|
|||||||
void RespawnPlayer(session_t peer_id);
|
void RespawnPlayer(session_t peer_id);
|
||||||
void DeleteClient(session_t peer_id, ClientDeletionReason reason);
|
void DeleteClient(session_t peer_id, ClientDeletionReason reason);
|
||||||
void UpdateCrafting(RemotePlayer *player);
|
void UpdateCrafting(RemotePlayer *player);
|
||||||
bool checkInteractDistance(RemotePlayer *player, const f32 d, const std::string what);
|
bool checkInteractDistance(RemotePlayer *player, const f32 d, const std::string &what);
|
||||||
|
|
||||||
void handleChatInterfaceEvent(ChatEvent *evt);
|
void handleChatInterfaceEvent(ChatEvent *evt);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user