Skip to content

Commit 9460407

Browse files
authored
Merge branch 'master' into refactor-play-sound
2 parents 178e1ca + 5f41cec commit 9460407

File tree

15 files changed

+453
-244
lines changed

15 files changed

+453
-244
lines changed

source/InjectHooksMain.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,9 @@ void InjectHooksMain() {
14431443
Vehicle();
14441444
Interior();
14451445
Scripts();
1446+
#if _DEBUG
1447+
CCurves::TestCurves();
1448+
#endif
14461449
}
14471450

14481451
void InjectHooksMain(HMODULE hThisDLL) {

source/game_sa/Birds.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void CBirds::Shutdown() {
146146
void CBirds::Update() {
147147
ZoneScoped;
148148

149-
const auto& vecCamPos = TheCamera.GetPosition();
149+
const auto& camPosn = TheCamera.GetPosition();
150150

151151
if (!CGame::currArea
152152
&& uiNumberOfBirds < std::size(aBirds)
@@ -181,8 +181,8 @@ void CBirds::Update() {
181181
}
182182
}();
183183

184-
if (fFlightHeight > 5.0F) {
185-
float fBirdSpawnZ = fFlightHeight + vecCamPos.z;
184+
const float fBirdSpawnZ = fFlightHeight + camPosn.z;
185+
if (fBirdSpawnZ > 5.0F) {
186186
float fSpawnAngleCamRelative;
187187

188188
if (CGeneral::GetRandomNumber() % 2)
@@ -199,8 +199,8 @@ void CBirds::Update() {
199199
}
200200

201201
auto vecBirdSpawnPos = CVector(
202-
std::sin(fSpawnAngleCamRelative) * fSpawnDistance + vecCamPos.x,
203-
std::cos(fSpawnAngleCamRelative) * fSpawnDistance + vecCamPos.y,
202+
std::sin(fSpawnAngleCamRelative) * fSpawnDistance + camPosn.x,
203+
std::cos(fSpawnAngleCamRelative) * fSpawnDistance + camPosn.y,
204204
fBirdSpawnZ
205205
);
206206

@@ -210,7 +210,7 @@ void CBirds::Update() {
210210
vecForward.z = 0.0F;
211211
vecForward.Normalise();
212212

213-
auto vecFlightTargetPos = vecCamPos + (vecForward * 8.0F);
213+
auto vecFlightTargetPos = camPosn + (vecForward * 8.0F);
214214
vecFlightTargetPos.z = fBirdSpawnZ;
215215

216216
CreateNumberOfBirds(vecBirdSpawnPos, vecFlightTargetPos, iNumBirdsToCreate, biome, true);
@@ -221,7 +221,7 @@ void CBirds::Update() {
221221

222222
auto iBirdIndex = CTimer::GetFrameCounter() % std::size(aBirds);
223223
auto& checkedBird = aBirds[iBirdIndex];
224-
if (checkedBird.m_bCreated && DistanceBetweenPoints2D(vecCamPos, checkedBird.m_vecPosn) > checkedBird.m_fMaxBirdDistance)
224+
if (checkedBird.m_bCreated && DistanceBetweenPoints2D(camPosn, checkedBird.m_vecPosn) > checkedBird.m_fMaxBirdDistance)
225225
{
226226
checkedBird.m_bCreated = false;
227227
uiNumberOfBirds--;

0 commit comments

Comments
 (0)