Just to follow up on my conversation with myself... here's what's going on...
Code:
function AIPlayer::spawn(%name,%spawnPoint, %type)
{
// Create the demo player object
if( %type $= "player") {
%useThisDatablock = DemoPlayer;
}else if( %type $= "enemy1") {
%useThisDatablock = DemoPlayer2;
}else if( %type $= "strykerGun") {
%useThisDatablock = DefaultPlayerData;
}else if( %type $= "tankGun") {
%useThisDatablock = TankTurret;
}else if( %type $= "box") {
%useThisDatablock = testBox;
}
%player = new AiPlayer() {
dataBlock = %useThisDatablock;
path = "";
};
MissionCleanup.add(%player);
%player.setShapeName(%name);
%player.setTransform(%spawnPoint); // this line works without error
return %player;
}
function AIWheeledVehicle::spawn( %name, %spawnPoint, %type )
{
%player = new AIWheeledVehicle() {
dataBlock = DefaultCar;
path = "";
};
MissionCleanup.add(%player);
%player.setShapeName(%name);
%player.setTransform(%spawnPoint); // this line causes the game to sigseg
return %player;
}
In the above two methods... one to spawn an AI player, the other to spawn an AIWheeledVehicle, if I pass in a %spawnPoint to the AIPlayer::spawn() it will work. Pass the same %spawnPoint in to the AIWheeledVehicle::spawn() method and the app will abort immediately on the function call.
I'm all ears for what the problem might be.
(PS: The above it not my code... it's legacy stuff I'm trying to wrap my head around)