فهرست منبع

* Moved bitfield 'boss' inside 'spawn_data' and 'mob_data' into the respective state struct (from r13813, follow up to r14795).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14818 54d463be-8e91-2dee-dedb-b68131a5f0ec
ai4rei 14 سال پیش
والد
کامیت
600e9e8320
6فایلهای تغییر یافته به همراه9 افزوده شده و 8 حذف شده
  1. 1 0
      Changelog-Trunk.txt
  2. 1 1
      src/map/map.c
  3. 4 4
      src/map/map.h
  4. 1 1
      src/map/mob.c
  5. 1 1
      src/map/mob.h
  6. 1 1
      src/map/npc.c

+ 1 - 0
Changelog-Trunk.txt

@@ -1,6 +1,7 @@
 Date	Added
 
 2011/05/14
+	* Moved bitfield 'boss' inside 'spawn_data' and 'mob_data' into the respective state struct (from r13813, follow up to r14795). [Ai4rei]
 	* Some NPC event related cleaning. [Ai4rei]
 	- Made event label deprecation message a warning rather than an error, as the scripts still work regardless of whether '::On' is used or not (since r6592).
 	- Introduced constant EVENT_NAME_LENGTH (51) for all event name struct fields to eliminate size inconsistency across all objects (was 50 and 51).

+ 1 - 1
src/map/map.c

@@ -1509,7 +1509,7 @@ void map_addiddb(struct block_list *bl)
 		TBL_MOB* md = (TBL_MOB*)bl;
 		idb_put(mobid_db,bl->id,bl);
 
-		if( md->boss )
+		if( md->state.boss )
 			idb_put(bossid_db, bl->id, bl);
 	}
 

+ 4 - 4
src/map/map.h

@@ -259,16 +259,16 @@ struct block_list {
 // Expanded to specify all mob-related spawn data by [Skotlex]
 struct spawn_data {
 	short class_; //Class, used because a mob can change it's class
-	unsigned boss : 1;
 	unsigned short m,x,y;	//Spawn information (map, point, spawn-area around point)
 	signed short xs,ys;
 	unsigned short num; //Number of mobs using this structure
 	unsigned short active; //Number of mobs that are already spawned (for mob_remove_damaged: no)
 	unsigned int delay1,delay2; //Min delay before respawning after spawn/death
 	struct {
-		unsigned size :2; //Holds if mob has to be tiny/large
-		unsigned ai :2;	//Holds if mob is special ai.
-		unsigned dynamic :1; //Whether this data is indexed by a map's dynamic mob list
+		unsigned int size :2; //Holds if mob has to be tiny/large
+		unsigned int ai :2;	//Holds if mob is special ai.
+		unsigned int dynamic :1; //Whether this data is indexed by a map's dynamic mob list
+		unsigned int boss : 1;
 	} state;
 	char name[NAME_LENGTH],eventname[EVENT_NAME_LENGTH]; //Name/event
 };

+ 1 - 1
src/map/mob.c

@@ -216,7 +216,7 @@ struct mob_data* mob_spawn_dataset(struct spawn_data *data)
 	md->bl.x = data->x;
 	md->bl.y = data->y;
 	md->class_ = data->class_;
-	md->boss = data->boss;
+	md->state.boss = data->state.boss;
 	md->db = mob_db(md->class_);
 	memcpy(md->name, data->name, NAME_LENGTH);
 	if (data->state.ai)

+ 1 - 1
src/map/mob.h

@@ -128,6 +128,7 @@ struct mob_data {
 		unsigned int spotted: 1;
 		unsigned int npc_killmonster: 1; //for new killmonster behavior
 		unsigned int rebirth: 1; // NPC_Rebirth used
+		unsigned int boss : 1;
 		enum MobSkillState skillstate;
 		unsigned char steal_flag; //number of steal tries (to prevent steal exploit on mobs with few items) [Lupus]
 		unsigned char attacked_count; //For rude attacked.
@@ -143,7 +144,6 @@ struct mob_data {
 	int spawn_timer; //Required for Convex Mirror
 	struct item *lootitem;
 	short class_;
-	unsigned boss : 1;
 	unsigned int tdmg; //Stores total damage given to the mob, for exp calculations. [Skotlex]
 	int level;
 	int target_id,attacked_id;

+ 1 - 1
src/map/npc.c

@@ -2705,7 +2705,7 @@ static const char* npc_parse_mob(char* w1, char* w2, char* w3, char* w4, const c
 
 	memset(&mob, 0, sizeof(struct spawn_data));
 
-	mob.boss = !strcmpi(w2,"boss_monster");
+	mob.state.boss = !strcmpi(w2,"boss_monster");
 
 	// w1=<map name>,<x>,<y>,<xs>,<ys>
 	// w4=<mob id>,<amount>,<delay1>,<delay2>,<event>