- Code: Select all
def apply_script(protocol, connection, config):
class NobuildProtocol(protocol):
def on_map_change(self, map):
extensions = self.map_info.extensions
if extensions.has_key('nobuild'):
self.building = False
else:
self.building = True
return protocol.on_map_change(self, map)
return NobuildProtocol, connection
Save as nobuild.py
Basically, this enables mapmakers to toggle whether building and damage is enabled on their maps by adding this in the map extensions;
- Code: Select all
extensions = {
'nobuild': True
}
It can be disabled by either changing the boolean to False, or by deleting the whole thing.