Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.

Commit e630e55

Browse files
authored
Merge pull request LmeSzinc#4908 from LmeSzinc/bug_fix
Bug fix
2 parents 59c9503 + d4f1a44 commit e630e55

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

module/device/method/ascreencap.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ def __uncompress(self, screenshot):
170170
# ValueError: cannot reshape array of size 0 into shape (720,1280,4)
171171
raise ImageTruncated(str(e))
172172

173-
cv2.flip(image, 0, dst=image)
173+
# flip without `dst=image`
174+
# np.frombuffer creates a read-only memory view, we need to create a writable copy here
175+
image = cv2.flip(image, 0)
174176
if image is None:
175177
raise ImageTruncated('Empty image after cv2.flip')
176178

module/device/method/scrcpy/scrcpy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ def screenshot_scrcpy(self):
101101
if thread is None or not thread.is_alive():
102102
raise ScrcpyError('_scrcpy_stream_loop_thread died')
103103
if self._scrcpy_last_frame_time > now:
104-
screenshot = self._scrcpy_last_frame.copy()
104+
# no copy
105+
screenshot = self._scrcpy_last_frame
105106
return screenshot
106107

107108
@retry

module/os_ash/ash.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ def handle_battle_status(self, drop=None):
4848

4949
return False
5050

51+
def handle_exp_info(self):
52+
"""
53+
META combats don't drop EXP so no handle_exp_info
54+
Random background of BATTLE_STATUS may trigger EXP_INFO_B
55+
"""
56+
return False
57+
5158
def handle_battle_preparation(self):
5259
if super().handle_battle_preparation():
5360
return True

0 commit comments

Comments
 (0)