Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 04-17-2010, 02:04 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,497
Default 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);
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:34 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3