mirror of
https://github.com/redstrate/Kawari.git
synced 2025-06-30 11:47:45 +00:00
Fix the size of the aetheryte unlock bitmask
This should really be calculated instead of guessed, because I already made a mistake. I didn't do that, only added a TODO for it. Fixes #74
This commit is contained in:
parent
d3647a4b3b
commit
db2ee114a9
4 changed files with 6 additions and 5 deletions
|
@ -689,7 +689,7 @@ async fn client_loop(
|
|||
|
||||
// id == 0 means "all"
|
||||
if id == 0 {
|
||||
for i in 1..231 {
|
||||
for i in 1..239 {
|
||||
let (value, index) = value_to_flag_byte_index_value(i);
|
||||
if on {
|
||||
connection.player_data.aetherytes[index as usize] |= value;
|
||||
|
|
|
@ -164,8 +164,8 @@ pub struct PlayerStatus {
|
|||
pub cleared_pvp: [u8; 5],
|
||||
|
||||
// meh, this is where i put all of the new data
|
||||
#[br(count = 160)]
|
||||
#[bw(pad_size_to = 160)]
|
||||
#[br(count = 159)]
|
||||
#[bw(pad_size_to = 159)]
|
||||
pub unknown948: Vec<u8>,
|
||||
}
|
||||
|
||||
|
|
|
@ -73,4 +73,5 @@ pub const OBFUSCATION_ENABLED_MODE: u8 = 41;
|
|||
pub const UNLOCK_BITMASK_SIZE: usize = 64;
|
||||
|
||||
/// The size of the aetheryte unlock bitmask.
|
||||
pub const AETHERYTE_UNLOCK_BITMASK_SIZE: usize = 29;
|
||||
// TODO: this can be automatically derived from game data
|
||||
pub const AETHERYTE_UNLOCK_BITMASK_SIZE: usize = 30;
|
||||
|
|
|
@ -694,7 +694,7 @@ impl ZoneConnection {
|
|||
Task::UnlockAetheryte { id, on } => {
|
||||
let unlock_all = *id == 0;
|
||||
if unlock_all {
|
||||
for i in 1..231 {
|
||||
for i in 1..239 {
|
||||
let (value, index) = value_to_flag_byte_index_value(i);
|
||||
if *on {
|
||||
self.player_data.aetherytes[index as usize] |= value;
|
||||
|
|
Loading…
Add table
Reference in a new issue