From 9895fe875b5016d71a99d96bcf7576a0ff6e7296 Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Wed, 19 Feb 2020 15:06:42 +0100 Subject: [PATCH] textures: remove baffling texture generation logic We used to generate textures multiple times for each worker process, which didn't seem to be intended as it was done gated behind a reversed if statement. It just so happened to fix an issue introduced by the pickling code which was deleting vital attributes like the actual generated textures. I'm honestly not sure why this was ever done, so let's just throw this out and call it a day. Fixes #1728 --- overviewer_core/textures.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/overviewer_core/textures.py b/overviewer_core/textures.py index 8867726..8c701da 100644 --- a/overviewer_core/textures.py +++ b/overviewer_core/textures.py @@ -94,13 +94,8 @@ class Textures(object): ## def __getstate__(self): - # we must get rid of the huge image lists, and other images attributes = self.__dict__.copy() - for attr in ['blockmap', 'biome_grass_texture', 'watertexture', 'lavatexture', 'firetexture', 'portaltexture', 'lightcolor', 'grasscolor', 'foliagecolor', 'watercolor', 'texture_cache']: - try: - del attributes[attr] - except KeyError: - pass + # Get rid of the jar list because file objects aren't pickleable like that attributes['jars'] = OrderedDict() return attributes def __setstate__(self, attrs): @@ -108,7 +103,7 @@ class Textures(object): for attr, val in list(attrs.items()): setattr(self, attr, val) self.texture_cache = {} - if self.generated: + if not self.generated: self.generate() ##