Skip to content

Commit 7b01b94

Browse files
committedOct 4, 2015
Remove redundant code in player interact handler
1 parent f0cd5da commit 7b01b94

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed
 

‎src/network/serverpackethandler.cpp

+9-7
Original file line numberDiff line numberDiff line change
@@ -1467,21 +1467,22 @@ void Server::handleCommand_Interact(NetworkPacket* pkt)
14671467
NOTE: This can be used in the future to check if
14681468
somebody is cheating, by checking the timing.
14691469
*/
1470+
14701471
MapNode n(CONTENT_IGNORE);
14711472
bool pos_ok;
1472-
n = m_env->getMap().getNodeNoEx(p_under, &pos_ok);
1473-
if (pos_ok)
1474-
n = m_env->getMap().getNodeNoEx(p_under, &pos_ok);
14751473

1474+
n = m_env->getMap().getNodeNoEx(p_under, &pos_ok);
14761475
if (!pos_ok) {
14771476
infostream << "Server: Not punching: Node not found."
14781477
<< " Adding block to emerge queue."
14791478
<< std::endl;
1480-
m_emerge->enqueueBlockEmerge(pkt->getPeerId(), getNodeBlockPos(p_above), false);
1479+
m_emerge->enqueueBlockEmerge(pkt->getPeerId(),
1480+
getNodeBlockPos(p_above), false);
14811481
}
14821482

14831483
if (n.getContent() != CONTENT_IGNORE)
14841484
m_script->node_on_punch(p_under, n, playersao, pointed);
1485+
14851486
// Cheat prevention
14861487
playersao->noCheatDigStart(p_under);
14871488
}
@@ -1538,9 +1539,10 @@ void Server::handleCommand_Interact(NetworkPacket* pkt)
15381539
MapNode n = m_env->getMap().getNodeNoEx(p_under, &pos_ok);
15391540
if (!pos_ok) {
15401541
infostream << "Server: Not finishing digging: Node not found."
1541-
<< " Adding block to emerge queue."
1542-
<< std::endl;
1543-
m_emerge->enqueueBlockEmerge(pkt->getPeerId(), getNodeBlockPos(p_above), false);
1542+
<< " Adding block to emerge queue."
1543+
<< std::endl;
1544+
m_emerge->enqueueBlockEmerge(pkt->getPeerId(),
1545+
getNodeBlockPos(p_above), false);
15441546
}
15451547

15461548
/* Cheat prevention */

0 commit comments

Comments
 (0)
Please sign in to comment.