Преглед изворни кода

Added mail zeny loss prevention, bugreport:2919

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15310 54d463be-8e91-2dee-dedb-b68131a5f0ec
shennetsind пре 13 година
родитељ
комит
7627f2522e
2 измењених фајлова са 5 додато и 1 уклоњено
  1. 3 0
      src/map/clif.c
  2. 2 1
      src/map/mail.c

+ 3 - 0
src/map/clif.c

@@ -13032,6 +13032,9 @@ void clif_parse_Mail_getattach(int fd, struct map_session_data *sd)
 	if( sd->mail.inbox.msg[i].zeny < 1 && (sd->mail.inbox.msg[i].item.nameid < 1 || sd->mail.inbox.msg[i].item.amount < 1) )
 		return;
 
+	if( ( sd->mail.inbox.msg[i].zeny + sd->mail.inbox.msg[i].zeny ) > MAX_ZENY )
+		return;
+	
 	if( sd->mail.inbox.msg[i].item.nameid > 0 )
 	{
 		struct item_data *data;

+ 2 - 1
src/map/mail.c

@@ -52,7 +52,8 @@ int mail_removeitem(struct map_session_data *sd, short flag)
 int mail_removezeny(struct map_session_data *sd, short flag)
 {
 	nullpo_ret(sd);
-
+	if( ( sd->status.zeny + sd->mail.zeny ) > MAX_ZENY )
+		return 1;
 	if (flag && sd->mail.zeny > 0)
 	{  //Zeny send
 		log_zeny(sd, LOG_TYPE_MAIL, sd, -sd->mail.zeny);