Core: Append single character to stream as character, not as a string

This commit is contained in:
Spp-
2011-07-29 14:18:28 +02:00
parent 06b46ba203
commit e47b96af3e
70 changed files with 432 additions and 424 deletions
@@ -144,12 +144,10 @@ public:
// TODO: Find better way to handle emote
// Emote
std::string *emote = new std::string(EMOTE_FOCUSES_ON);
emote->append(target->GetName());
emote->append("!");
const char* text = emote->c_str();
me->MonsterTextEmote(text, 0, true);
delete emote;
std::string emote(EMOTE_FOCUSES_ON);
emote.append(target->GetName());
emote.push_back('!');
me->MonsterTextEmote(emote.c_str(), 0, true);
}
FocusFire_Timer = 15000+(rand()%5000);
} else FocusFire_Timer -= diff;
@@ -167,8 +167,8 @@ public:
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
<< m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4];
saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' '
<< m_auiEncounter[2] << ' ' << m_auiEncounter[3] << ' ' << m_auiEncounter[4];
str_data = saveStream.str();
@@ -284,10 +284,10 @@ public:
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
<< m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]
<< " " << m_auiEncounter[5] << " " << m_auiEncounter[6] << " " << m_auiEncounter[7]
<< " " << m_auiEncounter[8];
saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' '
<< m_auiEncounter[2] << ' ' << m_auiEncounter[3] << ' ' << m_auiEncounter[4]
<< ' ' << m_auiEncounter[5] << ' ' << m_auiEncounter[6] << ' ' << m_auiEncounter[7]
<< ' ' << m_auiEncounter[8];
str_data = saveStream.str();
@@ -383,8 +383,8 @@ class instance_serpent_shrine : public InstanceMapScript
{
OUT_SAVE_INST_DATA;
std::ostringstream stream;
stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " "
<< m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " << TrashCount;
stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' '
<< m_auiEncounter[3] << ' ' << m_auiEncounter[4] << ' ' << m_auiEncounter[5] << ' ' << TrashCount;
OUT_SAVE_INST_DATA_COMPLETE;
return stream.str();
}
@@ -200,7 +200,7 @@ public:
{
OUT_SAVE_INST_DATA;
std::ostringstream stream;
stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3];
stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3];
char* out = new char[stream.str().length() + 1];
strcpy(out, stream.str().c_str());
if (out)
@@ -100,9 +100,12 @@ public:
{
case 184468:
MaulgarDoor = go->GetGUID();
if (m_auiEncounter[0] == DONE) HandleGameObject(0, true, go);
if (m_auiEncounter[0] == DONE)
HandleGameObject(0, true, go);
break;
case 184662:
GruulDoor = go->GetGUID();
break;
case 184662: GruulDoor = go->GetGUID(); break;
}
}
@@ -159,7 +162,7 @@ public:
{
OUT_SAVE_INST_DATA;
std::ostringstream stream;
stream << m_auiEncounter[0] << " " << m_auiEncounter[1];
stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1];
char* out = new char[stream.str().length() + 1];
strcpy(out, stream.str().c_str());
if (out)
@@ -94,44 +94,49 @@ class instance_blood_furnace : public InstanceMapScript
{
switch(creature->GetEntry())
{
case 17381: The_MakerGUID = creature->GetGUID(); break;
case 17380: BroggokGUID = creature->GetGUID(); break;
case 17377: Kelidan_The_BreakerGUID = creature->GetGUID(); break;
case 17381:
The_MakerGUID = creature->GetGUID();
break;
case 17380:
BroggokGUID = creature->GetGUID();
break;
case 17377:
Kelidan_The_BreakerGUID = creature->GetGUID();
break;
}
}
void OnGameObjectCreate(GameObject* go)
{
if (go->GetEntry() == 181766) //Final exit door
Door1GUID = go->GetGUID();
if (go->GetEntry() == 181811) //The Maker Front door
Door2GUID = go->GetGUID();
if (go->GetEntry() == 181812) //The Maker Rear door
Door3GUID = go->GetGUID();
if (go->GetEntry() == 181822) //Broggok Front door
Door4GUID = go->GetGUID();
if (go->GetEntry() == 181819) //Broggok Rear door
Door5GUID = go->GetGUID();
if (go->GetEntry() == 181823) //Kelidan exit door
Door6GUID = go->GetGUID();
if (go->GetEntry() == 181766) //Final exit door
Door1GUID = go->GetGUID();
if (go->GetEntry() == 181811) //The Maker Front door
Door2GUID = go->GetGUID();
if (go->GetEntry() == 181812) //The Maker Rear door
Door3GUID = go->GetGUID();
if (go->GetEntry() == 181822) //Broggok Front door
Door4GUID = go->GetGUID();
if (go->GetEntry() == 181819) //Broggok Rear door
Door5GUID = go->GetGUID();
if (go->GetEntry() == 181823) //Kelidan exit door
Door6GUID = go->GetGUID();
if (go->GetEntry() == 181813) //The Maker prison cell front right
PrisonCell1GUID = go->GetGUID();
if (go->GetEntry() == 181814) //The Maker prison cell back right
PrisonCell2GUID = go->GetGUID();
if (go->GetEntry() == 181816) //The Maker prison cell front left
PrisonCell3GUID = go->GetGUID();
if (go->GetEntry() == 181815) //The Maker prison cell back left
PrisonCell4GUID = go->GetGUID();
if (go->GetEntry() == 181821) //Broggok prison cell front right
PrisonCell5GUID = go->GetGUID();
if (go->GetEntry() == 181818) //Broggok prison cell back right
PrisonCell6GUID = go->GetGUID();
if (go->GetEntry() == 181820) //Broggok prison cell front left
PrisonCell7GUID = go->GetGUID();
if (go->GetEntry() == 181817) //Broggok prison cell back left
PrisonCell8GUID = go->GetGUID();
if (go->GetEntry() == 181813) //The Maker prison cell front right
PrisonCell1GUID = go->GetGUID();
if (go->GetEntry() == 181814) //The Maker prison cell back right
PrisonCell2GUID = go->GetGUID();
if (go->GetEntry() == 181816) //The Maker prison cell front left
PrisonCell3GUID = go->GetGUID();
if (go->GetEntry() == 181815) //The Maker prison cell back left
PrisonCell4GUID = go->GetGUID();
if (go->GetEntry() == 181821) //Broggok prison cell front right
PrisonCell5GUID = go->GetGUID();
if (go->GetEntry() == 181818) //Broggok prison cell back right
PrisonCell6GUID = go->GetGUID();
if (go->GetEntry() == 181820) //Broggok prison cell front left
PrisonCell7GUID = go->GetGUID();
if (go->GetEntry() == 181817) //Broggok prison cell back left
PrisonCell8GUID = go->GetGUID();
}
uint64 GetData64(uint32 data)
@@ -174,7 +179,7 @@ class instance_blood_furnace : public InstanceMapScript
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2];
saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2];
str_data = saveStream.str();
@@ -165,7 +165,7 @@ class instance_the_eye : public InstanceMapScript
{
OUT_SAVE_INST_DATA;
std::ostringstream stream;
stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3];
stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3];
char* out = new char[stream.str().length() + 1];
strcpy(out, stream.str().c_str());
if (out)