MCPcopy Create free account
hub / github.com/crossuo/crossuo / ProcessFootstepsSound

Method ProcessFootstepsSound

src/GameObjects/GameWorld.cpp:55–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55void CGameWorld::ProcessFootstepsSound(int ticks, CGameCharacter *gc)
56{
57 if (g_ConfigManager.FootstepsSound && gc->IsHuman() && !gc->Hidden())
58 {
59 if (!gc->m_Steps.empty() && (int)gc->LastStepSoundTime < ticks)
60 {
61 int incID = gc->StepSoundOffset;
62 int soundID = 0x012B;
63 int delaySound = 400;
64
65 if (gc->IsMounted())
66 {
67 if ((gc->m_Steps.back().Direction & 0x80) != 0)
68 {
69 soundID = 0x0129;
70 delaySound = 150;
71 }
72 else
73 {
74 incID = 0;
75 delaySound = 350;
76 }
77 }
78
79 if (g_ConfigManager.StandartCharactersAnimationDelay)
80 {
81 delaySound = delaySound * 13 / 10;
82 }
83 soundID += incID;
84 gc->StepSoundOffset = (incID + 1) % 2;
85 g_Game.PlaySoundEffect(soundID); //0x0129 - 0x0134
86 gc->LastStepSoundTime = ticks + delaySound;
87 }
88 }
89}
90
91void CGameWorld::ProcessAnimation()
92{

Callers

nothing calls this directly

Calls 5

HiddenMethod · 0.80
IsMountedMethod · 0.80
IsHumanMethod · 0.45
emptyMethod · 0.45
PlaySoundEffectMethod · 0.45

Tested by

no test coverage detected