File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -540,21 +540,22 @@ int Player::removeCard(const string& name){
540
540
++it;
541
541
}
542
542
}
543
+ NameList.erase (name);
543
544
mCardList .erase (id);
544
545
while (!mCardList .count (indexMax))indexMax--;
545
- NameList.erase (name);
546
546
return 0 ;
547
547
}
548
548
int Player::renameCard (const string& name, const string& name_new) {
549
549
std::lock_guard<std::mutex> lock_queue (cardMutex);
550
550
if (name_new.empty ())return -3 ;
551
551
if (NameList.count (name_new))return -4 ;
552
552
if (name_new.find (" :" ) != string::npos)return -6 ;
553
- const auto i = NameList[name]->getID ();
554
- if (mCardList [i]->locked (" n" ))return -22 ;
555
- NameList[name_new] = NameList[name];
553
+ auto pc{ NameList[name] };
554
+ const auto i = pc->getID ();
555
+ if (pc->locked (" n" ))return -22 ;
556
+ NameList[name_new] = pc;
556
557
NameList.erase (name);
557
- mCardList [i] ->setName (name_new);
558
+ pc ->setName (name_new);
558
559
return 0 ;
559
560
}
560
561
int Player::copyCard (const string& name1, const string& name2, long long group)
Original file line number Diff line number Diff line change @@ -4064,7 +4064,7 @@ int DiceEvent::InnerOrder() {
4064
4064
if (strMsg[intMsgCnt] == ' &' ) {
4065
4065
if (!(attr_name = readToColon ()).empty ()) {
4066
4066
string attr_new;
4067
- if (pc->set (get_str ( " attr " ) , attr_new = readExp ())) {
4067
+ if (pc->set (attr_name , attr_new = readExp ())) {
4068
4068
set (" detailed" );
4069
4069
trans = AnysTable{ {
4070
4070
{" attr" , attr_name},
You can’t perform that action at this time.
0 commit comments