MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / onNewDataBlock

Method onNewDataBlock

Engine/source/afx/afxMagicMissile.cpp:1144–1166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1142
1143
1144bool afxMagicMissile::onNewDataBlock(GameBaseData* dptr, bool reload)
1145{
1146 mDataBlock = dynamic_cast<afxMagicMissileData*>(dptr);
1147 if (!mDataBlock || !Parent::onNewDataBlock(dptr, reload))
1148 return false;
1149
1150 starting_velocity = mDataBlock->muzzleVelocity;
1151 starting_vel_vec = mDataBlock->starting_vel_vec;
1152 collision_mask = mDataBlock->collision_mask;
1153
1154 if ( isGhost() )
1155 {
1156 // Create the sound ahead of time. This reduces runtime
1157 // costs and makes the system easier to understand.
1158
1159 SFX_DELETE( mSound );
1160
1161 if (mDataBlock->getProjectileSound())
1162 mSound = SFX->createSource(mDataBlock->getProjectileSoundProfile());
1163 }
1164
1165 return true;
1166}
1167
1168
1169//--------------------------------------------------------------------------

Callers 2

onAddMethod · 0.45
create_splashMethod · 0.45

Calls 1

createSourceMethod · 0.45

Tested by

no test coverage detected