Slightly better CODO zone dumping and reordering maps in Maps.cpp

This commit is contained in:
Louvenarde 2023-10-21 19:36:20 +02:00
parent 01a1567173
commit 00b7332044
2 changed files with 25 additions and 10 deletions

View File

@ -204,8 +204,7 @@ namespace Components
void Maps::LoadAssetRestrict(Game::XAssetType type, Game::XAssetHeader asset, const std::string& name, bool* restrict)
{
if (std::find(Maps::CurrentDependencies.begin(), Maps::CurrentDependencies.end(), FastFiles::Current()) != Maps::CurrentDependencies.end()
&& (FastFiles::Current() != "mp_shipment_long" || Maps::CurrentMainZone != "mp_shipment")) // Shipment is a special case
if (std::find(Maps::CurrentDependencies.begin(), Maps::CurrentDependencies.end(), FastFiles::Current()) != Maps::CurrentDependencies.end())
{
switch (type)
{
@ -321,12 +320,6 @@ namespace Components
format = "maps/%s.d3dbsp";
}
// TODO: Remove this hack by using CoD4 version of the map
if (std::strcmp(mapname, "mp_shipment") == 0)
{
mapname = "mp_shipment_long";
}
_snprintf_s(buffer, size, _TRUNCATE, format, mapname);
}
@ -759,8 +752,8 @@ namespace Components
Maps::AddDlc({ 1, "Stimulus Pack", {"mp_complex", "mp_compact", "mp_storm", "mp_overgrown", "mp_crash"} });
Maps::AddDlc({ 2, "Resurgence Pack", {"mp_abandon", "mp_vacant", "mp_trailerpark", "mp_strike", "mp_fuel2"} });
Maps::AddDlc({ 3, "IW4x Classics", {"mp_nuked", "mp_cross_fire", "mp_cargoship", "mp_bloc", "mp_killhouse", "mp_bog_sh", "mp_cargoship_sh", "mp_shipment", "mp_shipment_long", "mp_rust_long", "mp_firingrange", "mp_bloc_sh", "mp_crash_tropical", "mp_estate_tropical", "mp_fav_tropical", "mp_storm_spring"} });
Maps::AddDlc({ 4, "Call Of Duty 4 Pack", {"mp_farm", "mp_backlot", "mp_pipeline", "mp_countdown", "mp_crash_snow", "mp_carentan", "mp_broadcast", "mp_showdown", "mp_convoy", "mp_citystreets"} });
Maps::AddDlc({ 3, "IW4x Classics", {"mp_nuked", "mp_cargoship_sh", "mp_shipment_long", "mp_rust_long", "mp_firingrange", "mp_bloc_sh", "mp_crash_tropical", "mp_estate_tropical", "mp_fav_tropical", "mp_storm_spring"} });
Maps::AddDlc({ 4, "Call Of Duty 4 Pack", {"mp_farm","mp_crossfire", "mp_cargoship", "mp_bloc", "mp_killhouse", "mp_shipment", "mp_bog", "mp_backlot", "mp_pipeline", "mp_countdown", "mp_crash_snow", "mp_carentan", "mp_broadcast", "mp_showdown", "mp_convoy", "mp_citystreets"} });
Maps::AddDlc({ 5, "Modern Warfare 3 Pack", {"mp_dome", "mp_hardhat", "mp_paris", "mp_seatown", "mp_bravo", "mp_underground", "mp_plaza2", "mp_village", "mp_alpha"}});
Maps::UpdateDlcStatus();

View File

@ -1267,8 +1267,30 @@ namespace Components
if (!ZoneBuilder::DumpingZone.empty())
{
Utils::Memory::Allocator allocator{};
if (Zones::Version() >= VERSION_ALPHA2)
{
if (type == Game::XAssetType::ASSET_TYPE_CLIPMAP_SP)
{
return;
}
if (type == Game::XAssetType::ASSET_TYPE_GAMEWORLD_MP)
{
return;
}
else if (type == Game::XAssetType::ASSET_TYPE_GAMEWORLD_SP)
{
type = Game::XAssetType::ASSET_TYPE_GAMEWORLD_MP;
asset.gameWorldMp->g_glassData = asset.gameWorldSp->g_glassData;
}
}
if (ExporterAPI.is_type_supported(type) && name[0] != ',')
{
std::ofstream csv(std::format("{}.csv", ZoneBuilder::DumpingZone), std::ios::app | std::ios::binary);
csv << Game::DB_GetXAssetTypeName(type) << "," << name << "\n";
ExporterAPI.write(type, asset.data);
Components::Logger::Print(".");
}