Dependencies in basemaps
This commit is contained in:
parent
1f4e59949f
commit
61b2b0c920
2
deps/fmt
vendored
2
deps/fmt
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 8c63ea432c7985eb056f1457d7edc8574d4fa2f8
|
Subproject commit 8f455c10b0f1aee898f71313b21c43b098dadb34
|
2
deps/mongoose
vendored
2
deps/mongoose
vendored
@ -1 +1 @@
|
|||||||
Subproject commit b39e30fb0cbed1b91a205903fc6f8956a9e58c32
|
Subproject commit 78454da3b311892e7426794760525cbb2f729c0b
|
@ -31,6 +31,7 @@ namespace Components
|
|||||||
|
|
||||||
Utils::Memory::Allocator allocator;
|
Utils::Memory::Allocator allocator;
|
||||||
auto teams = Maps::GetTeamsForMap(Maps::CurrentMainZone);
|
auto teams = Maps::GetTeamsForMap(Maps::CurrentMainZone);
|
||||||
|
auto dependencies = Maps::GetDependenciesForMap(Maps::CurrentMainZone);
|
||||||
|
|
||||||
std::vector<Game::XZoneInfo> data;
|
std::vector<Game::XZoneInfo> data;
|
||||||
Utils::Merge(&data, zoneInfo, zoneCount);
|
Utils::Merge(&data, zoneInfo, zoneCount);
|
||||||
@ -45,6 +46,17 @@ namespace Components
|
|||||||
team.name = allocator.DuplicateString(fmt::sprintf("iw4x_team_%s", teams.second.data()));
|
team.name = allocator.DuplicateString(fmt::sprintf("iw4x_team_%s", teams.second.data()));
|
||||||
data.push_back(team);
|
data.push_back(team);
|
||||||
|
|
||||||
|
for (auto& depdendency : dependencies)
|
||||||
|
{
|
||||||
|
Game::XZoneInfo info;
|
||||||
|
|
||||||
|
info.name = depdendency.data();
|
||||||
|
info.allocFlags = zoneInfo->allocFlags;
|
||||||
|
info.freeFlags = zoneInfo->freeFlags;
|
||||||
|
|
||||||
|
data.push_back(info);
|
||||||
|
}
|
||||||
|
|
||||||
for (unsigned int i = 0; i < Maps::CurrentDependencies.size(); ++i)
|
for (unsigned int i = 0; i < Maps::CurrentDependencies.size(); ++i)
|
||||||
{
|
{
|
||||||
Game::XZoneInfo info;
|
Game::XZoneInfo info;
|
||||||
@ -205,6 +217,26 @@ namespace Components
|
|||||||
return (Utils::String::StartsWith(entity, "dyn_") || Utils::String::StartsWith(entity, "node_") || Utils::String::StartsWith(entity, "actor_"));
|
return (Utils::String::StartsWith(entity, "dyn_") || Utils::String::StartsWith(entity, "node_") || Utils::String::StartsWith(entity, "actor_"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> Maps::GetDependenciesForMap(std::string map)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < *Game::arenaCount; ++i)
|
||||||
|
{
|
||||||
|
Game::newMapArena_t* arena = &ArenaLength::NewArenas[i];
|
||||||
|
if (arena->mapName == map)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < ARRAY_SIZE(arena->keys); ++j)
|
||||||
|
{
|
||||||
|
if (arena->keys[j] == "dependency"s)
|
||||||
|
{
|
||||||
|
return Utils::String::Explode(arena->values[j], ' ');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
std::pair<std::string, std::string> Maps::GetTeamsForMap(std::string map)
|
std::pair<std::string, std::string> Maps::GetTeamsForMap(std::string map)
|
||||||
{
|
{
|
||||||
std::string team_axis = "opforce_composite";
|
std::string team_axis = "opforce_composite";
|
||||||
@ -525,8 +557,8 @@ namespace Components
|
|||||||
//Maps::AddDependency("oilrig", "mp_subbase");
|
//Maps::AddDependency("oilrig", "mp_subbase");
|
||||||
//Maps::AddDependency("gulag", "mp_subbase");
|
//Maps::AddDependency("gulag", "mp_subbase");
|
||||||
//Maps::AddDependency("invasion", "mp_rust");
|
//Maps::AddDependency("invasion", "mp_rust");
|
||||||
Maps::AddDependency("co_hunted", "mp_storm");
|
//Maps::AddDependency("co_hunted", "mp_storm");
|
||||||
Maps::AddDependency("mp_shipment", "mp_shipment_long");
|
//Maps::AddDependency("mp_shipment", "mp_shipment_long");
|
||||||
|
|
||||||
#if defined(DEBUG) && defined(ENABLE_DXSDK)
|
#if defined(DEBUG) && defined(ENABLE_DXSDK)
|
||||||
Command::Add("dumpmap", [] (Command::Params)
|
Command::Add("dumpmap", [] (Command::Params)
|
||||||
|
@ -14,6 +14,7 @@ namespace Components
|
|||||||
static void AddDependency(std::string expression, std::string zone);
|
static void AddDependency(std::string expression, std::string zone);
|
||||||
|
|
||||||
static std::pair<std::string, std::string> GetTeamsForMap(std::string map);
|
static std::pair<std::string, std::string> GetTeamsForMap(std::string map);
|
||||||
|
static std::vector<std::string> GetDependenciesForMap(std::string map);
|
||||||
|
|
||||||
static std::string CurrentMainZone;
|
static std::string CurrentMainZone;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user