fixed bool_masked (#2708)

This commit is contained in:
Alice 2024-02-13 01:26:07 +08:00 committed by GitHub
parent 1a0fbd3dea
commit ec7735cb3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -66,7 +66,7 @@ namespace lua::stats
static bool get_bool_masked_hash(Hash stat_hash, int bit_index)
{
int out_value;
constexpr int bit_count = 8;
constexpr int bit_count = 1;
STATS::STAT_GET_MASKED_INT(stat_hash, &out_value, bit_index, bit_count, -1);
return out_value;
@ -187,7 +187,7 @@ namespace lua::stats
// Returns: boolean: True if succeeded.
static bool set_bool_masked_hash(Hash stat_hash, bool new_value, int bit_index)
{
constexpr int bit_count = 8;
constexpr int bit_count = 1;
return STATS::STAT_SET_MASKED_INT(stat_hash, new_value, bit_index, bit_count, true);
}
@ -335,4 +335,4 @@ namespace lua::stats
ns["set_packed_stat_bool"] = set_packed_stat_bool;
ns["set_packed_stat_int"] = set_packed_stat_int;
}
}
}