Skip to content

Commit

Permalink
fix: pc new
Browse files Browse the repository at this point in the history
  • Loading branch information
mystringEmpty committed Feb 23, 2024
1 parent e580f12 commit 7e6a9f6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
5 changes: 2 additions & 3 deletions Dice/DiceConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* Dice! QQ Dice Robot for TRPG
* Copyright (C) 2018-2021 w4123溯洄
* Copyright (C) 2019-2022 String.Empty
* Copyright (C) 2019-2024 String.Empty
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation,
Expand Down Expand Up @@ -43,7 +43,7 @@
using namespace std;

const fifo_dict_ci<int>Console::intDefault{
{"DisabledGlobal",0},{"DisabledBlock",0},{"DisabledListenAt",1},
{"DisabledGlobal",0},{"DisabledListenAt",1},
{"DisabledMe",1},{"DisabledJrrp",0},{"DisabledDeck",1},{"DisabledDraw",0},{"DisabledSend",0},
{"Private",0},{"CheckGroupLicense",0},
{"ListenGroupRequest",1},{"ListenGroupAdd",1},
Expand Down Expand Up @@ -72,7 +72,6 @@ const fifo_dict_ci<int>Console::intDefault{
};
const std::unordered_map<std::string,string>Console::confComment{
{"DisabledGlobal","全局停用指令,对trust4不起效"},
{"DisabledBlock","框架多插件时,关闭状态开启拦截,阻止其他插件处理消息"},
{"DisabledListenAt","关闭状态下,自身被at时也响应"},
{"DisabledMe","全局禁用.me,对trust4+不起效"},
{"DisabledJrrp","全局禁用.jrrp,对trust4+不起效"},
Expand Down
11 changes: 7 additions & 4 deletions Dice/DiceEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3485,8 +3485,10 @@ int DiceEvent::InnerOrder() {
else if (strOption == "new") {
string strPC{ strip(filter_CQcode(readRest(), fromChat.gid)) };
if (!(resno = pl.newCard(strPC, fromChat.gid))) {
set("type", pl[fromChat.gid]->get_str("__Type"));
set("show", pl[fromChat.gid]->show(true));
auto pc = pl[fromChat.gid];
set("type", pc->get_str("__Type"));
set("show", pc->show(true));
set("char", pc->getName());
if (is_empty("show"))replyMsg("strPcNewEmptyCard");
else replyMsg("strPcNewCardShow");
}
Expand All @@ -3513,7 +3515,8 @@ int DiceEvent::InnerOrder() {
if (!(resno = pl.removeCard(get_str("char"))))replyMsg("strPcCardDel");
}
else if (strOption == "redo") {
pl.buildCard(strip(readRest()), true, fromChat.gid);
string strPC{ strip(filter_CQcode(readRest(), fromChat.gid)) };
pl.buildCard(strPC, true, fromChat.gid);
auto pc{ pl[fromChat.gid] };
set("char", pc);
set("show", pc->show(true));
Expand Down Expand Up @@ -4648,7 +4651,7 @@ bool DiceEvent::DiceFilter()
|| blacklist->get_group_danger(fromChat.gid))) {
isDisabled = true;
}
if (isDisabled |= (blacklist->get_user_danger(fromChat.uid) > 0))return console["DisabledBlock"];
if (isDisabled || blacklist->get_user_danger(fromChat.uid) > 0)return 1;
if (!is("order_off") && (fmt->listen_order(this) || InnerOrder())) {
return monitorFrq();
}
Expand Down
2 changes: 1 addition & 1 deletion Dice/DiceFormatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MarkReference : public MarkNode {
if (!isTrust && val == "\f")val = "\f> ";
return val;
}
return "{" + leaf + "}";
return {};
}
};
class MarkGlobalIndexNode : public MarkNode {
Expand Down

0 comments on commit 7e6a9f6

Please sign in to comment.