mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 07:37:03 +00:00
[6828] Added script name indexing for creature, gameobject, item, areatrigger and instance scripts.
* loaded all distinct script names into one vector at server startup * added custom loaders to convert the script names to indices * converted all the script lookup functions to use the index instead of the name
This commit is contained in:
parent
074bd3a08f
commit
766654c85d
16 changed files with 184 additions and 101 deletions
|
|
@ -66,24 +66,12 @@ struct Script
|
|||
bool (*pItemUse )(Player *player, Item* _Item, SpellCastTargets const& targets);
|
||||
|
||||
CreatureAI* (*GetAI)(Creature *_Creature);
|
||||
InstanceData* (*GetInstanceData)(Map*);
|
||||
// -----------------------------------------
|
||||
|
||||
|
||||
void registerSelf();
|
||||
};
|
||||
|
||||
class InstanceDataScript
|
||||
{
|
||||
public:
|
||||
InstanceDataScript() : GetInstanceData(NULL) {};
|
||||
|
||||
std::string name;
|
||||
InstanceData* (*GetInstanceData)(Map *_Map);
|
||||
};
|
||||
|
||||
extern int nrscripts;
|
||||
extern Script *m_scripts[MAX_SCRIPTS];
|
||||
extern InstanceDataScript *m_instance_scripts[MAX_INSTANCE_SCRIPTS];
|
||||
extern int num_inst_scripts;
|
||||
|
||||
#define VISIBLE_RANGE (50.0f)
|
||||
|
||||
struct MANGOS_DLL_DECL ScriptedAI : public CreatureAI
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue