static MyMissile CreateMissile(MyWeaponPropertiesWrapper weaponProperties) { MyMissile missile = new MyMissile(); missile.Init(weaponProperties); m_missiles.Add(missile); return missile; }
static MyMissile CreateMissile(MyWeaponPropertiesWrapper weaponProperties) { MyMissile missile = new MyMissile(); missile.Init(weaponProperties); m_missiles.Add(missile); return(missile); }
public static MyMissile AddUnsynced(MyWeaponPropertiesWrapper weaponProperties, Vector3D position, Vector3D initialVelocity, Vector3D direction, long ownerId) { MyMissile newMissile = CreateMissile(weaponProperties); newMissile.Start(position, initialVelocity, direction, ownerId); return(newMissile); }
// Add new missile to the list public static MyMissile Add(MyWeaponPropertiesWrapper weaponProperties, Vector3D position, Vector3D initialVelocity, Vector3D direction, long ownerId) { MyMissile newMissile = AddUnsynced(weaponProperties, position, initialVelocity, direction, ownerId); //if (newMissile != null && Sync.IsServer) //{ // MySyncMissiles.SendMissileCreated(missileData.Launcher, position, initialVelocity, direction, missileData.CustomMaxDistance, missileData.Flags, ownerId); //} return(newMissile); }
// Add new missile to the list public static MyMissile Add(MyWeaponPropertiesWrapper weaponProperties, Vector3D position, Vector3D initialVelocity, Vector3D direction, long ownerId) { MyMissile newMissile = AddUnsynced(weaponProperties, position, initialVelocity, direction, ownerId); // REMOVE-ME: Still commented out as of 70997. Ported to new MP events. Rmoved old sync class MySyncMissiles //if (newMissile != null && Sync.IsServer) // MyMultiplayer.RaiseStaticEvent(s => MyMissiles.MissileCreatedSuccess, missileData.Launcher, initialVelocity); return(newMissile); }
public static MyMissile AddUnsynced(MyWeaponPropertiesWrapper weaponProperties, Vector3D position, Vector3D initialVelocity, Vector3D direction, long ownerId) { MyMissile newMissile = CreateMissile(weaponProperties); if (Sync.IsServer) { //"hack" to prevent self shooting of rocket launchers if there is lag on network Vector3D extendedPos = position + direction * 4.0f; MyPhysics.HitInfo?info = MyPhysics.CastRay(position, extendedPos); //spawn rocket 4m in fron of launcher on DS (why 4 ? why not ;) ), but only if there is nothing in front of launcher if (info.HasValue == false) { position = extendedPos; } } newMissile.Start(position, initialVelocity, direction, ownerId); return(newMissile); }
public static void Remove(MyMissile missile) { //m_missiles.Deallocate(missile); m_missiles.Remove(missile); }