from pyspades.server import *


def apply_script(protocol, connection, config):

    class getitrealconnection(connection):

    	def on_flag_take(self):

    		x,y,z = self.team.other.flag.get()

    		if not self.world_object.can_see(x,y,z):
    			return False
    		else: return connection.on_flag_take(self)

    return protocol, getitrealconnection