Implement robust logging with flexi_logger and update CI to verify logs
Some checks failed
Smoke tests / Build and smoke test (push) Has been cancelled
Some checks failed
Smoke tests / Build and smoke test (push) Has been cancelled
This commit is contained in:
@@ -69,6 +69,8 @@ pub fn resolve_combat_tick(
|
||||
));
|
||||
|
||||
if new_npc_hp <= 0 {
|
||||
let player_name = state.players.get(&player_id).map(|c| c.player.name.clone()).unwrap_or_else(|| "Unknown".into());
|
||||
log::info!("Combat: Player '{}' (ID {}) killed NPC '{}' ({})", player_name, player_id, npc_template.name, npc_id);
|
||||
if let Some(inst) = state.npc_instances.get_mut(&npc_id) {
|
||||
inst.alive = false;
|
||||
inst.hp = 0;
|
||||
@@ -351,7 +353,9 @@ pub fn player_death_respawn(player_id: usize, state: &mut GameState) -> String {
|
||||
.players
|
||||
.get(&player_id)
|
||||
.map(|c| c.player.name.clone())
|
||||
.unwrap_or_default();
|
||||
.unwrap_or_else(|| "Unknown".into());
|
||||
|
||||
log::info!("Combat: Player '{}' (ID {}) died and respawned at {}", player_name, player_id, spawn_room);
|
||||
|
||||
if let Some(conn) = state.players.get_mut(&player_id) {
|
||||
conn.player.stats.hp = conn.player.stats.max_hp;
|
||||
|
||||
Reference in New Issue
Block a user