Example #1
0
def loadMod(modFile, target = None):
    '''Load mod into worldregistry or target; TODO: remove target loading from here'''
    global world
    target = target or world
    
    newMod = loader.modFromFile(modFile)
    if newMod:
        if target != world:
            newMod.applyMod(target)
            return None
        
        global lastMod
        lastMod += 1
        mods[lastMod] = newMod
        newMod.applyMod(world)
        return lastMod
    else:
        return None
Example #2
0
 def loadMod(self, modFile):
     mod = loader.modFromFile(modFile)
     try:
         mod.applyMod(self)
     except AttributeError:
         logging.warning('client can\'t load mod')