home
·
contact
·
privacy
projects
/
plomrogue2-experiments
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1a8d171
)
Fix map line width check.
author
Christian Heller
<c.heller@plomlompom.de>
Mon, 26 Oct 2020 23:07:02 +0000
(
00:07
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Mon, 26 Oct 2020 23:07:02 +0000
(
00:07
+0100)
new2/plomrogue/mapping.py
patch
|
blob
|
history
diff --git
a/new2/plomrogue/mapping.py
b/new2/plomrogue/mapping.py
index 2edbea84809acbfc759aed7993e603ffdb9c74e6..f056e105ca57a11d59b45d8451bada77211ef703 100644
(file)
--- a/
new2/plomrogue/mapping.py
+++ b/
new2/plomrogue/mapping.py
@@
-1,4
+1,5
@@
import collections
+from plomrogue.errors import ArgError
@@
-89,8
+90,8
@@
class Map():
if y >= height_map:
raise ArgError('too large row number %s' % y)
width_line = len(line)
- if width_line
>
width_map:
- raise ArgError('
too large map line width %s' % width_line
)
+ if width_line
!=
width_map:
+ raise ArgError('
map line width %s unequal map width %s' % (width_line, width_map)
)
self.terrain = self.terrain[:y * width_map] + line +\
self.terrain[(y + 1) * width_map:]