Files
benilla-octo/crates/benilla-app/src/chr_classes.rs
T
SamandClaude Fable 5.1 a1355ea02b the battle map draws, and the talent modifiers land
- inside a battleground the battle map draws its terrain, overlays, arrow and blips: the world map's selection carries the instance maps as the reference's third cell (2298)
- talent spell modifiers land: the 45 packets a level-60 login threw away fill the reference's two tables, and a spell's power cost reads them, so a cast you can afford is no longer refused (2298)
- a ghost's Accept on the spirit-heal dialog can no longer be eaten by frame order, and a latched spirit guide no longer follows you into the next character's session (2298)
- the battleground probe refuses GM mode, exits when done, and reads the scoreboard before toggling it (2298)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 16:45:36 +07:00

50 lines
2.1 KiB
Rust

//! `ChrClasses.dbc`, loaded once and read by everything that asks the client a question about a
//! class.
//!
//! Three consumers today and they are unrelated to each other — [`crate::ui_pet_book`] wants field
//! 4's pet name token, `UnitHasRelicSlot` wants field 16's relic flag, and
//! [`crate::spell_mods`] wants field 15's class spell-family — which is exactly why the
//! table does not live inside any of them. It used to live in the pet book, back when the pet
//! token was the only column anyone read.
//!
//! The resource is **absent**, not empty, when the load fails. Every reader then falls to the
//! reference's own degraded answer (`"PET"` for the token, no relic slot for any class, family 0
//! — which the modifier gate's first conjunct refuses), so a missing table costs a warlock the
//! word "Demon", a paladin their relic branches and everyone their talent modifiers rather than
//! taking the client down.
use bevy::prelude::*;
use benilla_assets::{AssetSet, LockRecover, WorldAssets};
use benilla_formats::ChrClasses;
/// The parsed table — see [`benilla_formats::ChrClasses`] for what each column is and which bytes
/// say so.
#[derive(Resource)]
pub(crate) struct ChrClassTable(pub(crate) ChrClasses);
pub(crate) struct ChrClassesPlugin;
impl Plugin for ChrClassesPlugin {
fn build(&self, app: &mut App) {
app.add_systems(Startup, load_chr_classes.after(AssetSet::Open));
}
}
fn load_chr_classes(mut commands: Commands, assets: Option<Res<WorldAssets>>) {
let Some(assets) = assets else { return };
let loaded = {
let mut chain = assets.chain.lock_recover();
benilla_formats::load_chr_classes(&mut chain)
};
match loaded {
Ok(table) => commands.insert_resource(ChrClassTable(table)),
Err(e) => warn!(
"chr_classes: ChrClasses.dbc failed to load — every pet book tab reads the client's \
own \"PET\" fallback, so a warlock's says Pet rather than Demon, no class reads \
as having a relic slot, and no talent spell modifier can apply (the gate has no \
class family to match): {e:#}"
),
}
}