소스 검색

- Fixed one missed malloc->aMallocA typo, causing memory deallocation problems
- Some small trunk-stable formatting synchronization

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

ultramage 18 년 전
부모
커밋
4228b025e7
5개의 변경된 파일8개의 추가작업 그리고 13개의 파일을 삭제
  1. 1 1
      src/common/grfio.c
  2. 1 3
      src/map/atcommand.c
  3. 3 4
      src/map/map.h
  4. 1 3
      src/map/script.c
  5. 2 2
      src/map/unit.c

+ 1 - 1
src/common/grfio.c

@@ -445,7 +445,7 @@ void* grfio_reads(char* fname, int* size)
 				lentry.declen = ftell(in);
 			}
 			fseek(in,0,SEEK_SET);
-			buf2 = (unsigned char *)malloc(lentry.declen + 1024);
+			buf2 = (unsigned char *)aMallocA(lentry.declen + 1024);
 			fread(buf2, 1, lentry.declen, in);
 			fclose(in);
 			strncpy(lentry.fn, fname, sizeof(lentry.fn) - 1);

+ 1 - 3
src/map/atcommand.c

@@ -9301,9 +9301,7 @@ int atcommand_request(const int fd, struct map_session_data* sd, const char* com
 /*==========================================
  * Feel (SG save map) Reset [HiddenDragon]
  *------------------------------------------*/
-int atcommand_feelreset(
-	const int fd, struct map_session_data* sd,
-	const char* command, const char* message)
+int atcommand_feelreset(const int fd, struct map_session_data* sd, const char* command, const char* message)
 {
 	pc_resetfeel(sd);
 	clif_displaymessage(fd, "Reset 'Feeling' maps.");

+ 3 - 4
src/map/map.h

@@ -38,7 +38,6 @@
 #define LIFETIME_FLOORITEM 60
 #define DAMAGELOG_SIZE 30
 #define LOOTITEM_SIZE 10
-//#define MAX_STATUSCHANGE 300
 //Quick defines to know which are the min-max common ailments. [Skotlex]
 //Because of the way the headers are included.. these must be replaced for actual values.
 //Remember to update as needed! Min is SC_STONE and max is SC_DPOISON currently.
@@ -1033,9 +1032,9 @@ struct pet_data {
 
 // state of a single attack attempt; used in flee/def penalty calculations when mobbed
 enum {
-	ATK_LUCKY=1,	// attack was lucky-dodged
-	ATK_FLEE,		// attack was dodged
-	ATK_DEF			// attack connected
+	ATK_LUCKY=1, // attack was lucky-dodged
+	ATK_FLEE,    // attack was dodged
+	ATK_DEF      // attack connected
 };
 
 struct map_data {

+ 1 - 3
src/map/script.c

@@ -2375,7 +2375,7 @@ int isstr(struct script_data *c)
 	return 0;
 }
 
-/// Triary operators
+/// Ternary operators
 /// test ? if_true : if_false
 void op_3(struct script_state* st, int op)
 {
@@ -3825,9 +3825,7 @@ BUILDIN_FUNC(sleep);
 BUILDIN_FUNC(sleep2);
 BUILDIN_FUNC(awake);
 BUILDIN_FUNC(getvariableofnpc);
-// [blackhole89] -->
 BUILDIN_FUNC(warpportal);
-// <-- [blackhole89]
 BUILDIN_FUNC(homunculus_evolution) ;	//[orn]
 BUILDIN_FUNC(eaclass);
 BUILDIN_FUNC(roclass);

+ 2 - 2
src/map/unit.c

@@ -1546,7 +1546,7 @@ static int unit_counttargeted_sub(struct block_list* bl, va_list ap)
 
 /*==========================================
  * Counts the number of units attacking 'bl'
-  *------------------------------------------*/
+ *------------------------------------------*/
 int unit_counttargeted(struct block_list* bl, int target_lv)
 {
 	nullpo_retr(0, bl);
@@ -1784,7 +1784,7 @@ int unit_free(struct block_list *bl, int clrtype)
 					status_change_end(bl,SC_REGENERATION,-1);
 			}
 			if (battle_config.debuff_on_logout&2)
-			{	//Food items are removed on logout.
+			{
 				if(sd->sc.data[SC_MAXIMIZEPOWER].timer!=-1)
 					status_change_end(bl,SC_MAXIMIZEPOWER,-1);
 				if(sd->sc.data[SC_MAXOVERTHRUST].timer!=-1)