add ability to forbid specific quest flag writes

This commit is contained in:
Martin Michelsen
2023-12-18 21:58:39 -08:00
parent e3315822de
commit b7604eb643
11 changed files with 88 additions and 8 deletions
+15
View File
@@ -508,6 +508,13 @@ struct QuestFlagsForDifficulty {
uint8_t mask = 0x80 >> (flag_index & 7);
this->data[byte_index] &= (~mask);
}
inline void update_all(bool set) {
if (set) {
this->data.clear(0xFF);
} else {
this->data.clear(0x00);
}
}
} __attribute__((packed));
struct QuestFlags {
@@ -522,6 +529,14 @@ struct QuestFlags {
inline void clear(uint8_t difficulty, uint16_t flag_index) {
this->data[difficulty].clear(flag_index);
}
inline void update_all(uint8_t difficulty, bool set) {
this->data[difficulty].update_all(set);
}
inline void update_all(bool set) {
for (size_t z = 0; z < 4; z++) {
this->update_all(z, set);
}
}
} __attribute__((packed));
struct BattleRules {