# SFVehicle.SFVehicleMountPoint

00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 |
    //=============================================================================
    // Spatial Fear
    // Name: SFVehicleMountPoint
    // Description: Class to attach one vehicle to another (i.e. - a turret onto a tank)
    //
    // Author: Gert Jen Peltenburg
    //=============================================================================
    class SFVehicleMountPoint expands SFVehicle;

    // These two functions allow attaching and detaching of a child component during play.
    // A SFVehicleMountPoint should have NO childtags, since these functions modify that array.
    // A vehiclecontrol that can optionally used with this mountpoint, should have the tag of the mountpoint
    // as its controlledtag.
    simulated function bool AttachChild(Actor newchild)
    {
     if(SFVehiclechildcount>0)
      return false;
     if(SFVehicle(newchild)!=None) {
      if(SFVehicle(newchild).parentDrv==None)
       SFVehicle(newchild).parentDrv=self;
      else
       return false;
     }

     StoreSFVehicleChildInfo(SFVehicleChild[0],newchild);

     SFVehiclechildcount=1;

    }

    simulated function bool DetachChild()
    {
     if(SFVehiclechildcount<=0)
      return false;

     if(SFVehicle(SFVehiclechild[0].act)!=None)
      SFVehicle(SFVehiclechild[0].act).ParentDrv=None;

     SFVehiclechild[0].act.instigator=None;

     SFVehiclechildcount=0;
    }

    defaultproperties
    {
         PhysicalRotationRate=(Pitch=16384,Yaw=16384,Roll=16384)
         bHidden=True
    }

class file time: 12/7/2003 3:58:26 PM - creation time: 12/7/2003 4:03:45 PM
Created with UnCodeX