Skip to content

Commit b81811b

Browse files
committed
fix: Started implementation of EmitSound
1 parent 52268ae commit b81811b

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

p2sm.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ bool CP2SMPlusPlusPlugin::Load(CreateInterfaceFn interfaceFactory, CreateInterfa
138138
Memory::ReplacePattern("vscript", "00 00 00 E0 51 B8 9E 3F", "9a 99 99 99 99 99 a9 3f");
139139

140140
// Increase the projected texture limit and disable the game auto-disabling others when there is more than one active. Thanks to \n and BetweenReality with help with these.
141+
//! Engine limit still exists though with a max of eight env_projectedtextures.
141142
Log(INFO, true, "Patching max amount of projected textures at once and auto disabling of projected textures...");
142143
// CEnvProjectedTexture::EnforceSingleProjectionRules
143144
Memory::ReplacePattern("server", "8B F0 3B F3 0F 84 95 00 00 00", "E9 9D 00 00 00 84 95 00 00 00"); // Skip for loop jump and jump to function return.
@@ -155,7 +156,7 @@ bool CP2SMPlusPlusPlugin::Load(CreateInterfaceFn interfaceFactory, CreateInterfa
155156

156157
#else // Linux Hooking. Due to the way this plugin is structured, it's currently not possible to compile this for Linux. Literally 1984 I know, but I don't have enough time or experience to figure it out by myself. One day.
157158
#endif
158-
159+
159160
#if _WIN32
160161
// MinHook initialization and hooking.
161162
Log(INFO, true, "Initializing MinHook and hooking functions...");
@@ -186,8 +187,9 @@ bool CP2SMPlusPlusPlugin::Load(CreateInterfaceFn interfaceFactory, CreateInterfa
186187
// Memory::Scan<void*>(CLIENTDLL, "55 8B EC 8B 45 ? 8B 55 ? 50 8B 45 ? 52 8B 55 ? 50 8B 45 ? 52 8B 55 ? 50 8B 45"),
187188
// &CWorkshopManager__CreateFileDownloadRequest_hook, reinterpret_cast<void**>(&CWorkshopManager__CreateFileDownloadRequest_orig)
188189
// );
189-
MH_EnableHook(MH_ALL_HOOKS);
190190

191+
MH_EnableHook(MH_ALL_HOOKS);
192+
191193
#else // Linux Hooking. Due to the way this plugin is structured, it's currently not possible to compile this for Linux. Literally 1984 I know, but I don't have enough time or experience to figure it out by myself. One day.
192194
#endif // _WIN32
193195

sdk.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ bool __fastcall CPortal_Player__FlashlightTurnOn_hook(CPortal_Player* thisPtr,
4242
}
4343

4444
CPortal_Player__SetFlashlightState(playerIndex, true);
45-
// engineServer->EmitAmbientSound(playerIndex)
45+
//engineServer-EmitAmbientSound>(playerIndex)
4646
return true;
4747
}
4848

@@ -190,6 +190,12 @@ HSCRIPT CBaseEntity__GetScriptInstance(CBaseEntity* entity)
190190
return GetScriptInstance_(entity);
191191
}
192192

193+
// TODO: Implement EmitSound
194+
// int CBaseEntity__EmitSound(CBaseEntity* entity, IRecipientFilter* filter, int iEntIndex, const char* soundName, const Vector* pOrigin, float soundTime)
195+
// {
196+
// static auto
197+
// //55 8B EC 83 EC 4C 8B 0D
198+
// }
193199

194200
/// CBasePlayer Class Functions \\\
195201

0 commit comments

Comments
 (0)