LAGonauta / MetaAudio

GoldSrc engine plugin for 3D sound
GNU General Public License v2.0
98 stars 14 forks source link

[Crash] Condition Zero Deleted Scenes #23

Closed lespaul64 closed 2 years ago

lespaul64 commented 4 years ago

The game crash on 1st cut scene audio been played.

Details: ] version Protocol version 48 Exe version 1.0.0.0 (czerorr) Exe build: 15:17:55 Jul 24 2019 (8308)

] al_version Meta Audio Version: 92b7efb1ffebb94e3d20ed89f6dd72b50264b16f OpenAL Device: OpenAL Soft on Output BlasterX G1 (Sound BlasterX G1) OpenAL Version: 1.1

That's all, thank you.

LAGonauta commented 3 years ago

Yeah, that is a known bug since engine 8279. I won't be able to fix it as I would need to go deep into CS: CZ Delete Scenes compiled code, however I am not able to do that.

Anyone else is welcome to try :)

hzqst commented 2 years ago

Cause

This is because the two signatures :

#define SEQUENCE_GETSENTENCEBYINDEX_SIG "\x56\x8B\x35\x2A\x2A\x2A\x2A\x85\xF6\x57\x74\x2A\x8B\x7C\x24\x0C\x8B\x06\x57\x50\xE8"

and

#define SEQUENCE_GETSENTENCEBYINDEX_SIG_NEW "\x55\x8B\xEC\x56\x8B\x35\x2A\x2A\x2A\x2A\x85\xF6\x57\x74\x2A\x8B\x7D\x08\x8B\x06\x57\x50\xE8"

was pointing to

sentenceGroupEntry_s *__cdecl Sequence_FindSentenceGroup(const char *Str2) who takes string as first argument

image

instead of

sentenceEntry_s *__cdecl SequenceGetSentenceByIndex(unsigned int a1) who takes integer as first argument

image

which would finally crash game at

https://github.com/LAGonauta/MetaAudio/blob/6b85d170aa45814ad15f82aaeecdc77ffe163ac6/src/Vox/VoxManager.cpp#L238

Fix

Using correct sigs should solve the crash.

#define SEQUENCE_GETSENTENCEBYINDEX_SIG_NEW "\x55\x8B\xEC\xA1\x2A\x2A\x2A\x2A\x33\xC9\x85\xC0\x2A\x2A\x2A\x8B\x75\x08\x8B\x50\x04"

#define SEQUENCE_GETSENTENCEBYINDEX_SIG "\xA1\x2A\x2A\x2A\x2A\x33\xC9\x85\xC0\x2A\x2A\x2A\x2A\x2A\x24\x08\x8B\x50\x04"

It found the correct sentense entry and no crash happened after changing to correct signatures.

image

Tested in 8684 and works fine with CZ:DS

54444

LAGonauta commented 2 years ago

Should be fixed with https://github.com/LAGonauta/MetaAudio/pull/36