Merge pull request #89 from Rackover/shellshock_parsing

Parse shellshock for 461+ CODO maps (only for awp_arena so far ?)
This commit is contained in:
Dss0 2021-07-06 12:14:01 +02:00 committed by GitHub
commit b87c97ef15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 0 deletions

View File

@ -8,6 +8,38 @@ namespace Components
int Zones::FxEffectIndex; int Zones::FxEffectIndex;
char* Zones::FxEffectStrings[64]; char* Zones::FxEffectStrings[64];
static std::unordered_map<std::string, std::string> shellshock_replace_list = {
{ "66","bg_shock_screenType" },
{ "67","bg_shock_screenBlurBlendTime"},
{ "68","bg_shock_screenBlurBlendFadeTime"},
{ "69","bg_shock_screenFlashWhiteFadeTime"},
{ "70","bg_shock_screenFlashShotFadeTime"},
{ "71","bg_shock_viewKickPeriod"},
{ "72","bg_shock_viewKickRadius"},
{ "73","bg_shock_viewKickFadeTime"},
{ "78","bg_shock_sound"},
{ "74","bg_shock_soundLoop"},
{ "75","bg_shock_soundLoopSilent"},
{ "76","bg_shock_soundEnd"},
{ "77","bg_shock_soundEndAbort"},
{ "79","bg_shock_soundFadeInTime"},
{ "80","bg_shock_soundFadeOutTime"},
{ "81","bg_shock_soundLoopFadeTime"},
{ "82","bg_shock_soundLoopEndDelay"},
{ "83","bg_shock_soundRoomType"},
{ "84","bg_shock_soundDryLevel"},
{ "85","bg_shock_soundWetLevel"},
{ "86","bg_shock_soundModEndDelay"},
// guessed, not sure
{ "87","bg_shock_lookControl"},
{ "88","bg_shock_lookControl_maxpitchspeed"},
{ "89","bg_shock_lookControl_maxyawspeed"},
{ "90","bg_shock_lookControl_mousesensitivityscale"},
{ "91","bg_shock_lookControl_fadeTime"},
{ "92","bg_shock_movement"}
};
static std::unordered_map<std::string, std::string> vision_replace_list = { static std::unordered_map<std::string, std::string> vision_replace_list = {
{ "511","r_glow" }, { "511","r_glow" },
{ "516","r_glowRadius0" }, { "516","r_glowRadius0" },
@ -3468,6 +3500,17 @@ namespace Components
return token; return token;
} }
char* Zones::ParseShellShock_Stub(const char** data_p)
{
auto token = Game::Com_Parse(data_p);
if (shellshock_replace_list.find(token) != shellshock_replace_list.end())
{
return shellshock_replace_list[token].data();
}
return token;
}
Zones::Zones() Zones::Zones()
{ {
Zones::ZoneVersion = 0; Zones::ZoneVersion = 0;
@ -3614,6 +3657,9 @@ namespace Components
Utils::Hook(0x418998, Zones::GameMapSpPatchStub, HOOK_JUMP).install()->quick(); Utils::Hook(0x418998, Zones::GameMapSpPatchStub, HOOK_JUMP).install()->quick();
Utils::Hook(0x427A1B, Zones::LoadPathDataTail, HOOK_JUMP).install()->quick(); Utils::Hook(0x427A1B, Zones::LoadPathDataTail, HOOK_JUMP).install()->quick();
Utils::Hook(0x4B4EA1, Zones::ParseShellShock_Stub, HOOK_CALL).install()->quick();
Utils::Hook(0x4B4F0C, Zones::ParseShellShock_Stub, HOOK_CALL).install()->quick();
Utils::Hook(0x4F4D3B, [] () Utils::Hook(0x4F4D3B, [] ()
{ {
if (Zones::ZoneVersion >= VERSION_ALPHA3) if (Zones::ZoneVersion >= VERSION_ALPHA3)

View File

@ -3,6 +3,7 @@
#define VERSION_ALPHA2 316 #define VERSION_ALPHA2 316
#define VERSION_ALPHA3 318//319 #define VERSION_ALPHA3 318//319
#define VERSION_ALPHA3_DEC 319 #define VERSION_ALPHA3_DEC 319
#define VERSION_LATEST_CODO 461
namespace Components namespace Components
{ {
@ -101,6 +102,7 @@ namespace Components
static void LoadTracerDef(bool atStreamStart, Game::TracerDef* tracer, int size); static void LoadTracerDef(bool atStreamStart, Game::TracerDef* tracer, int size);
static void LoadTracerDefFxEffect(); static void LoadTracerDefFxEffect();
static void FixImageCategory(Game::GfxImage* image); static void FixImageCategory(Game::GfxImage* image);
static char* ParseShellShock_Stub(const char** data_p);
static char* ParseVision_Stub(const char** data_p); static char* ParseVision_Stub(const char** data_p);
}; };
} }