Teams implementation

Add team functionality to shapebase objects
This commit is contained in:
ZOD 2015-11-28 11:32:40 -05:00
parent aa6d9b8ec2
commit e471c96014
4 changed files with 163 additions and 10 deletions

View file

@ -380,6 +380,12 @@ static void _scanCallback( SceneObject* object, void* data )
ShapeBase* shape = dynamic_cast<ShapeBase*>(object);
if (shape && shape->getDamageState() == ShapeBase::Enabled)
{
//> ZOD: Filter out these immediately
S32 myId = turret->getTeamId();
S32 targetId = shape->getTeamId();
if (myId == targetId || shape->getCloakedState())
return;
//< ZOD: End addition
Point3F targetPos = shape->getBoxCenter();
// Put target position into the scan node's space
@ -1352,3 +1358,13 @@ DefineEngineMethod( AITurretShape, recenterTurret, void, ( ),,
{
object->recenterTurret();
}
//< ZOD: You will shoot who I say to shoot!
DefineEngineMethod( AITurretShape, addToTargetList, void, (ShapeBase* obj),,
"@brief Adds object to the turret's target list.\n\n"
"All objects in this list will be targeted by the turret.\n"
"@param obj The ShapeBase object to target.\n")
{
object->addPotentialTarget(obj);
}
//< ZOD: End addition