Fix object interaction distance not being checked (#10547)

This commit is contained in:
rubenwardy 2020-11-09 10:55:15 +00:00 committed by GitHub
parent c940a57a38
commit 7589cbe086
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

@ -1050,12 +1050,13 @@ void Server::handleCommand_Interact(NetworkPacket *pkt)
}
float d = playersao->getEyePosition().getDistanceFrom(target_pos);
if (!checkInteractDistance(player, d, pointed.dump())
&& pointed.type == POINTEDTHING_NODE) {
if (!checkInteractDistance(player, d, pointed.dump())) {
if (pointed.type == POINTEDTHING_NODE) {
// Re-send block to revert change on client-side
RemoteClient *client = getClient(peer_id);
v3s16 blockpos = getNodeBlockPos(pointed.node_undersurface);
client->SetBlockNotSent(blockpos);
}
return;
}
}