|
@@ -95,6 +95,7 @@ static DBMap *npc_path_db;
|
|
|
|
|
|
//For holding the view data of npc classes. [Skotlex]
|
|
|
static struct view_data npc_viewdb[MAX_NPC_CLASS];
|
|
|
+static struct view_data npc_viewdb2[MAX_NPC_CLASS2_END-MAX_NPC_CLASS2_START];
|
|
|
|
|
|
static struct script_event_s
|
|
|
{ //Holds pointers to the commonly executed scripts for speedup. [Skotlex]
|
|
@@ -107,8 +108,13 @@ struct view_data* npc_get_viewdata(int class_)
|
|
|
{ //Returns the viewdata for normal npc classes.
|
|
|
if( class_ == INVISIBLE_CLASS )
|
|
|
return &npc_viewdb[0];
|
|
|
- if (npcdb_checkid(class_) || class_ == WARP_CLASS)
|
|
|
- return &npc_viewdb[class_];
|
|
|
+ if (npcdb_checkid(class_) || class_ == WARP_CLASS){
|
|
|
+ if( class_ > MAX_NPC_CLASS2_START ){
|
|
|
+ return &npc_viewdb2[class_-MAX_NPC_CLASS2_START];
|
|
|
+ }else{
|
|
|
+ return &npc_viewdb[class_];
|
|
|
+ }
|
|
|
+ }
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
@@ -3857,6 +3863,8 @@ int do_init_npc(void)
|
|
|
npc_viewdb[0].class_ = INVISIBLE_CLASS; //Invisible class is stored here.
|
|
|
for( i = 1; i < MAX_NPC_CLASS; i++ )
|
|
|
npc_viewdb[i].class_ = i;
|
|
|
+ for( i = MAX_NPC_CLASS2_START; i < MAX_NPC_CLASS2_END; i++ )
|
|
|
+ npc_viewdb2[i - MAX_NPC_CLASS2_START].class_ = i;
|
|
|
|
|
|
ev_db = strdb_alloc((DBOptions)(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA),2*NAME_LENGTH+2+1);
|
|
|
npcname_db = strdb_alloc(DB_OPT_BASE,NAME_LENGTH);
|