mangosR2/mangos — comment on commit 9b6c1a9f5d7fd6602dc4cbbe85694e3501846c11
File: src/game/BattleGroundIC.cpp line 293
By Sar777:

I remember I had Crash In this place, when leaving the battleground.

This one thing helped:

if (plr->HasAura(SPELL_QUARRY))
plr->RemoveAurasDueToSpell(SPELL_QUARRY);
if (plr->HasAura(SPELL_OIL_REFINERY))
plr->RemoveAurasDueToSpell(SPELL_OIL_REFINERY);