Skip to content

Commit a18ef9e

Browse files
committed
Minor Cleanup Code
1 parent 105fe40 commit a18ef9e

File tree

3 files changed

+34
-119
lines changed

3 files changed

+34
-119
lines changed

GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,6 @@ class Object : public Thing, public Snapshot
263263
void doStatusDamage( ObjectStatusTypes status, Real duration , const AsciiString& customStatus, const AsciiString& customTintStatus, TintStatus tintStatus = TINT_STATUS_INVALID );///< At this level, we just pass this on to our helper
264264
void doTempWeaponBonus( WeaponBonusConditionType status, const AsciiString& customStatus, UnsignedInt duration, const AsciiString& customTintStatus, TintStatus tintStatus = TINT_STATUS_INVALID );///< At this level, we just pass this on to our helper
265265
void notifyChronoDamage( Real amount );///< At this level, we just pass this on to our helper and do a special tint
266-
void doStatusDamage( ObjectStatusTypes status, Real duration );///< At this level, we just pass this on to our helper
267-
void doTempWeaponBonus( WeaponBonusConditionType status, UnsignedInt duration, TintStatus tintStatus = TINT_STATUS_INVALID );///< At this level, we just pass this on to our helper
268266
void applyBuff(const BuffTemplate* buffTemp, UnsignedInt duration, Object* sourceObj);
269267

270268
void refreshSubdualHelper();

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,6 @@ Object::Object( const ThingTemplate *tt, const ObjectStatusMaskType &objectStatu
349349
m_customWeaponBonusConditionAgainst.clear();
350350

351351
m_invsqrt_mass = 0.0f;
352-
//m_magnetLevitateHeight = 0.0f;
353-
//m_levitateCheckFrame = 0;
354-
//m_levitateCheckCount = 0;
355-
//m_dontLevitate = FALSE;
356352

357353
m_lastActualSpeed = 0.0f;
358354

@@ -2475,10 +2471,7 @@ void Object::attemptDamage( DamageInfo *damageInfo )
24752471
// Check the Magnet Force for any Levitation
24762472
if( damageInfo->in.m_magnetLevitationHeight && m_levitationHelper && ( m_levitationHelper->getLevitateHeight() == damageInfo->in.m_magnetLevitationHeight || damageInfo->in.m_magnetLevitationHeight <= posZ ) )
24772473
{
2478-
//m_magnetLevitateHeight = damageInfo->in.m_magnetLevitationHeight;
24792474
m_levitationHelper->doLevitation(damageInfo->in.m_magnetLevitationHeight);
2480-
//m_levitateCheckCount = 0;
2481-
//m_levitateCheckFrame = 0;
24822475
}
24832476

24842477
// Apply the Magnet Force
@@ -3359,62 +3352,6 @@ void Object::clearDisablePower(Bool isCommand)
33593352
}
33603353
}
33613354

3362-
//-------------------------------------------------------------------------------------------------
3363-
/*void Object::checkLevitate()
3364-
{
3365-
if(m_magnetLevitateHeight)
3366-
{
3367-
if(m_levitateCheckCount<11)
3368-
{
3369-
Coord3D newPos = *getPosition();
3370-
Real terrainZ = TheTerrainLogic->getGroundHeight( newPos.x, newPos.y );
3371-
Bool doLevitate;
3372-
if(newPos.z - terrainZ < m_magnetLevitateHeight)
3373-
{
3374-
doLevitate = TRUE;
3375-
3376-
newPos.z = m_magnetLevitateHeight + terrainZ + 0.5f;
3377-
setPosition( &newPos );
3378-
3379-
newPos.zero();
3380-
newPos.z = 12.5;
3381-
getPhysics()->applyForce( &newPos );
3382-
}
3383-
3384-
m_levitateCheckCount++;
3385-
3386-
if(m_levitateCheckCount>10)
3387-
{
3388-
if(doLevitate)
3389-
{
3390-
getPhysics()->resetDynamicPhysics();
3391-
m_dontLevitate = TRUE;
3392-
}
3393-
//getPhysics()->scrubVelocity2D(0);
3394-
}
3395-
}
3396-
}
3397-
if(m_dontLevitate)
3398-
{
3399-
UnsignedInt now = TheGameLogic->getFrame();
3400-
3401-
// Descending effect
3402-
Coord3D magnetForce;
3403-
magnetForce.zero();
3404-
magnetForce.z = 0.35;
3405-
getPhysics()->applyForce( &magnetForce );
3406-
3407-
if(!m_levitateCheckFrame)
3408-
m_levitateCheckFrame = now + LOGICFRAMES_PER_SECOND;
3409-
if(now > m_levitateCheckFrame)
3410-
{
3411-
m_dontLevitate = FALSE;
3412-
m_levitateCheckFrame = 0;
3413-
m_magnetLevitateHeight = 0;
3414-
}
3415-
}
3416-
}*/
3417-
34183355
//-------------------------------------------------------------------------------------------------
34193356
void Object::pauseAllSpecialPowers( const Bool disabling ) const
34203357
{
@@ -9196,21 +9133,6 @@ void Object::doSlavedUpdate( Bool doSlaver )
91969133
sdu->friend_refreshUpdate(FALSE);
91979134
}
91989135
}
9199-
9200-
/*static NameKeyType key_MobMemberSlavedUpdate = NAMEKEY( "MobMemberSlavedUpdate" );
9201-
MobMemberSlavedUpdate *MMSUpdate = (MobMemberSlavedUpdate*)findUpdateModule( key_MobMemberSlavedUpdate );
9202-
if( MMSUpdate )
9203-
{
9204-
Object *slaver = TheGameLogic->findObjectByID(MMSUpdate->getSlaverID());
9205-
if ( slaver )
9206-
{
9207-
SpawnBehaviorInterface *spawnInterface = slaver->getSpawnBehaviorInterface();
9208-
if( spawnInterface )
9209-
{
9210-
spawnInterface->updateMobMembers();
9211-
}
9212-
}
9213-
}*/
92149136
}
92159137

92169138
//-------------------------------------------------------------------------------------------------

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/MissileAIUpdate.cpp

Lines changed: 34 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ MissileAIUpdateModuleData::MissileAIUpdateModuleData()
9999
m_applyLauncherBonus = FALSE;
100100
m_allowSubdual = TRUE;
101101
m_allowAttract = TRUE;
102+
m_allowRetargeting = FALSE;
103+
m_allowRetargetingThroughFog = FALSE;
102104
}
103105

104106
//-----------------------------------------------------------------------------
@@ -327,7 +329,6 @@ void MissileAIUpdate::projectileFireAtObjectOrPosition( const Object *victim, co
327329
}
328330

329331
//DEBUG_LOG((">>> MissileAI FIREPROJ - dir = (%f/%f/%f)\n", dir.X, dir.Y, dir.Z));
330-
331332
PhysicsBehavior* physics = getObject()->getPhysics();
332333
if (physics && initialVelToUse > 0)
333334
{
@@ -1382,44 +1383,6 @@ void MissileAIUpdate::xfer( Xfer *xfer )
13821383
m_detonationWeaponTmpl = TheWeaponStore->findWeaponTemplate(weaponName);
13831384
}
13841385

1385-
// Xfer Source Code from GameLogic.cpp
1386-
// Xfer-Hash_Map
1387-
// Might need checking.
1388-
if (version >= 7)
1389-
{
1390-
if( xfer->getXferMode() == XFER_SAVE )
1391-
{
1392-
for (ObjectCustomStatusType::const_iterator it = m_extraBonusCustomFlags.begin(); it != m_extraBonusCustomFlags.end(); ++it )
1393-
{
1394-
AsciiString bonusName = it->first;
1395-
Int flag = it->second;
1396-
xfer->xferAsciiString(&bonusName);
1397-
xfer->xferInt(&flag);
1398-
}
1399-
AsciiString empty;
1400-
xfer->xferAsciiString(&empty);
1401-
}
1402-
else if (xfer->getXferMode() == XFER_LOAD)
1403-
{
1404-
if (m_extraBonusCustomFlags.empty() == false)
1405-
{
1406-
DEBUG_CRASH(( "GameLogic::xfer - m_extraBonusCustomFlags should be empty, but is not"));
1407-
//throw SC_INVALID_DATA;
1408-
}
1409-
1410-
for (;;)
1411-
{
1412-
AsciiString bonusName;
1413-
xfer->xferAsciiString(&bonusName);
1414-
if (bonusName.isEmpty())
1415-
break;
1416-
Int flag;
1417-
xfer->xferInt(&flag);
1418-
m_extraBonusCustomFlags[bonusName] = flag;
1419-
}
1420-
}
1421-
}
1422-
14231386
AsciiString exhaustName;
14241387
if (m_exhaustSysTmpl)
14251388
{
@@ -1462,6 +1425,38 @@ void MissileAIUpdate::xfer( Xfer *xfer )
14621425
if( version >= 7 )
14631426
{
14641427
xfer->xferReal( &m_randomPathDistLeft);
1428+
1429+
if( xfer->getXferMode() == XFER_SAVE )
1430+
{
1431+
for (ObjectCustomStatusType::const_iterator it = m_extraBonusCustomFlags.begin(); it != m_extraBonusCustomFlags.end(); ++it )
1432+
{
1433+
AsciiString bonusName = it->first;
1434+
Int flag = it->second;
1435+
xfer->xferAsciiString(&bonusName);
1436+
xfer->xferInt(&flag);
1437+
}
1438+
AsciiString empty;
1439+
xfer->xferAsciiString(&empty);
1440+
}
1441+
else if (xfer->getXferMode() == XFER_LOAD)
1442+
{
1443+
if (m_extraBonusCustomFlags.empty() == false)
1444+
{
1445+
DEBUG_CRASH(( "GameLogic::xfer - m_extraBonusCustomFlags should be empty, but is not"));
1446+
//throw SC_INVALID_DATA;
1447+
}
1448+
1449+
for (;;)
1450+
{
1451+
AsciiString bonusName;
1452+
xfer->xferAsciiString(&bonusName);
1453+
if (bonusName.isEmpty())
1454+
break;
1455+
Int flag;
1456+
xfer->xferInt(&flag);
1457+
m_extraBonusCustomFlags[bonusName] = flag;
1458+
}
1459+
}
14651460
}
14661461
}
14671462

0 commit comments

Comments
 (0)