Skip to content

Commit

Permalink
[sd2_mr0570] Simplify script naming
Browse files Browse the repository at this point in the history
  • Loading branch information
boxa committed Mar 9, 2013
1 parent 38d9ee6 commit 7d0b7a3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions ScriptMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,17 +330,17 @@ void DoOrSimulateScriptTextForMap(int32 iTextEntry, uint32 uiCreatureEntry, Map*

void Script::RegisterSelf(bool bReportError)
{
if (uint32 id = GetScriptId(Name.c_str()))
if (uint32 id = GetScriptId(Name))
{
m_scripts->at(id) = this;
++num_sc_scripts;
}
else
{
if (bReportError)
script_error_log("Script registering but ScriptName %s is not assigned in database. Script will not be used.", Name.c_str());
script_error_log("Script registering but ScriptName %s is not assigned in database. Script will not be used.", Name);

m_scriptStorage->insert(std::make_pair(Name.c_str(), this));
m_scriptStorage->insert(std::make_pair(Name, this));
}
}

Expand Down
4 changes: 2 additions & 2 deletions ScriptMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ enum EscortFaction

struct Script
{
Script() :
Script(const char* scriptName = NULL) : Name(scriptName),
pGossipHello(NULL), pGossipHelloGO(NULL), pGossipSelect(NULL), pGossipSelectGO(NULL),
pGossipSelectWithCode(NULL), pGossipSelectGOWithCode(NULL),
pDialogStatusNPC(NULL), pDialogStatusGO(NULL),
Expand All @@ -73,7 +73,7 @@ struct Script
GetAI(NULL), GetInstanceData(NULL)
{}

std::string Name;
const char* Name;

bool (*pGossipHello )(Player*, Creature*);
bool (*pGossipHelloGO )(Player*, GameObject*);
Expand Down
2 changes: 1 addition & 1 deletion sd2_revision_R2.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __SD2_REVISION_R2_H__
#define __SD2_REVISION_R2_H__
#define SD2_REVISION_R2 "0569"
#define SD2_REVISION_R2 "0570"
#endif // __SD2_REVISION_R2_H__

0 comments on commit 7d0b7a3

Please sign in to comment.