Skip to content

Commit

Permalink
fix pack size display for large bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Jul 26, 2018
1 parent 7c50eb9 commit 0565100
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ local function makedoots(i)
end,
OnCommand=function(self)
local bundle = DLMAN:GetCoreBundle(minidoots[i]:lower())
self:settextf("(%dmb)", bundle["TotalSize"])
self:settextf("(%dMB)", bundle["TotalSize"])
end,
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ local function makedoots(i)
end,
OnCommand=function(self)
local bundle = DLMAN:GetCoreBundle(minidoots[i]:lower())
self:settextf("(%dmb)", bundle["TotalSize"])
self:settextf("(%dMB)", bundle["TotalSize"])
end
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/DownloadManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1704,13 +1704,12 @@ class LunaDownloadManager : public Luna<DownloadManager>
float avgpackdiff = 0.f;

for (auto p : bundle) {
totalsize += p->size;
totalsize += p->size / 1024 / 1024;
avgpackdiff += p->avgDifficulty;
}

if(!bundle.empty())
avgpackdiff /= bundle.size();
totalsize = totalsize / 1024 / 1024;

// this may be kind of unintuitive but lets roll with it for now -mina
lua_pushnumber(L, totalsize);
Expand Down

0 comments on commit 0565100

Please sign in to comment.