Skip to content

Commit fc9b130

Browse files
committed
Fix 18574 right-click target bug.
1 parent e6a485f commit fc9b130

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sc2reader/readers.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,14 @@ def right_click_move(self, buffer, frames, type, code, pid, flag, atype):
630630
buffer.skip(4)
631631
return LocationAbilityEvent(frames, pid, type, code, 0x3601, (x,y))
632632

633+
def right_click_target(self, buffer, frames, type, code, pid, flag, atype):
634+
# ability (2), object id (4), object type (2), ?? (10)
635+
ability = buffer.read_short(endian=BIG_ENDIAN)
636+
buffer.shift(1) # weird shift..
637+
target = (buffer.read_int(BIG_ENDIAN), buffer.read_short(BIG_ENDIAN))
638+
buffer.skip(9)
639+
return TargetAbilityEvent(frames, pid, type, code, ability, target)
640+
633641
def command_card(self, buffer, frames, type, code, pid, flag, atype):
634642
# ability flags one longer now and shifted << 1
635643
ability = buffer.read_short(endian=BIG_ENDIAN)

0 commit comments

Comments
 (0)