Skip to content

Commit

Permalink
Fix quick eval has no meta
Browse files Browse the repository at this point in the history
  • Loading branch information
shinkuan committed May 25, 2024
1 parent 0e68849 commit 3affbd1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def update(self, mjai_msg, state):
for i in range(3):
self.consumes[i].update(TILE_2_UNICODE_ART_RICH["?"])
self.app.rpc_server.draw_top3([self.recommand_idx, recommand[0], "?", "?", "?", weight_text])
elif recommand[0] in ['chi_low', 'chi_mid', 'chi_high']:
elif recommand[0] in ['chi_low', 'chi_mid', 'chi_high', 'chi']:
self.action.label = "chi"
self.action.add_class("action_chi")
last_kawa_tile = state.last_kawa_tile()
Expand Down Expand Up @@ -284,7 +284,10 @@ def refresh_log(self) -> None:
self.app.set_timer(2, self.autoplay)
if self.mjai_msg_idx < len(self.app.mjai_msg_dict[self.flow_id]):
bridge = self.app.bridge[self.flow_id]
self.app.mjai_msg_dict[self.flow_id][-1]['meta'] = meta_to_recommend(self.app.mjai_msg_dict[self.flow_id][-1]['meta'], bridge.is_3p)
if 'meta' in self.app.mjai_msg_dict[self.flow_id][-1]:
self.app.mjai_msg_dict[self.flow_id][-1]['meta'] = meta_to_recommend(self.app.mjai_msg_dict[self.flow_id][-1]['meta'], bridge.is_3p)
else:
self.app.mjai_msg_dict[self.flow_id][-1]['meta'] = [[self.app.mjai_msg_dict[self.flow_id][-1]['type'], 1.0]]
latest_mjai_msg = self.app.mjai_msg_dict[self.flow_id][-1]
# Update tehai
player_state = bridge.mjai_client.bot.state()
Expand Down

0 comments on commit 3affbd1

Please sign in to comment.