mirror of
https://github.com/uprightbass360/AzerothCore-RealmMaster.git
synced 2026-01-13 17:09:09 +00:00
- Replace hardcoded hooks with external scripts in scripts/hooks/ - Add 4 generic hook scripts (copy-standard-lua, copy-aio-lua, mod-ale-patches, black-market-setup) - Update all 28 module hook definitions in config/modules.json - Remove legacy hook functions from manage-modules.sh - Add 26 new Eluna Lua modules to .env.template (disabled by default) - Add 3 new AIO modules to .env.template (disabled by default) - Implement proper environment variable interface for hooks - Add comprehensive documentation and refactoring summary 🤖 Generated with [Claude Code](https://claude.ai/code)
52 lines
1.4 KiB
Bash
Executable File
52 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
||
# Module-specific hook for mod-ale compatibility patches
|
||
set -e
|
||
|
||
# Hook environment
|
||
MODULE_KEY="${MODULE_KEY:-}"
|
||
MODULE_DIR="${MODULE_DIR:-}"
|
||
MODULE_NAME="${MODULE_NAME:-}"
|
||
|
||
if [ -z "$MODULE_DIR" ] || [ ! -d "$MODULE_DIR" ]; then
|
||
echo "❌ mod-ale-patches: Invalid module directory: $MODULE_DIR"
|
||
exit 2
|
||
fi
|
||
|
||
echo "🔧 mod-ale-patches: Applying compatibility fixes to $MODULE_NAME"
|
||
|
||
# Apply MovePath compatibility patch
|
||
apply_movepath_patch() {
|
||
local target_file="$MODULE_DIR/src/LuaEngine/methods/CreatureMethods.h"
|
||
|
||
if [ ! -f "$target_file" ]; then
|
||
echo " ⚠️ MovePath patch target file missing: $target_file"
|
||
return 1
|
||
fi
|
||
|
||
if grep -q 'MoveWaypoint(creature->GetWaypointPath(), true);' "$target_file"; then
|
||
if sed -i 's/MoveWaypoint(creature->GetWaypointPath(), true);/MovePath(creature->GetWaypointPath(), FORCED_MOVEMENT_RUN);/' "$target_file"; then
|
||
echo " ✅ Applied MovePath compatibility fix"
|
||
return 0
|
||
else
|
||
echo " ❌ Failed to apply MovePath compatibility fix"
|
||
return 2
|
||
fi
|
||
else
|
||
echo " ✅ MovePath compatibility fix already present"
|
||
return 0
|
||
fi
|
||
}
|
||
|
||
# Apply all patches
|
||
patch_count=0
|
||
if apply_movepath_patch; then
|
||
patch_count=$((patch_count + 1))
|
||
fi
|
||
|
||
if [ $patch_count -eq 0 ]; then
|
||
echo " ℹ️ No patches needed or applied"
|
||
exit 0
|
||
fi
|
||
|
||
echo " ✅ Applied $patch_count compatibility patch(es)"
|
||
exit 0 |