diff options
author | Lizzy Fleckenstein <eliasfleckenstein@web.de> | 2023-05-28 11:06:01 +0200 |
---|---|---|
committer | Lizzy Fleckenstein <eliasfleckenstein@web.de> | 2023-05-28 11:06:13 +0200 |
commit | be295adc4ecaa7783ad778b5b85b7b05a3bcd1d7 (patch) | |
tree | 7191206f1017e58b5c37d06052a2bebadfc7cd1a /src | |
parent | cf5df4b9241e775d4ad559833f92c442ac7cbee1 (diff) | |
download | texmodbot-be295adc4ecaa7783ad778b5b85b7b05a3bcd1d7.tar.xz |
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index a5c95da..13ef518 100644 --- a/src/main.rs +++ b/src/main.rs @@ -65,13 +65,19 @@ impl Bot { } }; + fn print_texmod(tex: &String, print_texture: &mut impl FnMut(&String)) { + if !tex.is_empty() { + print_texture(&format!("blank.png{tex}")); + } + } + let print_obj_msg = |msg: &mt_net::ObjMsg| { use mt_net::ObjMsg::*; match msg { - TextureMod { texture_mod } => print_texture(texture_mod), + TextureMod { texture_mod } => print_texmod(texture_mod, &mut print_texture), Props(props) => { props.textures.iter().for_each(&mut print_texture); - print_texture(&props.dmg_texture_mod); + print_texmod(&props.dmg_texture_mod, &mut print_texture); } _ => {} } |