// Ryzom - MMORPG Framework
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see .
/* Copyright, 2000-2004 Nevrax Ltd.
*
* This file is part of NEVRAX NeL Network Services.
* NEVRAX NeL Network Services is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
* NEVRAX NeL Network Services is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with NEVRAX NeL Network Services; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*/
#include "stdpch.h"
#include "outpost.h"
#include "zone_util.h"
#include "pacs_client.h"
#include "client_cfg.h"
#include "village.h"
using namespace NLMISC;
using namespace NLPACS;
// ***************************************************************************
COutpost::COutpost()
{
_OutpostId= -1;
}
// ***************************************************************************
COutpost::~COutpost()
{
removeOutpost();
}
// ***************************************************************************
COutpost::COutpost(const COutpost &other)
{
for(uint i=0;isetBuildingPosition(building, rot, pos);
}
// ***************************************************************************
void COutpost::initOutpost ()
{
// remove the outpost from col, if any
removeOutpost();
// Add collisions, if correclty setuped
if (_OutpostId > -1)
{
// Register RZ_MAX_BUILDING_PER_OUTPOST observers for the RZ_MAX_BUILDING_PER_OUTPOST buildings
uint i;
for (i=0; iaddCollisionnablePrimitiveBlock(pbIt->second, 0, 1, &_AddedPrims, angle, pos, true, CVector(1,1,1));
}
}
}
// add 3D if needed
if(_Village)
_Village->initOutpost();
}
// ***************************************************************************
void COutpost::removeOutpost ()
{
// remove collisions
if(PACS)
{
for(uint i=0; i<_AddedPrims.size(); i++)
{
PACS->removePrimitive(_AddedPrims[i]);
}
_AddedPrims.clear();
}
// remove 3D
if(_Village)
_Village->removeOutpost();
}