mirror of
https://github.com/gwdevhub/gMod.git
synced 2026-07-18 08:29:31 +00:00
BugFix:
- remove dots, slash and backslash at the beginning of filenames in the texmod.def - selected language will now be stored - now one has to set all keys, if save single texture is set to true
This commit is contained in:
+12
-4
@@ -97,15 +97,15 @@ int OTM_File::GetContent( AddTextureClass *tex, bool add, bool force)
|
||||
wxString file_type = FileName.AfterLast( '.');
|
||||
if (file_type == L"zip")
|
||||
{
|
||||
AddZip( tex, add, true, false);
|
||||
AddZip( tex, add, force, false);
|
||||
}
|
||||
else if (file_type == L"tpf")
|
||||
{
|
||||
AddZip( tex, add, true, true);
|
||||
AddZip( tex, add, force, true);
|
||||
}
|
||||
else if (file_type == L"dds")
|
||||
{
|
||||
AddFile( tex, add, true);
|
||||
AddFile( tex, add, force);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -259,7 +259,7 @@ int OTM_File::AddFile( AddTextureClass *tex, bool add, bool force)
|
||||
|
||||
tex->Num = 1;
|
||||
tex->Add[0] = add;
|
||||
tex->Force[0] = true;
|
||||
tex->Force[0] = force;
|
||||
tex->Hash[0] = temp_hash;
|
||||
return 0;
|
||||
}
|
||||
@@ -339,6 +339,8 @@ int OTM_File::AddContent( const char* pw, AddTextureClass *tex, bool add, bool f
|
||||
file = entry.AfterFirst( '|');
|
||||
file.Replace( "\r", "");
|
||||
|
||||
while ( (file[0]=='.' && (file[1]=='/' || file[1]=='\\')) || file[0]=='/' || file[0]=='\\') file.Remove(0,1);
|
||||
|
||||
if (add)
|
||||
{
|
||||
FindZipItem( ZIP_Handle, file.wc_str(), false, &index, &ze); // look for texture
|
||||
@@ -368,6 +370,12 @@ int OTM_File::AddContent( const char* pw, AddTextureClass *tex, bool add, bool f
|
||||
count++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LastError << Language.Error_Unzip <<"\nTPF:" << file << "\n";
|
||||
CloseZip(ZIP_Handle); //somehow we need to close and to reopen the zip handle, otherwise the program crashes
|
||||
ZIP_Handle = OpenZip( FileInMemory, FileLen, pw);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user