Skip to content

Commit

Permalink
stub fix for section 1105.
Browse files Browse the repository at this point in the history
  • Loading branch information
gynt committed Sep 29, 2020
1 parent d38ff99 commit 6cc57f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
setup(
name="sourcehold",
cmdclass={"build_ext": build_ext},
version="0.0.2",
version="0.0.3",
author="The developers",
author_email="[email protected]",
description="A package to interact with stronghold (crusader) files and the process",
Expand Down
8 changes: 7 additions & 1 deletion sourcehold/maps/sections/section1105.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from .types import TileMapSection
from .types import ArrayMapCompressedSection
from .objects import ChildStructure
import struct
from sourcehold.world import TileLocationTranslator
world = TileLocationTranslator()


class TileMap(ChildStructure, TileMapSection):
Expand All @@ -9,7 +12,6 @@ class TileMap(ChildStructure, TileMapSection):

def __init__(self, parent, offset):
super().__init__(parent, offset)
# TODO: stubbing! This is a read only section for now

def from_buffer(self, buf, **kwargs):
return super().from_buffer(buf, length=80400)
Expand All @@ -18,6 +20,10 @@ def from_buffer(self, buf, **kwargs):
def size_of(cls):
return 80400

def get_data(self):
# TODO: stubbing! This is a read only section for now
return super().get_data()[self._offset:self._offset + 80400]


class Section1105(ArrayMapCompressedSection):
_TYPE_ = TileMap
Expand Down

0 comments on commit 6cc57f7

Please sign in to comment.