Skip to content

Commit 5216760

Browse files
committed
Don't remove file extensions from mod names.
Fixes loading of savegames with a mod, whether the mod is loaded from the command line or not. Old savegames won't work unfortunately, and savegames started with a .wz mod won't continue if that mod gets expanded later. Fixes #2735, refs #2825.
1 parent 46d716a commit 5216760

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

src/main.cpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -322,31 +322,6 @@ void addLoadedMod(const char * modname)
322322
return;
323323
}
324324
char *mod = strdup(modname);
325-
int modlen = strlen(mod);
326-
if (modlen >= 3 && strcmp(&mod[modlen-3], ".wz")==0)
327-
{
328-
// remove ".wz" from end
329-
mod[modlen-3] = 0;
330-
modlen -= 3;
331-
}
332-
if (modlen >= 4 && strcmp(&mod[modlen-4], ".cam")==0)
333-
{
334-
// remove ".cam.wz" from end
335-
mod[modlen-4] = 0;
336-
modlen -= 4;
337-
}
338-
else if (modlen >= 4 && strcmp(&mod[modlen-4], ".mod")==0)
339-
{
340-
// remove ".mod.wz" from end
341-
mod[modlen-4] = 0;
342-
modlen -= 4;
343-
}
344-
else if (modlen >= 5 && strcmp(&mod[modlen-5], ".gmod")==0)
345-
{
346-
// remove ".gmod.wz" from end
347-
mod[modlen-5] = 0;
348-
modlen -= 5;
349-
}
350325
// Yes, this is an online insertion sort.
351326
// I swear, for the numbers of mods this is going to be dealing with
352327
// (i.e. 0 to 2), it really is faster than, say, Quicksort.

0 commit comments

Comments
 (0)