Skip to content

Commit

Permalink
Fix movie decoding
Browse files Browse the repository at this point in the history
Fixes regression from alexbatalov#117, see alexbatalov#136.
  • Loading branch information
Zenkibou committed Mar 23, 2024
1 parent 70b686b commit deb3f21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/movie_lib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static void _nfPkDecomp(unsigned char* buf, unsigned char* a2, int a3, int a4, i

static constexpr uint16_t loadUInt16LE(const uint8_t* b);
static constexpr uint32_t loadUInt32LE(const uint8_t* b);
static uint8_t getOffset(uint16_t v);
static int getOffset(uint16_t v);

// 0x51EBD8
static int dword_51EBD8 = 0;
Expand Down Expand Up @@ -2802,9 +2802,9 @@ constexpr uint32_t loadUInt32LE(const uint8_t* b)
return (b[3] << 24) | (b[2] << 16) | (b[1] << 8) | b[0];
}

uint8_t getOffset(uint16_t v)
int getOffset(uint16_t v)
{
return static_cast<int8_t>(v & 0xFF) + dword_51F018[v >> 8];
return static_cast<int>(static_cast<char>(v)) + dword_51F018[v >> 8];
}

} // namespace fallout

0 comments on commit deb3f21

Please sign in to comment.