File tree 2 files changed +7
-0
lines changed
2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -4662,6 +4662,7 @@ Call these functions only at load time!
4662
4662
* `cheat`: `{type=<cheat_type>}`, where `<cheat_type>` is one of:
4663
4663
* `moved_too_fast`
4664
4664
* `interacted_too_far`
4665
+ * `interacted_with_self`
4665
4666
* `interacted_while_dead`
4666
4667
* `finished_unknown_dig`
4667
4668
* `dug_unbreakable`
Original file line number Diff line number Diff line change @@ -1051,6 +1051,12 @@ void Server::handleCommand_Interact(NetworkPacket *pkt)
1051
1051
if (pointed.type == POINTEDTHING_NODE) {
1052
1052
target_pos = intToFloat (pointed.node_undersurface , BS);
1053
1053
} else if (pointed.type == POINTEDTHING_OBJECT) {
1054
+ if (playersao->getId () == pointed_object->getId ()) {
1055
+ actionstream << " Server: " << player->getName ()
1056
+ << " attempted to interact with themselves" << std::endl;
1057
+ m_script->on_cheat (playersao, " interacted_with_self" );
1058
+ return ;
1059
+ }
1054
1060
target_pos = pointed_object->getBasePosition ();
1055
1061
}
1056
1062
float d = playersao->getEyePosition ().getDistanceFrom (target_pos);
You can’t perform that action at this time.
0 commit comments