Commit b2d01a8f authored by edo9300's avatar edo9300

added the possibility for a negative original level

parent b1419e61
......@@ -32,7 +32,12 @@ bool DataManager::LoadDB(const char* file) {
cd.attack = sqlite3_column_int(pStmt, 5);
cd.defense = sqlite3_column_int(pStmt, 6);
unsigned int level = sqlite3_column_int(pStmt, 7);
cd.level = level & 0xff;
if((level & 0x80000000) != 0) {
level = -level;
cd.level = -(level & 0xff);
}
else
cd.level = level & 0xff;
cd.lscale = (level >> 24) & 0xff;
cd.rscale = (level >> 16) & 0xff;
cd.race = sqlite3_column_int(pStmt, 8);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment