Skip to content

Commit

Permalink
Fix asset uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
makscee committed Apr 16, 2024
1 parent 136c551 commit 88f68b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/plugins/asset_upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ impl Plugin for AssetsUploadPlugin {

fn do_sync(world: &mut World) {
debug!("Assets Sync start");
Pools::get_mut(world).clear();
PoolsPlugin::setup(world);
let mut units: Vec<TableUnit> = default();
for (_, asset) in Pools::get(world).heroes.iter() {
units.push(asset.clone().into());
Expand Down
14 changes: 9 additions & 5 deletions src/resourses/pools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ impl Pools {
pub fn get_default_ability_state<'a>(name: &str, world: &'a World) -> Option<&'a VarState> {
Self::try_get(world)?.default_ability_states.get(name)
}
pub fn clear(&mut self) {
self.heroes.clear();
self.houses.clear();
self.abilities.clear();
self.statuses.clear();
self.vfx.clear();
self.summons.clear();
}
}

pub struct PoolsPlugin;
Expand Down Expand Up @@ -255,11 +263,7 @@ impl PoolsPlugin {
return;
}
debug!("Cache server pools start");
pools.heroes.clear();
pools.houses.clear();
pools.abilities.clear();
pools.statuses.clear();
pools.vfx.clear();
pools.clear();
for unit in TableUnit::iter() {
pools.heroes.insert(unit.name.clone(), unit.into());
}
Expand Down

0 comments on commit 88f68b7

Please sign in to comment.