Skip to content

Commit

Permalink
[core + api + uvn_fira] Fix list count problems with grid, fix syntax…
Browse files Browse the repository at this point in the history
… error on info
  • Loading branch information
alicerunsonfedora committed May 12, 2020
1 parent 94e5c06 commit 4da7e55
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
**/**.pyc
**/**.egg-info
docs/_site/
.idea/**
.idea/**
tests/test.nvm
2 changes: 1 addition & 1 deletion uvn_fira/api/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_level_information(level, fn_path="", **kwargs):
if "config_file" in kwargs \
else path.join("core", "src", "minigame", "levels", ("level%s.toml" % (level)))
w_info = CSWorldConfigReader(conf, **kwargs)
writer = CSNadiaVMWriter(path.join(fn_path, "compiled", ("adv_lvl%s.nvm" % (level)))
writer = CSNadiaVMWriter(path.join(fn_path, "compiled", ("adv_lvl%s.nvm" % (level))))
world = CSWorld(from_data=w_info.data)
player = CSPlayer(in_world=world, vm=writer)
return player, world
5 changes: 3 additions & 2 deletions uvn_fira/core/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ def as_list(self):
grid.
"""
coordinates = []
for row in range(len(self.grid) - 1):
for column in range(len(self.grid[0]) - 1):
rows, columns = self.shape()
for row in range(rows):
for column in range(columns):
if self.grid[row][column] is not None:
coordinates.append((row, column))
return coordinates
Expand Down

0 comments on commit 4da7e55

Please sign in to comment.