Skip to content

Commit

Permalink
Merge pull request #880 from tmyqlfpir/fix-sync-array
Browse files Browse the repository at this point in the history
Blood: Fix out of bounds array check for CalcNonSpriteChecksum()
  • Loading branch information
Hendricks266 authored Dec 22, 2024
2 parents 159e638 + 94f2f17 commit 1db6af1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/blood/src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@ uint32_t PLAYER::CalcNonSpriteChecksum(void)
sum += ((used2[4]>>8)&255) | ((used2[5]&65535)<<16) | ((used2[6]&255)<<24);
sum += ((used2[6]>>8)&255) | ((used2[7]&65535)<<16) |
((damageControl[0]&255)<<24);
for (i = 0; i < 7; ++i)
for (i = 0; i < kDamageMax-1; ++i)
sum += ((damageControl[i]>>8)&0xFFFFFF) | ((damageControl[i+1]&255)<<24);
sum += ((damageControl[7]>>8)&0xFFFFFF) | ((curWeapon&255)<<24);
sum += ((damageControl[kDamageMax-1]>>8)&0xFFFFFF) | ((curWeapon&255)<<24);
sum += (nextWeapon&255) | ((weaponTimer&0xFFFFFF)<<8);
sum += ((weaponTimer>>24)&255) | ((weaponState&0xFFFFFF)<<8);
sum += ((weaponState>>24)&255) | ((weaponAmmo&0xFFFFFF)<<8);
Expand Down

0 comments on commit 1db6af1

Please sign in to comment.