Skip to content

Commit

Permalink
fix: ww
Browse files Browse the repository at this point in the history
修复ww指令由于花括号转义而导致的bug
微调getPlayerCardAttr缺省值生效时机
  • Loading branch information
mystringEmpty committed Mar 2, 2024
1 parent 70b526b commit 8c98acf
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
5 changes: 2 additions & 3 deletions Dice/DiceEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4311,9 +4311,8 @@ int DiceEvent::InnerOrder() {
// ReSharper disable once CppExpressionWithoutSideEffects
rdMainDice.Roll();
set("res",boolDetail ? rdMainDice.FormCompleteString() : rdMainDice.FormShortString());
if (strReason.empty())
strReply = getMsg("strRollDice");
else strReply = getMsg("strRollDiceReason");
console.log(rdMainDice.FormCompleteString());
strReply = getMsg(strReason.empty() ? "strRollDice" : "strRollDiceReason");
if (!is("hidden")) {
reply();
}
Expand Down
13 changes: 5 additions & 8 deletions Dice/DiceLua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -943,19 +943,16 @@ LUADEF(getPlayerCardAttr) {
if (int argc{ lua_gettop(L) }; argc > 4)lua_settop(L, 4);
else if (argc == 3)lua_pushnil(L);
else if (argc < 3)return 0;
long long plQQ{ lua_to_int_or_zero(L, 1) };
long long uid{ lua_to_int_or_zero(L, 1) };
long long group{ lua_to_int_or_zero(L, 2) };
string key{ lua_to_gbstring(L, 3) };
if (!plQQ || key.empty())return 0;
PC pc = getPlayer(plQQ)[group];
if (pc->has(key)) {
lua_push_attr(L, pc->get(key));
}
else if (key = pc->standard(key); pc->has(key)) {
if (!uid || key.empty())return 0;
PC pc = getPlayer(uid)[group];
if (auto val{ pc->get(key) };!val.is_null()) {
lua_push_attr(L, pc->get(key));
}
else if (pc->has("&" + key)) {
lua_push_string(L, pc->get_str("&" + key));
lua_push_string(L, pc->get("&" + key).to_str());
}
else {
lua_pushnil(L);
Expand Down
3 changes: 1 addition & 2 deletions Dice/GlobalVar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,7 @@ const dict_ci<> HelpDoc = {
589:ak���ư���ָ��
581:��ɫ����ͳ��
569:.rc/.draw��������
567:敏感词检测
565:.log日志记录)"},
567:���дʼ��)"},
{"Э��","0.��Э����Dice!Ĭ�Ϸ���Э�顣����㿴������仰����ζ��MasterӦ��Ĭ��Э�飬��ע�⡣\n1.�������ʹ�������������Ⱥ���Ķ���Э����Ϊͬ�Ⲣ��ŵ���ش�Э�飬������ʹ��.dismiss�Ƴ����\n2.���������ԡ��Ƴ������ˢ�������ȶ�����IJ�������Ϊ����Щ��Ϊ����������ﱻ�Ʋõķ��ա�����������Ӧ��ʹ��.bot on/off��\n3.����Ĭ��������Ϊ�ѵõ�Ⱥ������ͬ�Ⲣ�Ͽ�Э�飬������Զ�ͬ��Ⱥ���롣�����������ʹ����������������Ϊʱ����������δ����Ԥ����������е��������Ρ�\n4.��ֹ���������ڶIJ�������Υ��������Ϊ��\n5.�������������dzƵ��޷�Ԥ�����п�����������������Ϊ��������ܻ�������ұ������ܾ��ṩ����\n6.���ڼ����Լ��ʽ�ԭ�������޷���֤������100%��ʱ���ȶ����У����ܲ���ʱͣ��ά�����������ᣬ������Ӧ����ἰʱͨ��������������֪ͨ�������½⡣��ʱͣ�������ﲻ�����κ���Ӧ���ʶ�����Ӱ��Ⱥ�ڻ����״̬����Ȼ��ֹ��������Ϊ��\n7.����Υ��Э�����Ϊ�����ォ�������ֹ���û�������Ⱥ�ṩ���񣬲���������¼���������������ṩ����������������˿���������ṩ��Э�̣������ղö�Ȩ�ڷ����ṩ����\n8.��Э��������ʱ�п��ܸĶ�����ע�������Ϣ��ǩ�����ռ䡢�ٷ�Ⱥ�ȴ������ﶯ̬��\n9.�����ṩ������������ȫ��ѵģ���ӭͶʳ��\n10.���������ս���Ȩ������ṩ�����С�"},
{"����","Dice!��̳: https://kokona.tech\nDice!�ֲ�: https://v2docs.kokona.tech\n֧��Shiki: https://afdian.net/@dice_shiki"},
{"�趨",R"(Master��{print:master}
Expand Down
4 changes: 2 additions & 2 deletions Dice/RD.h
Original file line number Diff line number Diff line change
Expand Up @@ -393,15 +393,15 @@ class RD
bool isCnt = false;
if (i->size() >= 100)isCnt = true;
if (vvintRes.size() != 1 && i->size() != (*i)[0] + 1)
strReturnString.append("{ ");
strReturnString += "\\{";
int intWWPos = 0;
while (true)
{
if (intWWPos)
{
strReturnString += isCnt ? "\n加骰" + std::to_string((*i)[intWWPos]) + "" : "+";
}
strReturnString.append("{");
strReturnString += "\\{";
if (isCnt)
{
int Cnt[11] = {0};
Expand Down
2 changes: 1 addition & 1 deletion vcpkg
Submodule vcpkg updated 191 files

0 comments on commit 8c98acf

Please sign in to comment.