mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
- Renamed ClearExtraGameMsgFiles function to ClearReadExtraGameMsgFiles.
- Moved ClearReadExtraGameMsgFiles function to Message.cpp. - Added map clearing to ClearReadExtraGameMsgFiles. - Changed formatting.
This commit is contained in:
+14
-6
@@ -94,8 +94,7 @@ char* GetMsg(MSGList *MsgList, DWORD msgRef, int msgNum) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ReadExtraGameMsgFiles()
|
||||
{
|
||||
void ReadExtraGameMsgFiles() {
|
||||
int read;
|
||||
std::string names;
|
||||
|
||||
@@ -115,12 +114,10 @@ void ReadExtraGameMsgFiles()
|
||||
int end;
|
||||
int length;
|
||||
|
||||
while ((end = names.find_first_of(',', begin)) != std::string::npos)
|
||||
{
|
||||
while ((end = names.find_first_of(',', begin)) != std::string::npos) {
|
||||
length = end - begin;
|
||||
|
||||
if (length > 0)
|
||||
{
|
||||
if (length > 0) {
|
||||
std::string path = "game\\" + names.substr(begin, length) + ".msg";
|
||||
MSGList* list = new MSGList;
|
||||
|
||||
@@ -133,3 +130,14 @@ void ReadExtraGameMsgFiles()
|
||||
begin = end + 1;
|
||||
}
|
||||
}
|
||||
|
||||
void ClearReadExtraGameMsgFiles() {
|
||||
std::tr1::unordered_map<int, MSGList*>::iterator it;
|
||||
|
||||
for (it = gExtraGameMsgLists.begin(); it != gExtraGameMsgLists.end(); ++it) {
|
||||
DestroyMsgList(it->second);
|
||||
delete it->second;
|
||||
}
|
||||
|
||||
gExtraGameMsgLists.clear();
|
||||
}
|
||||
+2
-1
@@ -54,4 +54,5 @@ int DestroyMsgList(MSGList *MsgList);
|
||||
//bool GetMsg(MSGList *MsgList, MSGNode *MsgNode, DWORD msgRef);
|
||||
MSGNode *GetMsgNode(MSGList *MsgList, DWORD msgRef);
|
||||
char* GetMsg(MSGList *MsgList, DWORD msgRef, int msgNum);
|
||||
void ReadExtraGameMsgFiles();
|
||||
void ReadExtraGameMsgFiles();
|
||||
void ClearReadExtraGameMsgFiles();
|
||||
+1
-12
@@ -1543,19 +1543,8 @@ static void DllMain2() {
|
||||
dlogr("Leave DllMain2", DL_MAIN);
|
||||
}
|
||||
|
||||
void ClearExtraGameMsgFiles()
|
||||
{
|
||||
std::tr1::unordered_map<int, MSGList*>::iterator it;
|
||||
|
||||
for (it = gExtraGameMsgLists.begin(); it != gExtraGameMsgLists.end(); ++it)
|
||||
{
|
||||
DestroyMsgList(it->second);
|
||||
delete it->second;
|
||||
}
|
||||
}
|
||||
|
||||
static void _stdcall OnExit() {
|
||||
ClearExtraGameMsgFiles();
|
||||
ClearReadExtraGameMsgFiles();
|
||||
ConsoleExit();
|
||||
AnimationsAtOnceExit();
|
||||
HeroAppearanceModExit();
|
||||
|
||||
Reference in New Issue
Block a user