Skip to content

Commit 8df894c

Browse files
committed
My diff is a clusterfuck and I have a stack overflow AAAAAAAAAAAAAAAAAAAAAAAAAAAA
1 parent ca30a46 commit 8df894c

File tree

4 files changed

+7
-34
lines changed

4 files changed

+7
-34
lines changed

Managers/ModuleMan.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,6 @@ namespace RTE {
211211
}
212212

213213

214-
215-
216-
217-
218-
219-
220-
221214
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
222215

223216
void ModuleMan::LoadOfficialModules() {
@@ -231,7 +224,7 @@ namespace RTE {
231224
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
232225

233226
bool ModuleMan::LoadAllDataModules() {
234-
// Destroy any possible loaded modules
227+
// Destroy any possible loaded modules.
235228
Destroy();
236229

237230
LoadOfficialModules();

Managers/ModuleMan.h

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@ namespace RTE {
4242
/// Gets the total number of modules loaded so far, official or not.
4343
/// </summary>
4444
/// <returns>The number of modules loaded so far, both official and non.</returns>
45-
size_t GetTotalModuleCount() const { return m_LoadedDataModules.size(); }
46-
47-
48-
49-
45+
int GetTotalModuleCount() const { return m_LoadedDataModules.size(); }
5046

5147

5248

@@ -101,8 +97,7 @@ namespace RTE {
10197
/// </summary>
10298
/// <param name="whichModule">The ID of the module to get.</param>
10399
/// <returns>The requested DataModule. Ownership is NOT transferred!</returns>
104-
const DataModule * GetDataModule(int whichModule = 0);
105-
100+
DataModule * GetDataModule(int whichModule = 0);
106101

107102

108103

@@ -150,18 +145,6 @@ namespace RTE {
150145
/// <returns>The complete path to the file, including Data/, Userdata/ or Mods/ based on whether or not it's part of an official module or userdata.</returns>
151146
std::string GetFullModulePath(const std::string &modulePath) const;
152147

153-
154-
155-
156-
157-
158-
159-
160-
161-
162-
163-
164-
165148
#pragma endregion
166149

167150
#pragma region Contrete Methods
@@ -196,9 +179,8 @@ namespace RTE {
196179

197180
#pragma region Module Loading Breakdown
198181
/// <summary>
199-
///
182+
/// Loads all the official DataModules individually with LoadDataModule.
200183
/// </summary>
201-
/// <returns></returns>
202184
void LoadOfficialModules();
203185

204186
/// <summary>

Managers/PresetMan.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ namespace RTE {
1919

2020
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2121

22-
void PresetMan::RegisterGroup(const std::string &newGroup, int whichModule) {
23-
RTEAssert(whichModule >= 0 && whichModule < g_ModuleMan.GetTotalModuleCount(), "Tried to access an out of bounds data module number!");
24-
25-
g_ModuleMan.GetLoadedDataModules()[whichModule]->RegisterGroup(newGroup);
22+
void PresetMan::RegisterGroup(const std::string &newGroup, int whichModule) const {
23+
g_ModuleMan.GetDataModule(whichModule)->RegisterGroup(newGroup);
2624
}
2725

2826
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Managers/PresetMan.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace RTE {
4040
/// </summary>
4141
/// <param name="groupName">The group to register.</param>
4242
/// <param name="whichModule">The ID of the module in which at least one Entity of this group can be found.</param>
43-
void RegisterGroup(const std::string &groupName, int whichModule);
43+
void RegisterGroup(const std::string &groupName, int whichModule) const;
4444

4545
/// <summary>
4646
/// Fills out a list with all groups registered in a specific module.

0 commit comments

Comments
 (0)