Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

found bug in QSanInvokeSkillDock::update() #2

Closed
hejun442001 opened this issue Jul 1, 2012 · 5 comments
Closed

found bug in QSanInvokeSkillDock::update() #2

hejun442001 opened this issue Jul 1, 2012 · 5 comments

Comments

@hejun442001
Copy link

I found bug in QSanInvokeSkillDock::update()

at src/ui/qsanbutton.cpp L390 : " int btnWidth = _m_width / btnNum[i] "
program crashed when btnNum[i] equals zero.
it will happen when player lost all skills.

I fixed the bug in this commit:
https://github.com/hejun442001/QSanguosha/commit/686129feb5c0ca35dced20e9bf4b026c9c3a0bdc

(btw: I cannot send pull request to this project, so I send this issues)

@gaodayihao
Copy link
Owner

Thank you for your feedback.
We also found the problem, but I tend to use this way to solve:

at: src\ui\qsanbutton.h L144: update();
modified as: if (!_m_buttons.empty()) update();

@gaodayihao
Copy link
Owner

I think this solution is safer and easier to read.

Thanks for your feedback again.

@hejun442001
Copy link
Author

最后决定在我的分支中用 @gaodayihao 的方案了
这里呢?

@gaodayihao
Copy link
Owner

都没用…………因为都有点笨…………: )

@hejun442001
Copy link
Author

为什么? 55555555555555555~~~~~~~~~~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants