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; }
void Blood_Bag_Item_Update() { Update_Stats(6,1); Update_Stats(7,5); }
void Heart_Item_Update() { Update_Stats(6,1); Update_Stats(7,3); }
void Blue_Cap_Item_Update() { Update_Stats(6,1); Update_Stats(2,1); Update_Stats(3,-1); }
void Blood_Clot_Item_Update() { Update_Stats(1,1); Update_Stats(5,5); }