diff options
| author | roc13x <roc13x@gmail.com> | 2017-08-17 02:00:42 -0600 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2017-08-20 18:10:11 +0200 |
| commit | e04f75bd962006662bc0f77f0034f061605fb1c6 (patch) | |
| tree | 5e8d1bf38ab41319634e104bdb08dce56d16ac9d /src/server/scripts/Commands | |
| parent | 26d63a276e51db88e293e61b190ca3789fea13db (diff) | |
Core/Players: Several gold handling improvements
* Update gold limit to 10 million
* Updated auction house gold handling to 64-bit
* Fixed some vendor checks for when BuyCount > 1
* Tweaked some checks for available gold space
* Updated guild bank gold handling to 64-bit and fix withdraw limits
* Enforce gold limit on guild bank
* Check correct rank right when withdrawing from bank
* Other small changes to update money to 64-bit
Closes #19195
Closes #20152
Diffstat (limited to 'src/server/scripts/Commands')
| -rw-r--r-- | src/server/scripts/Commands/cs_list.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_misc.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_modify.cpp | 3 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_send.cpp | 2 |
4 files changed, 5 insertions, 6 deletions
diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index 53faf7f84f4..01c4802c9f0 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -516,7 +516,7 @@ public: std::string subject = queryFields[5].GetString(); uint64 deliverTime = queryFields[6].GetUInt32(); uint64 expireTime = queryFields[7].GetUInt32(); - uint32 money = queryFields[8].GetUInt32(); + uint64 money = queryFields[8].GetUInt64(); uint8 hasItem = queryFields[9].GetUInt8(); uint32 gold = money / GOLD; uint32 silv = (money % GOLD) / SILVER; diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index f948869e838..7249a1ebb30 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1688,7 +1688,7 @@ public: uint32 totalPlayerTime = 0; uint8 level = 0; std::string alive = handler->GetTrinityString(LANG_ERROR); - uint32 money = 0; + uint64 money = 0; uint32 xp = 0; uint32 xptotal = 0; @@ -1747,7 +1747,7 @@ public: Field* fields = result->Fetch(); totalPlayerTime = fields[0].GetUInt32(); level = fields[1].GetUInt8(); - money = fields[2].GetUInt32(); + money = fields[2].GetUInt64(); accId = fields[3].GetUInt32(); raceid = fields[4].GetUInt8(); classid = fields[5].GetUInt8(); diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index a026a21314f..69eba057f6e 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -598,8 +598,7 @@ public: if (moneyToAdd >= int64(MAX_MONEY_AMOUNT)) moneyToAdd = MAX_MONEY_AMOUNT; - if (targetMoney >= uint64(MAX_MONEY_AMOUNT) - moneyToAdd) - moneyToAdd -= targetMoney; + moneyToAdd = std::min(moneyToAdd, int64(MAX_MONEY_AMOUNT - targetMoney)); target->ModifyMoney(moneyToAdd); } diff --git a/src/server/scripts/Commands/cs_send.cpp b/src/server/scripts/Commands/cs_send.cpp index 2c36e856772..ead9d9a7df0 100644 --- a/src/server/scripts/Commands/cs_send.cpp +++ b/src/server/scripts/Commands/cs_send.cpp @@ -230,7 +230,7 @@ public: return false; char* moneyStr = strtok(NULL, ""); - int32 money = moneyStr ? atoi(moneyStr) : 0; + int64 money = moneyStr ? atoll(moneyStr) : 0; if (money <= 0) return false; |
