Skip to content
This repository has been archived by the owner on Oct 28, 2023. It is now read-only.

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrBox committed Jan 1, 2022
1 parent 225df56 commit 2098094
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions LLMoney/LLMoney.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,14 @@ class MoneyCommand : public Command {
break;
case pay:
{
if ((unsigned short)ori.getOriginType() != (unsigned short)OriginType::Player) {
outp.error("You are not a player");
}
if (moneynum <= 0) {
outp.error(tr("money.invalid.arg"));
return;
}
myuid = ori.getPlayer()->getXuid();
if (myuid == "" || myuid == dstxuid) {
outp.error(tr("money.no.target"));
return;
}
if (LLMoneyTrans(myuid, dstxuid, moneynum, "money pay")) {
money_t fee = (money_t)(moneynum * MoneyFee);
Expand All @@ -103,11 +102,13 @@ class MoneyCommand : public Command {
else {
outp.error(tr("money.not.enough"));
}
return;
}
break;
case set:
if (ori.getPermissionsLevel() < 1) {
outp.error(tr("money.no.perm"));
return;
}
if (LLMoneySet(dstxuid, moneynum)) {
outp.success("set success");
Expand All @@ -119,6 +120,7 @@ class MoneyCommand : public Command {
case add:
if (ori.getPermissionsLevel() < 1) {
outp.error(tr("money.no.perm"));
return;
}
if (LLMoneyAdd(dstxuid, moneynum)) {
outp.success("add success");
Expand All @@ -130,6 +132,7 @@ class MoneyCommand : public Command {
case reduce:
if (ori.getPermissionsLevel() < 1) {
outp.error(tr("money.no.perm"));
return;
}
if (LLMoneyReduce(dstxuid, moneynum)) {
}
Expand Down Expand Up @@ -236,15 +239,14 @@ class MoneySCommand : public Command {
break;
case pay:
{
if ((unsigned short)ori.getOriginType() != (unsigned short)OriginType::Player) {
outp.error("You are not a player");
}
if (moneynum <= 0) {
outp.error(tr("money.invalid.arg"));
return;
}
myuid = PlayerInfo::getXuid(ori.getName());
if (myuid.val() == "") {
outp.error(tr("money.no.target"));
return;
}
if (LLMoneyTrans(myuid.val(), dstxuid.val(), moneynum, "money pay")) {
money_t fee = (money_t)(moneynum * MoneyFee);
Expand All @@ -260,6 +262,7 @@ class MoneySCommand : public Command {
case set:
if (ori.getPermissionsLevel() < 1) {
outp.error(tr("money.no.perm"));
return;
}
if (LLMoneySet(dstxuid.val(), moneynum)) {
outp.success("set success");
Expand All @@ -271,6 +274,7 @@ class MoneySCommand : public Command {
case add:
if (ori.getPermissionsLevel() < 1) {
outp.error(tr("money.no.perm"));
return;
}
if (LLMoneyAdd(dstxuid.val(), moneynum)) {
outp.success("add success");
Expand All @@ -282,6 +286,7 @@ class MoneySCommand : public Command {
case reduce:
if (ori.getPermissionsLevel() < 1) {
outp.error(tr("money.no.perm"));
return;
}
if (LLMoneyReduce(dstxuid.val(), moneynum)) {
}
Expand Down

0 comments on commit 2098094

Please sign in to comment.