bindKey shouldn't be able to bind function multiple times

オープン 初心者向け
#2,629 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

@iManGaaX がすでに取り組んでいます。

2026年10月31日 から。

  • #5526 @iManGaaX による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
65/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
cpp, lua
領域
api

調査の方向性

bindKey エントリーポイントの実装から始め、同じキー、状態、関数に対する既存のバインドをどのように処理するかを追跡してください。報告にある2つの呼び出しで問題を再現してください。2回目の呼び出しが false を返し、J を押したときに「Hi」が1回だけ出力されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug
Describe the bug

If you gonna use bindKey twice, second call will return true and bind function even if it was bound before. I believe (and if i remember correctly, it was in past) that calling bindKey for the 2nd (and any other) time should return false, and do not attach function again.

Steps to reproduce
function testBindKey()
	print("Hi")
end
bindKey("j", "down", testBindKey)
bindKey("j", "down", testBindKey)

Press J once, "Hi" would be printed twice.

Version

Client/server: v1.5.9-release-21237

Additional context

Initially i thought that was causing function call to be blocked at all, but after all it just call function twice (or more).

Relevant log output

No response

Security Policy
  • I have read and understood the Security Policy and this issue is not security related.
主要言語
C++
スター
1.9k
フォーク
588
平均マージ
4日 9分
マージ済み PR(30日)
11

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

multitheftauto/mtasa-blue のほかの issue

multitheftauto/mtasa-blue の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。