Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions crates/world-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4932,6 +4932,7 @@ async fn main() -> Result<ExitCode> {
mmap_pathfinder.clone(),
legacy_creature_aggro_config.clone(),
map_update_interval_ms,
Some(Arc::clone(&char_db)),
Arc::clone(&player_registry),
);

Expand Down Expand Up @@ -12931,6 +12932,7 @@ fn spawn_legacy_creature_runtime_update_loop_like_cpp(
mmap_pathfinder: Option<Arc<WorldMMapPathfinderWorkerLikeCpp>>,
aggro_config: wow_world::session::LegacyCreatureAggroConfigLikeCpp,
tick_interval_ms: u32,
character_db: Option<Arc<CharacterDatabase>>,
player_registry: Arc<PlayerRegistry>,
) -> tokio::task::JoinHandle<()> {
if !enabled {
Expand Down Expand Up @@ -12973,6 +12975,18 @@ fn spawn_legacy_creature_runtime_update_loop_like_cpp(
break;
};

if let Some(character_db) = character_db.as_ref() {
for stmt in &outcome.lifecycle.respawn_db_statements {
if let Err(error) = character_db.execute(stmt).await {
warn!(
?error,
sql = stmt.sql(),
"Failed to persist legacy creature respawn timer like C++"
);
}
}
}

let touched_creatures = outcome.lifecycle.corpses_despawned
+ outcome.movement.movement_packets
+ outcome.aggro.aggro_starts
Expand Down Expand Up @@ -23360,6 +23374,7 @@ mmap.enablePathFinding = 0
None,
wow_world::session::LegacyCreatureAggroConfigLikeCpp::default(),
1,
None,
Arc::clone(&registry),
);

Expand Down
Loading
Loading