Skip to content

Fix visionsetpain in _load_5x.gsc #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/module/asset_dumpers/iscriptfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,12 @@ namespace asset_dumpers
{
// Specific fix for _load - we have to remove this function
static std::regex remove_destructible_killcam("(setupdestructiblekillcaments\\(\\)\n\\{)[\\S\\s]*(\\})");

raw_script = std::regex_replace(raw_script, remove_destructible_killcam, "$1\n // iw5xport: Nothing to see here!\n$2");

// Change visionsetpain dvar to match IW4 since IW5 dvar sets gray vision
static std::regex vision_set_pain(R"(visionsetpain\(\s*"near_death_mp"\s*,\s*0\s*\);)");
raw_script = std::regex_replace(raw_script, vision_set_pain, R"(visionsetpain( getDvar( "mapname" ) );)");

}

if (file.ends_with("_destructible_types"))
Expand Down
10 changes: 8 additions & 2 deletions src/module/exporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,14 @@ void exporter::dump_map(const command::params& params)
command::execute(std::format("dumpScript maps/createfx/{}_fx", map_name), true);
command::execute(std::format("dumpScript maps/createart/{}_fog", map_name), true);

prepared_source.emplace_back("\n");
command::execute("dumpRawFile animtrees/animated_props.atr", true);
{
bool is_patch_mp = map_name.starts_with("patch_mp");
if (is_patch_mp)
{
prepared_source.emplace_back("\n");
command::execute("dumpRawFile animtrees/animated_props.atr", true);
}
}

prepared_source.emplace_back("\n");
console::info("Exporting Vision...\n");
Expand Down