mirror of
https://github.com/evennia/evennia.git
synced 2026-03-23 08:16:30 +01:00
Fix shift bug in ANSIString.__mult__. Resolves #2030
This commit is contained in:
parent
f41034e6a7
commit
6c3a7367ab
1 changed files with 3 additions and 1 deletions
|
|
@ -821,6 +821,8 @@ class ANSIString(str, metaclass=ANSIMeta):
|
|||
by a number.
|
||||
|
||||
"""
|
||||
if not offset:
|
||||
return []
|
||||
return [i + offset for i in iterable]
|
||||
|
||||
@classmethod
|
||||
|
|
@ -1063,7 +1065,7 @@ class ANSIString(str, metaclass=ANSIMeta):
|
|||
clean_string = self._clean_string * other
|
||||
code_indexes = self._code_indexes[:]
|
||||
char_indexes = self._char_indexes[:]
|
||||
for i in range(1, other + 1):
|
||||
for i in range(other):
|
||||
code_indexes.extend(self._shifter(self._code_indexes, i * len(self._raw_string)))
|
||||
char_indexes.extend(self._shifter(self._char_indexes, i * len(self._raw_string)))
|
||||
return ANSIString(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue