Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29425/src/scriptinterface
Modified Files:
tcPlatformInterface.cpp
Log Message:
Index: tcPlatformInterface.cpp
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** tcPlatformInterface.cpp 19 Jul 2004 00:53:01 -0000 1.25
--- tcPlatformInterface.cpp 29 Jul 2004 00:14:18 -0000 1.26
***************
*** 1,4 ****
! /*
! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...)
** All rights reserved.
--- 1,6 ----
! /**
! ** @file tcPlatformInterface.cpp
! */
! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...)
** All rights reserved.
***************
*** 39,42 ****
--- 41,45 ----
#include "tcAeroAirObject.h"
#include "tcGenericDBObject.h"
+ #include "tcBallisticDBObject.h"
#include "tcLauncherState.h"
#include "tcLauncher.h"
***************
*** 418,430 ****
}
const tcLauncher* pLauncherData = mpPlatformObj->mcLauncherState.GetLauncher(anLauncher);
! tcMissileDBObject *pMissileDBObj =
! dynamic_cast<tcMissileDBObject*>(pLauncherData->mpChildDBObj);
! if (pMissileDBObj == NULL)
! {
! return false; // only missiles supported
}
info.mnLauncher = anLauncher;
info.mnQuantity = pLauncherData->mnUncommitted;
- info.mfRange_km = pMissileDBObj->mfRange_km;
info.mnTargetFlags = pLauncherData->mnTargetFlags;
--- 421,444 ----
}
const tcLauncher* pLauncherData = mpPlatformObj->mcLauncherState.GetLauncher(anLauncher);
!
! if (tcMissileDBObject* missileDBObj =
! dynamic_cast<tcMissileDBObject*>(pLauncherData->mpChildDBObj))
! {
! info.mfRange_km = missileDBObj->mfRange_km;
! }
! else if (tcBallisticDBObject* ballisticDBObj =
! dynamic_cast<tcBallisticDBObject*>(pLauncherData->mpChildDBObj))
! {
! info.mfRange_km = 20;
}
+ else
+ {
+ fprintf(stderr, "Error - unsupported launcher child class (%s)\n",
+ pLauncherData->mpChildDBObj->GetClassName());
+ return false;
+ }
+
info.mnLauncher = anLauncher;
info.mnQuantity = pLauncherData->mnUncommitted;
info.mnTargetFlags = pLauncherData->mnTargetFlags;
|