if (m_pUnitInfo->isAutoRaze())
{
if (pPlot->isOwned())
{
if (pPlot->getImprovementType() != NO_IMPROVEMENT)
{
if (!GC.getImprovementInfo((ImprovementTypes)pPlot->getImprovementType()).isPermanent())
{
if (atWar(getTeam(), GET_PLAYER(pPlot->getOwner()).getTeam()))
{
//AutoPillage Add Begin pPlot->setImprovementType(NO_IMPROVEMENT);
CvWString szBuffer;
int iPillageGold;
long lPillageGold;
lPillageGold = 0;
CyPlot* pyPlot = new CyPlot(pPlot);
CyUnit* pyUnit = new CyUnit(this);
CyArgsList argsList;
argsList.add(gDLL->getPythonIFace()->makePythonObject(pyPlot)); // pass in plot class
argsList.add(gDLL->getPythonIFace()->makePythonObject(pyUnit)); // pass in unit class
gDLL->getPythonIFace()->callFunction(PYGameModule, "doPillageGold", argsList.makeFunctionArgs(),&lPillageGold);
delete pyPlot; // python fxn must not hold on to this pointer
delete pyUnit; // python fxn must not hold on to this pointer
iPillageGold = (int)lPillageGold;
if (iPillageGold > 0)
{
iPillageGold += (iPillageGold * GET_PLAYER(getOwnerINLINE()).getPillagingGold()) / 100;
GET_PLAYER(getOwnerINLINE()).changeGold(iPillageGold);
szBuffer = gDLL->getText("TXT_KEY_MISC_PLUNDERED_GOLD_FROM_IMP", iPillageGold, GC.getImprovementInfo(pPlot->getImprovementType()).getTextKeyWide());
gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), true, GC.getEVENT_MESSAGE_TIME(), szBuffer, "AS2D_PILLAGE", MESSAGE_TYPE_INFO, getButton(), (ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), pPlot->getX_INLINE(), pPlot->getY_INLINE());
if (pPlot->isOwned())
{
szBuffer = gDLL->getText("TXT_KEY_MISC_IMP_DESTROYED", GC.getImprovementInfo(pPlot->getImprovementType()).getTextKeyWide(), getNameKey(), getVisualCivAdjective(pPlot->getTeam()));
gDLL->getInterfaceIFace()->addMessage(pPlot->getOwnerINLINE(), false, GC.getEVENT_MESSAGE_TIME(), szBuffer, "AS2D_PILLAGED", MESSAGE_TYPE_INFO, getButton(), (ColorTypes)GC.getInfoTypeForString("COLOR_RED"), pPlot->getX_INLINE(), pPlot->getY_INLINE(), true, true);
}
gDLL->getEventReporterIFace()->unitPillage(this, pPlot->getImprovementType(), NO_ROUTE, getOwnerINLINE());
pPlot->setImprovementType((ImprovementTypes)(GC.getImprovementInfo(pPlot->getImprovementType()).getImprovementPillage()));
}//AutoPillage Add End