Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SyncPortalsOnPlayerJoin()

static void Terraria.GameContent.PortalHelper.SyncPortalsOnPlayerJoin ( int plr,
int fluff,
List< Point > dontInclude,
out List< Point > portalSections )
inlinestatic

Definition at line 432 of file PortalHelper.cs.

433 {
435 for (int i = 0; i < 1000; i++)
436 {
437 Projectile projectile = Main.projectile[i];
438 if (!projectile.active || (projectile.type != 602 && projectile.type != 601))
439 {
440 continue;
441 }
442 Vector2 center = projectile.Center;
443 int sectionX = Netplay.GetSectionX((int)(center.X / 16f));
444 int sectionY = Netplay.GetSectionY((int)(center.Y / 16f));
445 for (int j = sectionX - fluff; j < sectionX + fluff + 1; j++)
446 {
447 for (int k = sectionY - fluff; k < sectionY + fluff + 1; k++)
448 {
449 if (j >= 0 && j < Main.maxSectionsX && k >= 0 && k < Main.maxSectionsY && !Netplay.Clients[plr].TileSections[j, k] && !dontInclude.Contains(new Point(j, k)))
450 {
451 portalSections.Add(new Point(j, k));
452 }
453 }
454 }
455 }
456 }
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)

References Terraria.Entity.active, System.Collections.Generic.Dictionary< TKey, TValue >.Add(), Terraria.Entity.Center, Terraria.Netplay.Clients, System.Collections.Generic.Dictionary< TKey, TValue >.Contains(), Terraria.Netplay.GetSectionX(), Terraria.Netplay.GetSectionY(), Terraria.Main.maxSectionsY, Terraria.Main.projectile, and Terraria.Projectile.type.

Referenced by Terraria.MessageBuffer.GetData().