From 0f68ad394abe13e2374f84f02ac1b04e62fe406e Mon Sep 17 00:00:00 2001 From: ai4rei Date: Sat, 14 May 2011 12:07:33 +0000 Subject: * Moved bitfield 'boss' inside 'spawn_data' and 'mob_data' into the respective state struct (from r13813, follow up to r14795). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14818 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 1 + src/map/map.c | 2 +- src/map/map.h | 8 ++++---- src/map/mob.c | 2 +- src/map/mob.h | 2 +- src/map/npc.c | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 36f76ad0a..c0dbefd1e 100644 --- a/Changelog-Trunk.txt +++ b/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). diff --git a/src/map/map.c b/src/map/map.c index 762cf1446..c086b73c0 100644 --- a/src/map/map.c +++ b/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); } diff --git a/src/map/map.h b/src/map/map.h index 3241efea1..f1e7e49b3 100644 --- a/src/map/map.h +++ b/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 }; diff --git a/src/map/mob.c b/src/map/mob.c index 0a99b83b1..4c8fa685a 100644 --- a/src/map/mob.c +++ b/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) diff --git a/src/map/mob.h b/src/map/mob.h index 6658c96d3..605439f12 100644 --- a/src/map/mob.h +++ b/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; diff --git a/src/map/npc.c b/src/map/npc.c index c5c18aea0..d070b6886 100644 --- a/src/map/npc.c +++ b/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=,,,, // w4=,,,, -- cgit v1.2.3-70-g09d2