소스 검색

fixed @storage / @gstorage
started using MAX_MOB_DB

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@1256 54d463be-8e91-2dee-dedb-b68131a5f0ec

Lupus 20 년 전
부모
커밋
81ca684ee8
4개의 변경된 파일35개의 추가작업 그리고 6개의 파일을 삭제
  1. 2 1
      Changelog-SVN.txt
  2. 28 1
      src/map/atcommand.c
  3. 2 4
      src/map/mob.c
  4. 3 0
      src/map/mob.h

+ 2 - 1
Changelog-SVN.txt

@@ -1,6 +1,7 @@
 Date	Added
 
-03/10
+03/20
+	* Fixed @storage / @gstorage ATcommands thanks2 Yor/Freya [Lupus]
 	* Added a sql upgrader to handle the mob_db changes to assist
 	  in migrating to the newer SVN servers [MouseJstr]
 03/19

+ 28 - 1
src/map/atcommand.c

@@ -1874,12 +1874,25 @@ int atcommand_storage(
 	const int fd, struct map_session_data* sd,
 	const char* command, const char* message)
 {
+	struct storage *stor; //changes from Freya/Yor
 	nullpo_retr(-1, sd);
+
+	if (sd->state.storage_flag == 1) {
+		clif_displaymessage(fd, "You have opened your guild storage. Close it before.");
+		return -1;
+	}
+
+	if ((stor = account2storage2(sd->status.account_id)) != NULL && stor->storage_status == 1) {
+		clif_displaymessage(fd, "You have already opened your storage.");
+		return -1;
+	}
+
 	storage_storageopen(sd);
 
 	return 0;
 }
 
+
 /*==========================================
  *
  *------------------------------------------
@@ -1888,9 +1901,23 @@ int atcommand_guildstorage(
 	const int fd, struct map_session_data* sd,
 	const char* command, const char* message)
 {
+	struct storage *stor; //changes from Freya/Yor
 	nullpo_retr(-1, sd);
-	if (sd->status.guild_id > 0)
+
+	if (sd->status.guild_id > 0) {
+		if (sd->state.storage_flag == 1) {
+			clif_displaymessage(fd, "You have already opened your guild storage.");
+			return -1;
+		}
+		if ((stor = account2storage2(sd->status.account_id)) != NULL && stor->storage_status == 1) {
+			clif_displaymessage(fd, "Your storage is opened. Close it before.");
+			return -1;
+		}
 		storage_guild_storageopen(sd);
+	} else {
+		clif_displaymessage(fd, "You are not in a guild.");
+		return -1;
+	}
 
 	return 0;
 }

+ 2 - 4
src/map/mob.c

@@ -32,10 +32,8 @@
 
 #define MOB_LAZYMOVEPERC 50	// Move probability in the negligent mode MOB (rate of 1000 minute)
 #define MOB_LAZYWARPPERC 20	// Warp probability in the negligent mode MOB (rate of 1000 minute)
-#define MAX_MOB_DB 2000		/* Change this to increase the table size in your mob_db to accomodate
-								numbers more than 2000 for mobs if you want to (and know what you're doing).
-								Be sure to note that 4001 to 4047 are for advanced classes. */
-struct mob_db mob_db[2001];
+
+struct mob_db mob_db[MAX_MOB_DB+1];
 
 #define CLASSCHANGE_BOSS_NUM 21
 

+ 3 - 0
src/map/mob.h

@@ -4,6 +4,9 @@
 
 #define MAX_RANDOMMONSTER 3
 #define MAX_MOB_RACE_DB 6
+#define MAX_MOB_DB 2000		/* Change this to increase the table size in your mob_db to accomodate
+				numbers more than 2000 for mobs if you want to (and know what you're doing).
+				Be sure to note that 4001 to 4047 are for advanced classes. */
 
 struct mob_skill {
 	short state;