EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   COMMITTED (Rev1454): quest::givecash() (https://www.eqemulator.org/forums/showthread.php?t=31077)

joligario 04-17-2010 02:04 PM

COMMITTED (Rev1454): quest::givecash()
 
Low priority fix. When returning 0 cash, quest manager still creates a temp string which outputs " pieces." to the client. Then, changed "plat" to "platinum". Also, just a little spacing cleanup. Had an idea to space the cash out (example: http://everquest.allakhazam.com/db/q...tml?quest=1243), but felt we could leave well enough alone.

Code:

Index: questmgr.cpp
===================================================================
--- questmgr.cpp        (revision 1386)
+++ questmgr.cpp        (working copy)
@@ -788,41 +788,41 @@
 }
 
 void QuestManager::givecash(int copper, int silver, int gold, int platinum) {
-        if (initiator && initiator->IsClient())
+        if (initiator && initiator->IsClient() && ((copper + silver + gold + platinum) > 0))
        {
-                initiator->AddMoneyToPP(copper, silver, gold, platinum,true);
+                initiator->AddMoneyToPP(copper, silver, gold, platinum, true);
 
                string tmp;
-                if (platinum>0){
+                if (platinum > 0) {
                        tmp = "You receive ";
                        tmp += itoa(platinum);
-                        tmp += " plat";
+                        tmp += " platinum";
                }
-                if (gold>0){
-                        if (tmp.length()==0){
+                if (gold > 0) {
+                        if (tmp.length() == 0) {
                                tmp = "You receive ";
                        }
-                        else{
+                        else {
                                tmp += ",";
                        }
                        tmp += itoa(gold);
                        tmp += " gold";
                }
-                if(silver>0){
-                        if (tmp.length()==0){
+                if(silver > 0) {
+                        if (tmp.length() == 0) {
                                tmp = "You receive ";
                        }
-                        else{
+                        else {
                                tmp += ",";
                        }
                        tmp += itoa(silver);
                        tmp += " silver";
                }
-                if(copper>0){
-                        if (tmp.length()==0){
+                if(copper > 0) {
+                        if (tmp.length() == 0) {
                                tmp = "You receive ";
                        }
-                        else{
+                        else {
                                tmp += ",";
                        }
                        tmp += itoa(copper);



All times are GMT -4. The time now is 06:40 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.