Beispiel #1
0
	void CFile::Load_Cache() {
		
		// Are we loaded?
		if( Cache_Loaded() ) {
			DLog(LOG_FS, "Calling CFile::Load_Cache() with cache already loaded\n");
			return;
		}
		
		// sanity check
		if( m_pData ) {
			// wtf
			free( m_pData );
			m_pData = NULL;
		}
		
		
		// Update stats to ensure correct size
		Update_Stats();
		
		// Allocate and read data
		int fd = open( m_sFullPath.c_str(), O_RDONLY);
		if( fd != -1 ) {
			m_pData = (uint8_t*)calloc(m_Size, 1);
			if(read(fd, m_pData, m_Size) != m_Size) {
				DLog(LOG_FS, "read() did not return m_Size in CFile::Reload_From_Disk()\n");
				close(fd);
				free(m_pData);
				m_pData = NULL;
				m_CacheLoaded = false;
				
				return;
			}
			close(fd);
		}
		
		m_CacheLoaded = true;
	}
Beispiel #2
0
void Blood_Bag_Item_Update()
{
	Update_Stats(6,1);
	Update_Stats(7,5);
}
Beispiel #3
0
void Heart_Item_Update()
{
	Update_Stats(6,1);
	Update_Stats(7,3);
}
Beispiel #4
0
void Blue_Cap_Item_Update()
{
	Update_Stats(6,1);
	Update_Stats(2,1);
	Update_Stats(3,-1);
}
Beispiel #5
0
void Blood_Clot_Item_Update()
{
	Update_Stats(1,1);
	Update_Stats(5,5);
}