Sanitizer fixes

This commit is contained in:
erorcun 2021-06-30 03:31:10 +03:00
parent 7df71c9673
commit 70fa7fc239
3 changed files with 9 additions and 9 deletions

View File

@ -1214,14 +1214,14 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment)
{ {
ASSERT( nComment < TOTAL_AUDIO_SAMPLES ); ASSERT( nComment < TOTAL_AUDIO_SAMPLES );
int8 slot;
for ( int32 i = 0; i < _TODOCONST(3); i++ ) for ( int32 i = 0; i < _TODOCONST(3); i++ )
{ {
slot = nCurrentPedSlot - i - 1;
#ifdef FIX_BUGS #ifdef FIX_BUGS
int8 slot = (int8)nCurrentPedSlot - i - 1;
if (slot < 0) if (slot < 0)
slot += ARRAY_SIZE(nPedSlotSfx); slot += ARRAY_SIZE(nPedSlotSfx);
#else
uint8 slot = nCurrentPedSlot - i - 1;
#endif #endif
if ( nComment == nPedSlotSfx[slot] ) if ( nComment == nPedSlotSfx[slot] )
return TRUE; return TRUE;
@ -1234,14 +1234,14 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment)
int32 int32
cSampleManager::_GetPedCommentSlot(uint32 nComment) cSampleManager::_GetPedCommentSlot(uint32 nComment)
{ {
int8 slot;
for (int32 i = 0; i < _TODOCONST(3); i++) for (int32 i = 0; i < _TODOCONST(3); i++)
{ {
slot = nCurrentPedSlot - i - 1;
#ifdef FIX_BUGS #ifdef FIX_BUGS
int8 slot = (int8)nCurrentPedSlot - i - 1;
if (slot < 0) if (slot < 0)
slot += ARRAY_SIZE(nPedSlotSfx); slot += ARRAY_SIZE(nPedSlotSfx);
#else
uint8 slot = nCurrentPedSlot - i - 1;
#endif #endif
if (nComment == nPedSlotSfx[slot]) if (nComment == nPedSlotSfx[slot])
return slot; return slot;

View File

@ -1044,7 +1044,7 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk)
if (IsPlayer()) if (IsPlayer())
moveAssoc->speed = 1.3f; moveAssoc->speed = 1.3f;
m_takeAStepAfterAttack = 0; m_takeAStepAfterAttack = false;
m_fightButtonPressure = 0; m_fightButtonPressure = 0;
} else if (IsPlayer() && m_currentWeapon != WEAPONTYPE_UNARMED) { } else if (IsPlayer() && m_currentWeapon != WEAPONTYPE_UNARMED) {
CAnimBlendAssociation *moveAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[m_curFightMove].animId, 4.0f); CAnimBlendAssociation *moveAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[m_curFightMove].animId, 4.0f);

View File

@ -682,8 +682,8 @@ CPlayerPed::PlayerControlFighter(CPad *padUsed)
if (padMove > 0.0f) { if (padMove > 0.0f) {
m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints(0.0f, 0.0f, -leftRight, upDown) - TheCamera.Orientation; m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints(0.0f, 0.0f, -leftRight, upDown) - TheCamera.Orientation;
m_takeAStepAfterAttack = padMove > 2 * PAD_MOVE_TO_GAME_WORLD_MOVE; m_takeAStepAfterAttack = padMove > (2 * PAD_MOVE_TO_GAME_WORLD_MOVE);
if (padUsed->GetSprint() && padMove > 1 * PAD_MOVE_TO_GAME_WORLD_MOVE) if (padUsed->GetSprint() && padMove > (1 * PAD_MOVE_TO_GAME_WORLD_MOVE))
bIsAttacking = false; bIsAttacking = false;
} }