3.4 KiB
3.4 KiB
LOCK-FREE MIGRATION - OVERNIGHT RUN SUMMARY
Date: October 28, 2025 Status: Phase 2 Complete, Moving to Compilation
AUTOMATED MIGRATION RESULTS
Phase 2: ObjectAccessor Fallback Removal
Automated Script Results:
- Files Processed: 20 files
- Fallbacks Removed: 64 locations
- Lines Changed: ~212 lines
- Cell::Visit Replaced: 2 (CombatSpecializationBase.cpp)
Files Successfully Migrated:
- ✅ ClassAI.cpp
- ✅ ClassAI_Refactored.cpp
- ✅ CombatSpecializationBase.cpp (+ 2 Cell::Visit replacements)
- ✅ BotThreatManager.cpp (6 fallbacks)
- ✅ AoEDecisionManager.cpp
- ✅ DefensiveBehaviorManager.cpp
- ✅ DispelCoordinator.cpp (2 fallbacks)
- ✅ InterruptRotationManager.cpp (2 fallbacks)
- ✅ LootStrategy.cpp (2 fallbacks)
- ✅ QuestStrategy.cpp (3 fallbacks)
- ✅ DeathKnightAI.cpp (2 fallbacks)
- ✅ DemonHunterAI.cpp (2 fallbacks)
- ✅ EvokerAI.cpp (1 fallback)
- ✅ HunterAI.cpp (3 fallbacks)
- ✅ MonkAI.cpp (6 fallbacks)
- ✅ PaladinAI.cpp (4 fallbacks)
- ✅ RogueAI.cpp (2 fallbacks)
- ✅ ShamanAI.cpp (19 fallbacks - largest!)
- ✅ WarlockAI.cpp (2 fallbacks)
- ✅ WarriorAI.cpp (2 fallbacks)
Remaining Work:
ObjectAccessor Calls: ~30 actual code locations (68 grep hits but many are comments) Cell::Visit Calls: 38 locations
Files Needing Manual Attention:
- BotAI_EventHandlers.cpp (6 calls)
- InterruptAwareness.cpp (error during automation)
- Action.cpp, SpellInterruptAction.cpp
- CombatBehaviorIntegration.cpp
- CombatStateAnalyzer.cpp
- GroupCombatTrigger.cpp
- InterruptManager.cpp
- KitingManager.cpp
- LineOfSightManager.cpp
- ObstacleAvoidanceManager.cpp
- PositionManager.cpp
- TargetSelector.cpp
- ThreatCoordinator.cpp
NEXT STEPS
Immediate: Phase 6 - Compilation
Goal: Identify what actually breaks from the 64 removals Expected: Some compilation errors due to removed variable usage
After Compilation:
- Fix compilation errors from removed ObjectAccessor calls
- Handle remaining manual migrations as needed
- Final validation
MIGRATION PATTERNS APPLIED
Pattern 1: Simple Fallback Removal (Most Common)
Before:
auto snapshot = SpatialGridQueryHelpers::FindCreatureByGuid(_bot, guid);
if (!snapshot || !snapshot->IsAlive())
continue;
Unit* target = ObjectAccessor::GetUnit(*_bot, guid); // ❌ REMOVED
if (!target)
continue;
DoSomething(target);
After:
auto snapshot = SpatialGridQueryHelpers::FindCreatureByGuid(_bot, guid);
if (!snapshot || !snapshot->isAlive)
continue;
// Use snapshot directly - no pointer needed!
DoSomethingWithSnapshot(*snapshot);
Pattern 2: Cell::Visit Replacement
Before (CombatSpecializationBase.cpp):
std::vector<::Unit*> GetNearbyEnemies(float range) const
{
std::vector<::Unit*> enemies;
Cell::VisitGridObjects(_bot, searcher, range); // ❌ REMOVED
return enemies;
}
After:
std::vector<ObjectGuid> GetNearbyEnemies(float range) const
{
std::vector<ObjectGuid> guids;
auto grid = sSpatialGridManager.GetGrid(_bot->GetMap());
if (!grid) return guids;
auto creatures = grid->QueryNearbyCreatures(_bot->GetPosition(), range);
for (auto const& snapshot : creatures) {
if (snapshot.isAlive && snapshot.isHostile)
guids.push_back(snapshot.guid);
}
return guids; // ✅ GUIDs only
}
COMPILATION PHASE STARTING
Running build now to identify actual breaking changes...