Code to reproduce problem:
Code: Select all
#include <cstdlib>
#include <iostream>
#include <IRR/irrlicht.h>
using namespace irr;
using namespace io;
int main() {
IrrlichtDevice *device=createDevice(video::EDT_OPENGL, core::dimension2d<u32>(512,512),16,false, false, false);
IFileSystem *fs=device->getFileSystem();
std::cout<<"archives : "<<fs->getFileArchiveCount()<<std::endl;
std::cout<<"Adding an archive : "<<fs->addFileArchive("test.zip")<<std::endl;
std::cout<<"archives : "<<fs->getFileArchiveCount()<<std::endl;
std::cout<<"Removing an archive : "<<fs->removeFileArchive("test.zip")<<std::endl;
std::cout<<"archives : "<<fs->getFileArchiveCount()<<std::endl;
device->drop();
system("PAUSE");
return(0);
}
Code: Select all
archives : 0
Adding an archive : 1
archives : 1
Removing an archive : 0
archives : 1
To remove this problem just change the following :
in CFileSystem.cpp, line 842:
from:
Code: Select all
if (filename == FileArchives[i]->getFileList()->getPath())
Code: Select all
if (getAbsolutePath(filename) == FileArchives[i]->getFileList()->getPath())
Code: Select all
//! removes an archive from the file system.
bool CFileSystem::removeFileArchive(const io::path& filename)
{
for (u32 i=0; i < FileArchives.size(); ++i)
{
if (filename == FileArchives[i]->getFileList()->getPath())
return removeFileArchive(i);
}
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return false;
}