mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 01:05:48 +01:00 
			
		
		
		
	Block & report player self-interaction (#11137)
This commit is contained in:
		@@ -1041,6 +1041,12 @@ void Server::handleCommand_Interact(NetworkPacket *pkt)
 | 
			
		||||
		if (pointed.type == POINTEDTHING_NODE) {
 | 
			
		||||
			target_pos = intToFloat(pointed.node_undersurface, BS);
 | 
			
		||||
		} else if (pointed.type == POINTEDTHING_OBJECT) {
 | 
			
		||||
			if (playersao->getId() == pointed_object->getId()) {
 | 
			
		||||
				actionstream << "Server: " << player->getName()
 | 
			
		||||
					<< " attempted to interact with themselves" << std::endl;
 | 
			
		||||
				m_script->on_cheat(playersao, "interacted_with_self");
 | 
			
		||||
				return;
 | 
			
		||||
			}
 | 
			
		||||
			target_pos = pointed_object->getBasePosition();
 | 
			
		||||
		}
 | 
			
		||||
		float d = playersao->getEyePosition().getDistanceFrom(target_pos);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user